Long Questions (20*2=40 Marks)
1. Which of the following expressions represents the logical AND operation followed by the logical OR operation in sequence?
Show me the answer
Answer: 1)
Explanation:
This expression first applies the logical AND operation on and then applies the logical OR operation to combine the result with .
2. Which of the following terms best describes a problem for which there exists an algorithm that always halts with a correct yes/no answer?
- Turing Decidable
- Recursive
- Turing Undecidable
- Recursive Enumerable
Show me the answer
Answer: A) Turing Decidable
Explanation:
A Turing Decidable problem is one for which there exists an algorithm that will always halt with a correct yes/no answer.
3. What is the primary purpose of decomposing a reference architecture?
- To increase the overall system’s complexity
- To simplify the design and implementation process by breaking it into manageable components
- To eliminate the need for standardization
- To reduce the number of components in the system
Show me the answer
Answer: B) To simplify the design and implementation process by breaking it into manageable components
Explanation:
Decomposing a reference architecture simplifies the design and implementation process by dividing the system into manageable parts, making it easier to handle.
4. Which of the following correctly describes a one-to-many relationship?
- One department can have multiple employees.
- One student can enroll in multiple courses, and each course can have multiple students.
- Each order can be linked to multiple customers.
- Each customer can place multiple orders.
Show me the answer
Answer: A) One department can have multiple employees.
Explanation:
A one-to-many relationship is where one entity, such as a department, can be associated with multiple instances of another entity, like employees.
5: Given the vector and the scaling vector , what is the result of scaling the original vector by the scaling vector?
Show me the answer
Answer: A)
Explanation:
Scaling each component of the original vector by the corresponding component of the scaling vector results in .
6: In a genetic algorithm used to generate class routines, if the fitness function is defined as , what does this fitness function measure?
- The total number of classes in the schedule
- The number of conflicts in the schedule
- The total duration of the class schedule
- The number of students enrolled in the classes
Show me the answer
Answer: B) The number of conflicts in the schedule
Explanation:
The fitness function is designed to penalize routines with conflicts by incorporating them in the denominator. A higher number of conflicts leads to a lower fitness value. Thus, it measures the number of conflicts in the schedule, aiming to minimize them for an optimal solution.
7. In the demand paging memory, a page table is held in registers. If it takes 1000ms to service a page fault and if the memory access time is 20ms, what is the effective access time for a page fault rate of 0.01?
- 30.8ms
- 40ms
- 22ms
- 29.8ms
Show me the answer
Answer: 30.8ms
Explanation:
The effective access time (EAT) can be calculated using the formula:
Substituting the given values:
Thus, the effective access time is 30.8ms.
8. Capacitance is directly proportional to _________
- Area of cross section between the plates
- Distance of separation between the plates
- Both area and distance
- Neither area nor distance
Show me the answer
9. Convert the decimal number 156 to its octal representation.
- 254
- 20
- 1234
- 234
Show me the answer
10. Identify error in the program below;
#include <iostream>
using namespace std;
void printArray(int arr[], int size) {
for (int i = 0; i <= size; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
int main() {
int myArray[] = {1, 2, 3, 4, 5};
int arraySize = sizeof(myArray) / sizeof(myArray[0]);
printArray(myArray, arraySize);
return 0;
}
- Syntax Error
- Runtime Error
- Logical Error
- Linker Error
Show me the answer
11. What will be the output in following C++ program.
#include <iostream>
using namespace std;
int main() {
int a = 5;
int *p = &a;
*p = *p * 2;
a = a + 3;
cout << *p << endl;
cout << a << endl;
return 0;
}
- 10 13
- 8 8
- 10 10
- 8 10
Show me the answer
Answer:
1. 10 13
Explanation:
The given code performs the following steps:
int a = 5;
- Variable
a
is initialized with the value5
.
- Variable
int *p = &a;
- Pointer
p
is declared and assigned the address ofa
. So,p
points toa
.
- Pointer
*p = *p * 2;
*p
dereferences the pointer to access the value ofa
.- The value of
a
is multiplied by2
and assigned back toa
. - Now,
a = 10
.
a = a + 3;
- The value of
a
is incremented by3
. - Now,
a = 13
. Since*p
refers to the same memory location asa
, the value pointed to byp
is also13
.
- The value of
cout << *p << endl;
- Prints the value pointed to by
p
, which is13
.
- Prints the value pointed to by
cout << a << endl;
- Prints the value of
a
, which is also13
.
- Prints the value of
12. What is the output of the following production rule?
Production Rules:
- abba
- aabb
- bbaa
- baab
Show me the answer
13. Which category of transmission media includes twisted pair cables?
- Guided Media
- Coaxial Cables
- Fiber Optic Cables
- Unguided Media
Show me the answer
Answer:
1. Guided Media
Explanation:
Twisted pair cables fall under the category of guided media, which refers to transmission media where signals are guided along a physical path. Examples include twisted pair cables, coaxial cables, and fiber optic cables. In contrast, unguided media refers to wireless communication, such as radio waves or satellite signals.
14. Consider the following four processes in the shortest job next scheduling. Calculate the average turnaround time.
Processes:
Process | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 8 |
P2 | 1 | 4 |
P3 | 2 | 2 |
P4 | 3 | 6 |
- 10
- 11.5
- 12
- 13
Show me the answer
Answer:
2. 11.5
Explanation:
The shortest job next (SJN) scheduling prioritizes processes with the shortest burst time. The processes are executed in the following order:
- P1: Runs first from time to (completion time = ).
- P3: Next, the shortest job is , which runs from to (completion time = ).
- P2: Then runs from to (completion time = ).
- P4: Finally, runs from to (completion time = ).
Calculating Turnaround Time:
- P1:
- P2:
- P3:
- P4:
Average Turnaround Time:
15. What is the correct order of phases in the Waterfall model of software development?
- Requirement Analysis → System Design → Implementation → Integration and Testing → Deployment → Maintenance
- Requirement Analysis → Implementation → System Design → Integration and Testing → Deployment → Maintenance
- Implementation → System Design → Requirement Analysis → Integration and Testing → Deployment → Maintenance
- System Design → Requirement Analysis → Implementation → Integration and Testing → Maintenance → Deployment
Show me the answer
Answer:
1) Requirement Analysis → System Design → Implementation → Integration and Testing → Deployment → Maintenance
Explanation:
The Waterfall model is a linear and sequential approach to software development. Each phase must be completed before the next begins.
- Requirement Analysis: Collect and document user requirements.
- System Design: Create a blueprint of the system.
- Implementation: Translate the design into code.
- Integration and Testing: Verify that components work together and meet requirements.
- Deployment: Deliver the software to the user.
- Maintenance: Update and fix issues in the software after deployment.
16. Which of the following characteristics is true for an ideal operational amplifier?
- The ideal op-amp has a finite open-loop gain, resulting in a non-zero voltage difference between the inverting and non-inverting inputs.
- The ideal op-amp has infinite input impedance and zero output impedance.
- The ideal op-amp can only be used in linear configurations and cannot be used in switching applications.
- The ideal op-amp has a non-zero input bias current, which affects the accuracy of the amplifier.
Show me the answer
Answer:
2) The ideal op-amp has infinite input impedance and zero output impedance.
Explanation:
An ideal operational amplifier has the following characteristics:
- Infinite input impedance to prevent current flow into the input terminals.
- Zero output impedance to allow maximum power transfer.
- Infinite open-loop gain, ensuring accurate amplification.
17. In supervised learning, what is the main objective during training?
- To group similar data points
- To predict outputs without labeled data
- To learn the mapping from inputs to outputs using labeled data
- To find hidden patterns without predefined labels
Show me the answer
Answer:
3) To learn the mapping from inputs to outputs using labeled data.
Explanation:
Supervised learning involves training a model using a dataset with labeled examples. The objective is to learn a function that maps input data to the correct output. Once trained, the model can predict outputs for new, unseen inputs.
18. In a full binary tree, if the number of internal nodes is ( I ), then the number of leaves ( L ) is?
Show me the answer
Answer:
2) ( L = I + 1 )
Explanation:
In a full binary tree:
- Every internal node has exactly two children.
- The total number of nodes ( N ) in the tree is related to the number of leaves ( L ) and internal nodes ( I ) as ( N = 2 \cdot I + 1 ).
- Since ( L = N - I ), substituting the total nodes gives ( L = I + 1 ).
19. A process refers to 5 pages (A, B, C, D, E) in the order: A, B, C, D, A, B, E, A, B, C, D, E. If the page replacement algorithm is FIFO, and the number of page frames is increased to 4, what happens to the number of page transfers?
- Decreases
- Increases
- Remains the same
- None of the mentioned
Show me the answer
Answer:
2) Increases
Explanation:
In the FIFO (First-In-First-Out) page replacement algorithm:
- Pages are replaced in the order they were brought into memory.
- Increasing the number of page frames may sometimes lead to an increase in page faults due to the Belady’s Anomaly.
- In this case, increasing the number of frames to 4 results in more page transfers as the anomaly occurs.
20. You plan to invest $1,000 in a savings account that offers an annual interest rate of 5%, compounded quarterly. You want to know the future value of this investment after 3 years.
- $1130
- $1227.5
- $1500
- $2000
Show me the answer
Answer:
2) $1227.5
Explanation:
The formula for compound interest is:
Where:
- FV = Future Value
- P = Principal amount = 1000
- r = Annual interest rate = 0.05
- n = Number of compounding periods per year = 4 (quarterly)
- t = Time in years = 3
Substituting values:
Using a calculator:
The future value of the investment after 3 years is $1227.5.