Previous Year Paper

UGC NET (Computer Science) Official Paper (Held On 11 Nov, 2020) (Previous Year Paper)

Held in 2020

100 questions120 minutes
With answers
Free

Paper last updated:

Practise under exam conditions

Take this paper as a timed mock test. Review your answers after you submit.

Attempt timed test

Questions & answers

Read the paper at your pace. Open an explanation when you need it.

Computer Science (100 questions)

Question 1

Arrange the following types of Cohesion from best to worst type.

(A) Logical Cohesion

(B) Sequential Cohesion

(C) Communication Cohesion

(D) Temporal Cohesion

(E) Procedural Cohesion

Choose the correct answer from the options given below:

  1. AOption (a)

    A → D → E → C → B

  2. BOption (b)

    A → E → D → C → B

  3. COption (c)

    B → E → C → D → A

  4. DOption (d)

    B → C → E → D → A

View answer & explanation

Correct answer

Answer: (d)D.

B → C → E → D → A

Why this answer is correct

Concept:

  • A design solution is said to be highly modular if the different modules in the solution have high cohesion and their inter-module couplings are low.
  • Cohesion is like a type of ranking which is used to measure the degree of modules that are functionally related

The degree of Cohesion can be defined as

Therefore B → C → E → D → A is the correct order

Additional Information

Logical cohesion:

A module is said to be logically cohesive, if all elements of the module perform similar operations, such as error handling, data input, data output, etc.

Example of logical cohesion

consider a module that contains a set of print functions to generate various types of output reports such as grade sheets, salary slips, annual reports, etc.

 

Sequential Cohesion:

An element outputs some data that becomes the input for other elements, i.e., data flow between the parts. It occurs naturally in functional programming languages.

 

Temporal Cohesion:

The elements are related by their timing involved. A module connected with temporal cohesion all the tasks must be executed in the same time-span. This cohesion contains the code for initializing all the parts of the system. Lots of different activities occur, all at init time.

 

Communicational Cohesion:

Two elements operate on the same input data or contribute towards the same output data. Example- update record in the database and send it to the printer.

 

Procedural Cohesion:

Elements of procedural cohesion ensure the order of execution. Actions are still weakly connected and unlikely to be reusable. Ex- calculate student GPA, print student record, calculate cumulative GPA, print cumulative GPA.

Question 2

Consider the statement below.

A person who is radical (R) is electable (E) if he/she is conservative (C), but otherwise is not electable.

Few probable logical assertions of the above sentence are given below.

(A) (R∧E)⟺C\left( {R \wedge E} \right) \Longleftrightarrow C

(B) R;⇒(E⇔C)R; \Rightarrow \left( {E \Leftrightarrow C} \right)

(C) R⇒((C⇒E)V;¬;E)R \Rightarrow \left( {\left( {C \Rightarrow E} \right)V;\neg ;E} \right)

(D) (¬;R∨¬;E∨C)∧(¬;R∨¬;C∨E);;\left( {\neg ;R \vee \neg ;E \vee C} \right) \wedge \left( {\neg ;R \vee \neg ;C \vee E} \right);;

Which of the above logical assertions are true?

Choose the correct answer from the options given below:

  1. AOption (a)

    (B) only 

  2. BOption (b)

    (C) only

  3. COption (c)

    (A) and (C) only

  4. DOption (d)

    (B) and (D) only

View answer & explanation

Correct answer

Answer: (d)D.

(B) and (D) only

Why this answer is correct

The correct answer is option 4

Explanation:

  1. (R ∧ E) ⟺ C says that all (and only) conservatives are radical and electable. So, this assertion is not true.

  2. R ⇒ (E ⇔ C) says that same as the given assertion. This is a correct assertion.

  3. R ⇒ ((C ⇒ E) V ¬E) = ¬R∨(¬C∨E∨ ¬E) which is true for all interpretations. This is not a correct assertion.

  4. ( ¬ R V ¬ E V C) ∧ (¬ R V ¬ C V E) = (¬ RV( E⇒ C)) ∧ (¬ R V (C ⇒ E)) = R ⇒ (E ⇔ C) which is equivalent to assertion B. This is also true.

Question 3

Consider the following argument with premise (∀xP(x))∨Q(x))({\forall _x}P\left( x \right)) \vee Q\left( x \right)) and conclusion (∀xP(x))∧(∀xQ(x))({\forall _x}P\left( x \right)) \wedge (\forall_xQ\left( x \right))

(A)  ∀x (P(x) ∨ Q(x))Premise
(B) P(c) ∨ Q(c)Universal instantiation from (A)
(C) P(c)Simplification from (B)
(D) ∀x P(x)Universal Generalization of (C)
(E) Q(c)Simplification from (B)
(F) ∀x Q(x)Universal Generalization of (E)
(G) (∀x P(x)) ∧ (∀x Q(x))Conjunction of (D) and (F)
  1. AOption (a)

    This is a valid argument.

  2. BOption (b)

    Steps (C) and (E) are not correct inferences

  3. COption (c)

    Steps (D) and (F) are not correct inferences

  4. DOption (d)

    Step (G) is not a correct inference

View answer & explanation

Correct answer

Answer: (b)B.

Steps (C) and (E) are not correct inferences

Why this answer is correct

The correct answer is option2

Explanation:

For C and E to be true, the assertion should be P(c) ∧ Q(c). Hence, this is not a correct inference

Additional Information

In predicate logic, universal generalization states that if ⊢P(x)⊢P(x)⊢P(x) {\displaystyle \vdash !P(x)}

has been derived, then ⊢∀xP(x)⊢∀xP(x)⊢∀xP(x) {\displaystyle \vdash !\forall x,P(x)}

can be derived.

Question 4

Simplified expression/s for following Boolean function F(A, B, C, D) = ∑ (0, 1, 2, 3, 6, 12, 13, 14, 15) is/are

(A) A'B' + AB + A'C'D'

(B) A'B' + AB + A'CD'

(C) A'B' + AB + BC'D'

(D) A'B' + AB + BCD'

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) only

  2. BOption (b)

    (B) only 

  3. COption (c)

    (A) and (B) only

  4. DOption (d)

    (B) and (D) only

View answer & explanation

Correct answer

Answer: (d)D.

(B) and (D) only

Why this answer is correct

The correct answer is option 4

K-maps

F(A, B, C, D) = ∑ (0, 1, 2, 3, 6, 12, 13, 14, 15)

Two K-Maps can be constructed from the given boolean function

The expression for K-Map 1 is AB + A'B' + A'CD'

The expression for K-Map 2 is AB +A'B' + BCD'

Question 5

Given below are two statements: One is labeled as Assertion (A) and the other is labeled as Reason (R) :

Statement I: In Caesar Cipher each letter of Plain text is replaced by another letter for encryption. 

Statement II: Diffie-Hellman algorithm is used for exchange of secret key. 

In the light of the above statements, choose the correct answer from the options given below:

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1

Key Points

Caesar Cipher:

  • It is one of the simplest techniques for encryption where each letter of a given text is replaced by a letter some fixed number of positions down the alphabet.
  • For example, the text "ABC" can be encrypted using the Ceasar Cipher technique as "CDE". Here the shift (number of positions shifted) is 2.

Diffie-Hellman algorithm:

  • Diffie-Hellman algorithm is used for the exchange of secret key over an insecure channel.
  • Once the key is shared by both the sender and receiver, then the communication is done using the shared symmetric keys.

Question 6

Consider a single-level page table system. with the page table stored in the memory. If the hit rate to TLB is 80%, and it takes 15 nanoseconds to search the TLB. and 150 nanoseconds to access the main memory, then what is the effective memory access time, in nanoseconds ?

  1. AOption (a)

    185

  2. BOption (b)

    195

  3. COption (c)

    205

  4. DOption (d)

    175

View answer & explanation

Correct answer

Answer: (b)B.

195

Why this answer is correct

Data:

TLB hit ratio = p = 0.8

TLB access time = 15 nanoseconds

Memory access time = m = 150 milliseconds

Formula:

EMAT = p × (t + m) + (1 – p) × (t + m + m)

Calculation:

EMAT = 0.8 × (15 + 150) + (1 – 0.8) × (15 + 150 + 150)

EMAT = 195 nanoseconds.

Important points:

During TLB hit

Frame number is fetched from the TLB (15 ms)

and page is fetched from physical memory (150 ms)

During TLB miss

TLB no entry matches (15 ms)

Frame number is fetched from the physical memory (150 ms)

and pages are fetched from physical memory (150 ms)

Question 7

A non-pipeline system takes 50ns to process a task. The same task can be processed in six-segment pipeline with a clockcycle of 10ns. Determine approximately the speedup ratio of the pipeline for 500 tasks.

  1. AOption (a)

    6

  2. BOption (b)

    4.95

  3. COption (c)

    5.7

  4. DOption (d)

    5.5

View answer & explanation

Correct answer

Answer: (b)B.

4.95

Why this answer is correct

Concept:

Speed up factor is defined as the ratio of time required for non-pipelined execution to that of time received for pipelined execution.

Data:

Time for non-pipelined execution per task = tn = 50 ns

Time for pipelined execution per task =  tp = 10 ns

Number of stages in the pipeline = k = 6

Number of tasks = 500

Formula

S=TnTpS = \frac{{{T_n}}}{{{T_p}}}

S = speed up factor

Calculation:

Time for non-pipelined = Tn = tn × Number of tasks

Time for non-pipelined = Tn =  50 × 500

Time for pipelined = Tp​ = 1st task × k × tp + (All Remaining Tasks (k - 1)) × tp

Time for pipelined = Tp​ =  1 × 6 × 10 + (500 - 1) × 10

S=TnTp=4.95S = \frac{{T_n}}{{T_p}} = 4.95

Question 8

Given below are two statements:

Statement I: 5 divides n5 - n whenever n is a nonnegative integer.

Statement II: 6 divides n3 - n whenever n is a nonnegative integer.

In the light of the above statements. choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are correct

  2. BOption (b)

    Both Statement I and Statement II are incorrect

  3. COption (c)

    Statement I is correct but Statement II is incorrect

  4. DOption (d)

    Statement I is incorrect but Statement II is correct

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are correct

Why this answer is correct

The correct answer is option 1

Both statement l and statement ll are correct

Solution:

Statement l: 5 divides n5 - n

Using mathematical Induction, if n5 - n is divisible by 5, then (n+1)5 - (n+1) is also divisible by 5.

If 5 divides, n5 - n = 5.k

(n+1)5 - (n+1) = n5 + 5n4 + 10n3 + 10n2 + 5n - n

                       = 5.k + 5( n4 + 2n3 + 2n2 +n)

This shows that (n+1)5 - (n+1) is a multiple of 5. Hence it is always divisible by 5.

Statement ll: 6 divides n3 - n

n3 - n = n (n2 - 1)

          = n (n + 1)(n - 1)

Here n, n + 1, and n-1 are three consecutive integers. One of them is a multiple of 2 and the other is a multiple of 3. Hence 6 divides n3 - n is always divisible by 6 whenever n is a non-negative integer.

Question 9

Which of the following cloud concept/s is/are related to pooling and sharing of resources?

(A) Virtual Memory

(B) Service

(C) Virtualization

Choose the correct answer from the options given below:

  1. AOption (a)

    (C) only

  2. BOption (b)

    (A) and (B) only

  3. COption (c)

    (A) only

  4. DOption (d)

    (B) only

View answer & explanation

Correct answer

Answer: (a)A.

(C) only

Why this answer is correct

The correct answer is option 1

Key Points

Virtualization is a technique where multiple operating systems run simultaneously on a single machine virtually.

These machines can be accessed remotely by different users at the same time.

Here, the same hardware like memory and CPU are utilized by all the operating systems in a systematic manner.

Additional Information

Virtual Memory:

  • In computers, the size of the main memory is very less compared to the size of the secondary memory.
  • This limits the size of the program and the degree of concurrency.
  • The concept of virtual memory is developed to address this problem.
  • Here the entire secondary memory can be accessed just like main memory using page replacement algorithms.

Question 10

Consider the following regular expressions:

(a) r = a(b + a)*

(b) s = a(a + b)+

(c) t = aa*b

Choose the correct answer from the options given below based on the relation between the languages generated by the regular expressions above:

  1. AOption (a)

    L(r) ⊆ L(s) ⊆ L(t) 

  2. BOption (b)

    L(r) ⊇ L(s) ⊇ L(t) 

  3. COption (c)

    L(r) ⊇ L(t) ⊇ L(s)

  4. DOption (d)

    L(s) ⊇ L(t) ⊇ L(r)

View answer & explanation

Correct answer

Answer: (b)B.

L(r) ⊇ L(s) ⊇ L(t) 

Why this answer is correct

The correct answer is option 2

Explanation:

L(r) = {a, aa, ab, aaa, aab, .... } This is a set of all strings starting with 'a'

L(s) = {aa, ab, aaa, aab, .... } This is a set of all strings starting with 'aa' or 'ab'

L(t) = {ab, aab, aaab, aaaab, ...} This a set of all strings starting with 'a', ending with 'b' and contains any number of 'a's in between them.

Therefore L(r) ⊇ L(s) ⊇ L(t)

Additional Information

  • represents 0 or more number of symbols.
  • represents 1 or more number of symbols.

Question 11

Assuming that the system call fork () never fails, consider the following C programs P1 and P2 executed on a UNIX / Linux system:

/P1/ Int main() { fork (): fork () ; fork () ; Printf(“Happy\n”); }/P2/ Int main() { fork (); Printf(“Happy\n”); fork () Printf(“Happy\n”); fork () ; Printf(“Happy\n”); }

 

Statement I: P1 displays "Happy" 8 times.

Statement II: P2 displays "Happy" 12 times.

In the light of the above statements, choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (c)C.

Statement I is correct but Statement II is false

Why this answer is correct

The correct answer is option 3

Explanation:

fork() is a system call used to create a child process.

Once a child process is created, both the parent process and the child process run the next line following the fork() command simultaneously.

'n' number of successive for() calls create 2n - 1 child processes.

in P1:

Each child process prints one "Happy".

Parent process also prints one "Happy".

So, number of times P1 displays "Happy" = (23 - 1) + 1 = 8

In P2:

At first fork(), a new child process with two fork() and printf statements is created.

Similarly, more child processes are created at each fork() command.

So, P2 shows "Happy" 14 (2 + 4 + 8 )times.

Question 12

Let G be a simple undirected graph, TD be a DFS tree on G, and TB be the BFS tree on G.

Consider the following statements.

Statement I: No edge of G is a cross with respect to TD

Statement II: For every edge (u, v) of G. if u is at depth i and v is at depth j in TB then |i - j| = 1. In the light of the above statements, choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (c)C.

Statement I is correct but Statement II is false

Why this answer is correct

The correct answer is option 3

Explanation:

Statement l: Correct

Undirected graphs do not have cross edges in Depth First Search. But there can be cross edges in directed graphs. This statement is true.

Statement ll: InCorrect

In Breadth-First Search, an edge can be present between vertices of the same level. So,  | i - j | = 0. This statement is false.

Question 13

Which among the following statement(s) is (are) true?

(A) A hash function takes a message of arbitrary length and generates a fixed length code.

(B) A hash function takes a message of fixed length and generates a code of variable length.

(C) A hash function may give same hash value for distinct messages.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) only

  2. BOption (b)

    (B) and (C) only

  3. COption (c)

    (A) and (C) only

  4. DOption (d)

    (B) only

View answer & explanation

Correct answer

Answer: (c)C.

(A) and (C) only

Why this answer is correct

The correct answer is option 3.

Key Points

A hash function is defined as any function that can be used to map data of the arbitrary size of data to fixed-size data.

Definition of hash function Statement 1 is correct and Statement 1 is incorrect.

 A hash function may give the same hash value for distinct messages. Yes, it's true. If N%10 is a Hash function. It gives the same values for 101, 11,21,31 as 1.

Hence statement C is correct.

∴ Hence the correct answer is (A) and (C) only.

Question 14

A Software project was estimated at 864 Function Points. A six person team will be assigned to project consisting of a requirement gathering person, one designer, two programmers and two testers. The salary of the designer is Rs. 70.000 per month, requirement gatherer is  Rs. 50,000 per month, programmer is Rs. 60.000 per month and a tester is Rs. 60,000 per month. Average productivity for the team is 12 FP per person month. Which of the following represents the projected cost of the project ?

  1. AOption (a)

    Rs. 33,20,000

  2. BOption (b)

    Rs. 43,20,000

  3. COption (c)

    Rs. 33,10,000

  4. DOption (d)

    Rs. 22,10,000

View answer & explanation

Correct answer

Answer: (b)B.

Rs. 43,20,000

Why this answer is correct

The correct answer is option 2.

Key Points

Given data, Functional Point=864

team=6 persons

average each peson(FP) productivity=12

designer month salary=70000

programmers month salary=2x60000

tester month salary=2x60000

Requirement gatherer=50000

Projected cost of project=?

Total number of months=FunctionalPoint(FP)(Team×Averageeachperson(FP)productivity)\frac{Functional Point(FP)}{(Team \times Average each person (FP) productivity)}= 8646×12\frac{864}{6\times12}

=12 months

Total cost of the project=(one designer salary+2 x Programmer month salary+2 x tester month salary+one requirement gatherer) x total number of months

=(70000+2x60000+2x60000+50000)x12

=43,20,000

∴ Hence the correct answer is Rs. 43,20,000.

Question 15

Which of the following statements with respect to K-segment pipelining are true ?

(A) Maximum speedup that a pipeline can provide is k theoretically.

(B) It is impossible to achieve maximum speedup k in k-segment pipeline

(C) All segments in pipeline take same time in computation.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (B) and (C) only

  3. COption (c)

    (A) and (C) only

  4. DOption (d)

    (A). (B) and (C)

View answer & explanation

Correct answer

Answer: (a)A.

(A) and (B) only

Why this answer is correct

The correct answer is option 1.

Key Points

Pipelining: Overlapping execution- parallelism improves performance. The aim of using pipelining is to use a single clock per instruction (CPI) which automatically improves performance.

Statement A is true:

S=tntp S = {{tn} \over tp} \  if we assume that the time it takes to process a task is the same in the pipeline and pipelined circuits, we will have tn = ktp. Including this assumption, the speedup reduces to S=ktptp S = {{ktp} \over tp} \ =k

This shows that the theoretical maximum speedup that a pipeline can provide is k, where k is the number of segments in the pipeline.

Statement B True:

K × efficiency =speedup

The speedup can not be equals to K till efficiency becomes 1 and in real-time environment efficiency can not become 1 of many reasons like the delay at intermediate buffers, different times taken by different segments to perform their sub-operations which cause all other segments to waste time while waiting for the next clock.

Statement C False: Because different segments can take different times to complete their sub-operations.

Hence the correct answer is (A) and (B) only.

Question 16

Modifying the software by restructuring is called

  1. AOption (a)

    Adaptive maintenance

  2. BOption (b)

    Corrective maintenance

  3. COption (c)

    Perfective maintenance

  4. DOption (d)

    Preventive maintenance

View answer & explanation

Correct answer

Answer: (c)C.

Perfective maintenance

Why this answer is correct

The correct answer is option 3.

Key Points

Corrective, adaptive, perfective, and preventive maintenance are the four forms of maintenance.

  • Corrective maintenance focuses on resolving issues that arise when the programme is in operation.
  • Adaptive maintenance is concerned with the changes made to the software in order to make it adaptable to new environments, such as running it on a new operating system.
  • The term "perfective maintenance" refers to the changes in the software that occur as a result of adding new features.
  • Preventive maintenance entails making adjustments to avoid mistakes from occurring. The following graph shows the distribution of maintenance types by type and percentage of time spent.

∴ Hence the correct answer is Perfective maintenance.

Question 17

Match List I with List II

List IList II
(A) Topological sort of DAG(I) O(V + E)
(B) Kruskal's MST algorithm(II) O(VE)
(C) Bellman-Ford's single-source shortest path algorithm(III) θ (V + E)
(D) Floyd-Warshall's all-pair   shortest path algorithm(IV) θ(V3)

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - I, B - III, C - IV, D - II 

  2. BOption (b)

    A - III, B - I, C - IV, D - II 

  3. COption (c)

    A - III, B - I, C - II, D - IV 

  4. DOption (d)

    A - I, B - III, C - II, D - IV 

View answer & explanation

Correct answer

Answer: (d)D.

A - I, B - III, C - II, D - IV 

Why this answer is correct

The correct answer is option 4.

Key Points

Topological sort of DAG= O(V + E)

Bellman-Ford's single-source shortest path algorithm=O(VE)

Floyd-Warshall's all-pairs shortest path algorithm= θ(V3)

Kruskal's MST algorithm= θ (V + E)

Due to sorting the edges, the dominant term in Kruskal's time complexity is O(ElogE). However, if we can conduct sorting in linear time or if the edges are already sorted, the problem can be solved by detecting whether there is a cycle in the graph or not. Since the edges have already been sorted, add each edge to MST one by one.

It is now possible to determine whether or not an undirected graph has a cycle:

1)   select one among DFT or BFT:- O(V+E)

2)   Using Union-Find:- O(ElogV)

 ∴ Kruskal’s MST algorithm :-  θ(V+E)

∴ Hence the correct answer is A - I, B - III, C - II, D - IV.

Question 18

Find the lexicographic ordering of the bit strings given below based on the ordering 0 < 1.

(A) 001

(B) 010

(C) 011

(D) 0001

(E) 0101

Choose the correct answer from the options given below:

  1. AOption (a)

    001 < 010 < 011 < 0001 < 0101

  2. BOption (b)

    0001 < 001 < 010 < 0101 < 011

  3. COption (c)

    0001 < 0101 < 001< 010 < 011

  4. DOption (d)

    001 < 010 < 0001 < 0101 <011

View answer & explanation

Correct answer

Answer: (b)B.

0001 < 001 < 010 < 0101 < 011

Why this answer is correct

The correct answer is option 2

Explanation:

Lexicographic order is nothing but dictionary order.

To determine the order of strings, we need to compare each bit of all the strings one by one.

For example, take 001 and 010. Here, the second bits of the strings are 0, 1 respectively.

Since 0 < 1 as per the given question, 001<010.

Similarly, 0001 < 001 < 010 < 0101 < 011

Alternate Method

Replace 0 with A and 1 with B and follow dictionary order 

AAAB<AAB<ABA<ABAB<ABB

Question 19

Consider the following pseudo-code fragment, where a and b are integer variables that have

been initialized:

/* Pre-conditions : (a > 1 ∧ a < b) */

/* Assume that overflow never occurs */

int x = 0; int p = 1;

while (p < b) {

p = p * a;

x = x + 1;

}

When the while loop terminates, what will be the value of x in terms of a and b ?

  1. AOption (a)

    ab

  2. BOption (b)

    ba

  3. COption (c)

    \(\left[ {\log _a^b/} \right]\left[ ; \right]means;floor/\)

  4. DOption (d)

    \(\left[ {\log _a^b/} \right]\left[ ; \right]means;ceil/\)

View answer & explanation

Correct answer

Answer: (d)D.

\(\left[ {\log _a^b/} \right]\left[ ; \right]means;ceil/\)

Why this answer is correct

The correct answer is option 4

Explanation

Since  a > 1 and a < b

int x=0 , int p=1

Let us assume a=2 and b=15

Whenever the loop is entered, the value of p is doubled and the value of x is incremented by 1.

In iteration 1: p = 2, x = 1

In iteration 2: p = 4, x = 2

In iteration 3: p = 8, x = 3

In Iteration 4: p = 16, x = 4

Final values are a = 2, b = 15, p = 16, x = 4

From the above values, it can be seen that x =[loga**b]

Question 20

Which of the following statements are true?

(A) Minimax search is breadth-first: it processes all the nodes at a level before moving to a node in next level.

(B) The effectiveness of the alpha-beta pruning is highly dependent on the order in which the states are examined.

(C) The alpha-beta search algorithm computes the same optimal moves as minimax algorithm.

(D) Optimal play in games of imperfact information does not require reasoning about the current and future belief states of each player.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A), (C) only

  2. BOption (b)

    (A) and (D) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (C) and (D) only

View answer & explanation

Correct answer

Answer: (c)C.

(B) and (C) only

Why this answer is correct

The correct answer is option 3.

Key Points

Statement (A): Minimax search is breadth-first: it processes all the nodes at a level before moving to a node in the next level. But it is a depth-first search.

Hence the statement A is False.

Statement (B):  The effectiveness of the alpha-beta pruning is highly dependent on the order in which the states are examined.

Yes. It depends on which children are visited first. It's likely that no pruning happens if a node's children are visited in the worst possible order. We want to visit the best child first for max nodes so that time is not lost on the other children who are exploring worse scenarios. We want to start with the worst child when it comes to min nodes.

Hence the statement B is true.

Statement C: The alpha-beta search algorithm computes the same optimal moves as the minimax algorithm.

True, it prunes nodes that have no bearing on the final outcome.

Hence the statement C is true.

Statement D: Optimal play in games of imperfect information does not require reasoning about the current and future belief states of each player.

False, it necessitates.

Hence the statement D is False.

Question 21

Match List I with List II

With reference to CMM developed by Software Engineering Institute (SEI)

List IList II
(A) INITIAL(I) Process measurement
(B) REPEATABLE(II) Process definition
(C) DEFINED(III) Project management
(D) MANAGED(IV) ADHOC

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - III, B - IV, C - II, D - I 

  2. BOption (b)

    A - IV, B - III, C - I, D - II 

  3. COption (c)

    A - IV, B - III, C - II, D - I 

  4. DOption (d)

    A - III, B - IV, C - I, D - II

View answer & explanation

Correct answer

Answer: (c)C.

A - IV, B - III, C - II, D - I 

Why this answer is correct

The correct answer is option 3.

Key Points

Initial (chaotic, ad hoc, individual heroics) - the stage at which a new or undocumented repeat mechanism may be used.

**Repeatable -**At the very least, the procedure is well recorded such that the same steps can be tried again.

Defined - As a normal business procedure, the process has been described and verified.

Managed (Capable)- The method is handled quantitatively according to agreed-upon metrics.

Optimizing (Efficient)- process management includes deliberate process optimization.

∴Hence the correct answer is A-IV, B - III, C - II, D - I.

Additional Information

Question 22

Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to a vertex j if and only if either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is 

  1. AOption (a)

    23

  2. BOption (b)

    99

  3. COption (c)

    4

  4. DOption (d)

    7

View answer & explanation

Correct answer

Answer: (d)D.

7

Why this answer is correct

The correct answer is option 4.

Key Points

Edge set consists of edges from i to j, using either two conditions are j = i + 1 or j = 3i

Second choice helps us to move from 1 to 100. The trick to slot this is to think the other way around. Try to find a 100 to 1 trail, instead of having a 1 trail to 100.

So, the edge sequence with the minimum number of edges is

1 → 3 → 9 → 10 → 11 → 33 → 99 → 100

which consists of 7 edges.

Hence the correct answer is 7.

Question 23

Consider the undirected graph below:

Using Prim's algorithm to construct a minimum spanning tree starting with node a, which one of the following sequences of edges represents a possible order in which the edges would be added to construct the minimum spanning tree?

  1. AOption (a)

    (a, b), (b, h), (g, h), (f, g), (c, f), (c, i), (c, d), (d, e) 

  2. BOption (b)

    (a, b), (b, h), (g, h), (g, i), (c, i), (c, f), (c, d), (d, e) 

  3. COption (c)

    (a, b), (b, c), (c, i), (c, f), (f, g), (g, h), (c, d), (d, e) 

  4. DOption (d)

    (a, b), (g, h), (g, f), (c, f), (c, i), (f, e), (b, c), (d, e) 

View answer & explanation

Correct answer

Answer: (c)C.

(a, b), (b, c), (c, i), (c, f), (f, g), (g, h), (c, d), (d, e) 

Why this answer is correct

The correct answer is option 1 and option 3.

Concept:

A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges(V – 1 ) of a connected, edge-weighted undirected graph G(V, E) that connects all the vertices together, without any cycles and with the minimum possible total edge weight.

Key Points

 

The final sequence will be (a, b), (b, c), (c, i), (c, f), (f, g), (g, h), (c, d), (d, e) with a cost 37.  

Another final sequence is (a, b), (a, h), (g, h), (f, g), (c, f), (c, i), (c, d), (d, e) with a cost is 37(Two sequences possible ).

Question 24

Which of the following statements with respect to multiprocessor system are true?

(A) Multiprocessor system is controlled by one operating system.

(B) In Multiprocessor system, multiple computers are connected by the means of communication lines.

(C) Multiprocessor system is classified as multiple instruction stream and multiple data stream system.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) only

  2. BOption (b)

    (A) and (B) only

  3. COption (c)

    (A) and (C) only

  4. DOption (d)

    (B) and (C) only

View answer & explanation

Correct answer

Answer: (c)C.

(A) and (C) only

Why this answer is correct

The correct answer is option 3.

Key Points

A multiprocessor is a computer system having two or more processing units i.e multiple processors each sharing main memory and peripherals, in order to simultaneously process programs.

  • Multiprocessor systems are controlled by one or more operating systems. Hence Statement I is correct.
  • In a Multiprocessor system, multiple processors are connected under single computer systems. Hence Statement II is incorrect.
  • Multiprocessor system is classified as multiple instruction streams and multiple data streams systems. Hence Statement III is correct.

​∴ Hence the correct answer is (A) and (C) only.

Question 25

Match List I with List II

List IList II
(A) Serial Line IP (SLIP)(I) Application layer)
(B) Border Gateway Protocol (BGP)(II) Transport layer
(C) User Data Protocol (UDP)(III) Data Link layer
(D) Simple Network Management(IV) Network layer

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - I, B - II, C - III, D - IV 

  2. BOption (b)

    A - III, B - IV, C - II, D - I 

  3. COption (c)

    A - II, B - III, C - IV, D - I 

  4. DOption (d)

    A - III, B - I, C - IV, D - II 

View answer & explanation

Correct answer

Answer: (b)B.

A - III, B - IV, C - II, D - I 

Why this answer is correct

The correct answer is option 2.

Key Points

  • Serial Line Internet Protocol (SLIP) is a Data Link layer simple protocol that works with TCP/IP for communication over serial ports and routers. They provide communications between machines that were previously configured for direct communication with each other.
  • Border Gateway Protocol (BGP) is a Network layer used to exchange routing information for the internet and is the protocol used between ISP which are different ASes.
  • User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol.
  • SNMP is an application layer protocol that uses UDP port number 161/162.SNMP is used to monitor the network, detect network faults and sometimes even used to configure remote devices

∴ Hence the correct answer is A-III, B -IV, C -II, D -I.

Additional Information

Question 26

Which of the following pairs of propositions are not logically equivalent ?

  1. AOption (a)

    ((p → r) ∧ (q → r)) and ((p ∨ q) → r)

  2. BOption (b)

    p ↔ q and (¬ p ↔ ¬ q) 

  3. COption (c)

    (p → q) ∧ (q → p) and p ↔ q

  4. DOption (d)

    ((p ∧ q) → r ) and ((p → r) ∧ (q → r))

View answer & explanation

Correct answer

Answer: (d)D.

((p ∧ q) → r ) and ((p → r) ∧ (q → r))

Why this answer is correct

The correct answer is option 4.

Key Points

Option A: ((p → r) ∧ (q → r)) and ((p ∨ q) → r)

Both are equal and it gives the same truth table. Hence it is logically equivalent. 

Option B:  p ↔ q and (¬ p ↔ ¬ q)

(p → q)(q → p) and (¬ p → q)(¬ q →p)

(p+q̅)(q+p̅) and (p+q̅)(q+p̅)

Both are equal and it gives the same truth table. Hence it is logically equivalent. 

Option C:  (p → q) ∧ (q → p) and p ↔ q 

Both tables give equal values. Hence it is logically equivalent.

Option D: ((p ∧ q) → r ) and ((p → r) ∧ (q → r))

PQR¬P¬QP⇒RQ⇒R(P⇒R)∧(Q⇒R)P**∧**QP∧Q⇒R
TTTFFTTTTT
TTFFFFFFTF
TFTFTTTTFT
TFFFTFTFFT
FTTTFTTTFT
FTFTFTFFFT
FFTTTTTTFT
FFFTTTTTFT

The above truth table is not equivalent. Hence the above statement is True, Logically not equivalent. 

∴ Hence the correct answer is  ((p ∧ q) → r ) and ((p → r) ∧ (q → r)).

Question 27

Which of the following statements are true ?

(A) A sentence α entails another sentence β  if β is true in few worlds where α is true.

(B) Forward chaining and backward chaining are very natural reasoning algorithms for knowledge bases in Horn form.

(C) Sound inference algorithms derive all sentences that are entailed.

(D) Propositional logic does not scale to environments of unbounded size.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (B) and (C) only

  3. COption (c)

    (C) and (D) only

  4. DOption (d)

    (B) and (D) only

View answer & explanation

Correct answer

Answer: (d)D.

(B) and (D) only

Why this answer is correct

The correct answer is option 4.

Key Points

The relationship of entailment between sentences is crucial to our understanding of reasoning. A sentence α entails another sentence β if β is true in all world where α  is true. Equivalent definitions include the validity of the sentence α⇒β and the unsatisfiability of sentence α∧¬β.

Hence statement I is False.

For information bases in Horn form True, forward and backward chaining is rather normal reasoning algorithms. These are very natural algorithms that run in linear time.

Hence statement II is True.

Both sentences that are entailed False are derived by sound inference algorithms (it is complete not sound) If only sentences entailed by Knowledge Base are derived, the inference algorithm is sound.

Hence statement III is False.

Propositional logic does not scale to unbounded conditions. That is right. Propositional logic is relatively efficient for certain tasks within an agent, but it does not scale to unbounded environments because it lacks the descriptive capacity to deal concisely with time, space, and universal patterns of object relationships.

Hence statement IV is True.

∴ Hence the correct answer is (B) and (D) only.

Question 28

The running time of an algorithm is O(g(n)) if and only if

(A) its worst-case running time is O(g(n)) and its best-case running time is Ω(g(n)).(O = big O)

(B) its worst-case running time is Ω(g(n)) and its best-case running time is O(g(n)).(O = big O)

(C) O(g(n)) = Ω(g(n))(O = big O)

(D) O(g(n)) ∩ ω(g(n)) is non-empty set. (o = small o)

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) only

  2. BOption (b)

    (B) only

  3. COption (c)

    (C) only

  4. DOption (d)

    (D) only

View answer & explanation

Correct answer

Answer: (a)A.

(A) only

Why this answer is correct

The correct answer is option 1.

Key Points

(A) its worst-case running time is O(g(n)) and its best-case running time is Ω(g(n)).(O = big O)

True,

Big-Oh(O) denotes upper bound or worst case. 

Big-Omega(Ω) denotes lower bound or best case.

Big-Theta(Θ)  denotes Average bound or average case.

(B) its worst-case running time is Ω(g(n)) and its best-case running time is O(g(n)).(O = big O)

False, worst case should be Big-oh and best case should be Big-Omega

(C) O(g(n)) = Ω(g(n))(O = big O)

False, Can not cover  Big-Omega.

(D) O(g(n)) ∩ ω(g(n)) is non-empty set. (o = small o)

False, no such f(n) exists, i.e. the intersection is indeed the empty set.

∴ Hence the correct answer is (A) only.

Question 29

Given below are two statements:

If two variables V1 and V2 are used for clustering, then consider the following statements for k means clustering with k = 3:

Statement I: If V1 and V2 have correlation of 1 the cluster centroid will be in straight line.

Statement II: If V1 and V2 have correlation of 0 the cluster centroid will be in straight line.

In the light of the above statements. choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (c)C.

Statement I is correct but Statement II is false

Why this answer is correct

The correct answer is option 3.

Key Points

Both data points would be in a straight line if the correlation between the variables V1 and V2 is 1. As a result, all three cluster centroids will form a straight line.

∴ Hence the Statement I is correct but Statement II is false.

Additional Information

K-Means Clustering is an unsupervised learning algorithm used in machine learning and data science to tackle clustering problems.   Unsupervised Learning algorithm K-Means Clustering divides the unlabeled dataset into separate clusters. K specifies the number of pre-defined clusters that must be generated during the process; for example, if K=2, two clusters will be created, and if K=3, three clusters will be created.

Question 30

Given below are two statements:

Statement I: The laws of nature put two fundamental limits on data rate of a channel. The H.Nyquist limit restricts the number of independent samples per second to twice the band-width in a Noiseless channel.

Statement II: Shannon's major result about noised channel is that maximum data rate of a channel whose band width is H Hz, and whose signal-to-noise ratio is S/N is given by:

Maximum number of bits/sec =H;log2(1+SN)= H ;log_2 \left(1+\frac{S}{N}\right) is given by:

In the light of the above statements. choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1.

Key Points

Noiseless channel: Nyquist Bit Rate

For a noiseless channel, the Nyquist bit rate formula defines the theoretical maximum bit rate

BitRate=2 X bandwidth x10g2L

In this formula, bandwidth is the bandwidth of the channel, L is the number of signals used to represent data, and BitRate is the bit rate in bits per second.

Noisy channel: Shannon Capacity

In the reality, we cannot have a noiseless channel; the channel is always noisy. In 1844, Claude Shannon introduced a formula, called the Shannon capacity, to determine the theoretical highest data rate for a noisy channel:

Capacity= bandwidth x log2(1+SNR)

In this formula, bandwidth is the bandwidth of the channel, SNR is the signal-to-noise ratio, and capacity is the capacity of the channel in bits per second. Note that in the Shannon formula there is no indication of the signal level, which means that no matter how many levels we have, we cannot achieve a data rate higher than the capacity of the channel. In other words, the formula defines the characteristics of the channel, not the method of transmission. 

∴ Hence both Statement I and Statement II are true the correct answer.

Question 31

Consider the following statements:

(A) Any tree is 2-colorable

(B) A graph G has no cycles of even length if it is bipartite.

(C) A graph G is 2-colorable if is bipartite

(D) A graph G can be colored with d + 1 colors if d is the maximum degree of any vertex in the graph G.

(E) A graph G can be colored with O(log |v|) colors if it has O(|v|) edges.

Choose the correct answer from the options given below:

  1. AOption (a)

    (C) and (E) are incorrect

  2. BOption (b)

    (B) and (C) are incorrect

  3. COption (c)

    (B) and (E) are incorrect

  4. DOption (d)

    (A) and (D) are incorrect

View answer & explanation

Correct answer

Answer: (c)C.

(B) and (E) are incorrect

Why this answer is correct

The correct answer is option 3.

Key Points

  • Any tree is 2-colourable. True every tree is no loops and a bipartite graph with chromatic number 2. Odd levels coloured with one colour and even levels coloured with another colour.

  • A graph G has no cycles of even length if it is bipartite. False

  • A graph G is 2-colourable if is bipartite True. A graph K(2,3), set of  V1 vertices coloured with one colour and set of V2 vertices coloured with another colour.

  • A graph G can be coloured with d+1 colours if d is the maximum degree of any vertex in the graph G.True as the vertex of degree d means it is adjacent to d vertices hence need d+1 different colours required.

  • A graph G can be coloured with O(log∣v∣) colours if it has O(∣v∣) degrees False as Kn has O(n^2) edges with chromatic number n so it needs O (√ V) colours

∴ Hence the correct answer is (B) and (E) are incorrect.

Question 32

Match List I with List II

List IList II
(A) Greedy Best-First Search(I) Space complexity is O(d) where d = depth of the deepest optimal solution
(B) A*(II) Incomplete even if the search space is finite.
(C) Recursive Best-First Search(III) Optimal if optimal solution is reachable: otherwise, returns the best reachable optimal solution.
(D) SMA*(IV) Computation and space complexity is too high.

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - II, B - IV, C - I, D - III 

  2. BOption (b)

    A - II, B - III, C - I, D - IV

  3. COption (c)

    A - III, B - II, C - IV, D - I 

  4. DOption (d)

    A - III, B - IV, C - II, D - I

View answer & explanation

Correct answer

Answer: (a)A.

A - II, B - IV, C - I, D - III 

Why this answer is correct

The correct answer is option 1.

Key Points

  • Greedy best-first search algorithm always selects the path which appears best at that moment. It is the combination of depth-first search and breadth-first search algorithms.
  • Time complexity: The worst-case time complexity of the greedy best-first search is O(bm).
  • Space Complexity: The worst-case space complexity of the greedy best-first search is O(bm). Where m is the maximum depth of the serach space
  • Complete: Greedy best-first search is also incomplete, even if the state space is finite.
  • Optimal: Greedy best-first search algorithm is not optimal.
  • A* is optimal and complete but time complexity and space complexity too high. It requires more computation.
  • Recursive Best-First Search retents more memory knowledge but uses only O(bd) memory
  • Memory Simplified Bound A* such as A* Optimal if you can get optimal solution otherwise as it is memory-bound.

∴ Hence the correct answer is A - II, B - IV, C - I, D - III.

Question 33

Protocols in which the sender sends one frame and then waits for an acknowledgement before proceeding for next frame are called as  ________.

  1. AOption (a)

    Simplex protocols

  2. BOption (b)

    Unrestricted simplex protocols

  3. COption (c)

    Simplex stop and wait protocols

  4. DOption (d)

    Restricted simplex protocols

View answer & explanation

Correct answer

Answer: (c)C.

Simplex stop and wait protocols

Why this answer is correct

The correct answer is option 3.

Key Points

The frames must be held before they are used if the date of the frames arrives at the receiver side faster than they can be processed. The receiver, in most cases, does not have enough storage space, particularly if it is receiving data from multiple sources. Frames may be discarded or service may be denied as a result of this. To keep the receiver from being overloaded by the frames, we need to tell the sender to slow down. This can only be achieved by input from the receiver to the sender.

The protocol we'll talk about now is called Stop and Wait because the sender sends one frame, then waits for confirmation from the receiver before sensing the next frame. Although data frames still require unidirectional communication, axillary acknowledgement frames travel in the opposite direction.

∴ Hence the correct answer is Simplex stop and wait protocols.

Question 34

Given below are two statements:

Statement I: Bezier curves are curves that interpolate all of their control points.

Statement II: A cubic bezier curve has four control points.

In the light of the above statements. choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true.

View answer & explanation

Correct answer

Answer: (d)D.

Statement I is incorrect but Statement II is true.

Why this answer is correct

The correct answer is option 4.

Key Points

 The Bezier curve is defined by P0 through Pn and n is named its order (n = 1 for the linear, 2 for the quadratic, etc.). The first and last checkpoints are often the endpoints of the curve, but interim checkpoints do not usually lie on the curve.

Statement I is incorrect

The cubic Bezier curve is defined by four points P0, P1, P2, and P3 in the plane or in greater space.

Statement II is correct.

A cubic bezier curve has four control points.

Question 35

If f(x) = x is my friend, and p(x) = x is perfect. then correct logical translation of the statement “some of my friends are not perfect” is _______.

  1. AOption (a)

    ∀x (f(x) ∧ ¬ p(x))

  2. BOption (b)

    ∃x (f(x) ∧ ¬ p(x))

  3. COption (c)

    ¬ (f(x) ∧ ¬ p(x))

  4. DOption (d)

    ∃x ( ¬ f(x) ∧ ¬ p(x))

View answer & explanation

Correct answer

Answer: (b)B.

∃x (f(x) ∧ ¬ p(x))

Why this answer is correct

The correct answer is option 2.

Key Points

f(x) = x is my friend

P(x) = x is perfect

So, they are asking about SOME. Finally, outer most parentheses will get SOME ∃x.

They are given conditions like NOT perfect. So,we get  ¬ p(x).

The final condition is ∃x (f(x) ∧ ¬ p(x))

∴ Hence the correct answer is ∃x (f(x) ∧ ¬ p(x)).

Question 36

Let L1 and L2 be languages over ∑ = {a, b} represented by the regular expressions (a* + b)* and (a + b)* respectively.

Which of the following is true with respect to the two languages?

  1. AOption (a)

    L1 ⊂ L2

  2. BOption (b)

    L2 ⊂ L1

  3. COption (c)

    L1 = L2

  4. DOption (d)

    L1 ∩ L2 = ϕ

View answer & explanation

Correct answer

Answer: (c)C.

L1 = L2

Why this answer is correct

The correct answer is option 3.

Key Points

(a+b)* is a universal set grammer which can generate all strings over all possible alphabet "a"and"b".

(a* + b)<sup></sup>= a can generate epsilon, and reamaining part is like (a + b)*

(a</sup> + b)=(a + b*)=(a<sup>b</sup>)<sup>=(a</sup>+ b<sup>)* =a</sup>(ba<sup>)</sup>=b<sup>(ab</sup>)<sup>=(a + b)* all grammers are equal.

∴ Hence the correct answer is L1 = L2.

Question 37

In the context of concurrency control, a given pair of operations in a schedule is called conflict schedule if

(A) At least one of the operations is write operation

(B) Both the operations are performed on the same data item

(C) Both the operations are performed by different transactions

(D) Both the operations are performed on different data items

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A), (B) and (C) only

  3. COption (c)

    (A), (C) and (D) only

  4. DOption (d)

    (C) and (D) only

View answer & explanation

Correct answer

Answer: (b)B.

(A), (B) and (C) only

Why this answer is correct

The correct answer is option 2.

Key Points

Two functions are said to be incompatible if any of the following conditions are met:

  • They are associated with various transactions.
  • They both work with the same data object.
  • One of them must be a write operation.

If you note the issues mentioned below, it's because different transactions have performed at least one write operation on the same data object.

a) Item X has an incorrect value because its update by T1is lost(overwritten).

T1T2
read_item(X);
X=X-N;
write_item(X);
read_item(Y); Y=Y+N; write_item(Y);
read_item(X);
X=X+m; write_item(X);

b) Transaction T1 fails and must change the value of X back to its old value; meanwhile, T2 has read the temporary incorrect value of x.

T1T2
read_item(X);
X=X-N; write_item(X);

read_item(Y);
read_item(X);
X=X+m; write_item(X);

 

c)T3 reads X after N is subtracted and reads Y before N is added; a wrong summary is a result(off by N).

T1T3
read_item(X);
x=x-N;
write_item(X); read_item(Y);
Y=Y+N;
write_item(Y);
sum=0
read_item(A);
sum=sum+A; . . read_item(X);
sum=sum+X;
read_item(Y);
sum=sum+Y;

∴ Hence the correct answer is (A), (B) and (C) only

Question 38

Which of the following grammars is (are) ambiguous?

(A) s → ss | asb | bsa | λ

(B) s → asbs | bsas | λ

(C) s → aAB

A → bBb

B →  A | λ where λ denotes empty string

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (C) only

  2. BOption (b)

    (B)only 

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (A) (B) and (C)

View answer & explanation

Correct answer

Answer: (d)D.

(A) (B) and (C)

Why this answer is correct

The correct answer is option 4.

Key Points

A is ambiguous because λ can be generated using leftmost derivation having two different parse trees with an empty string.

B is ambiguous grammar with string abab.

C is an ambiguous grammar with string abbbb.

∴ Hence the correct answer is (A) (B) and (C).

Question 39

period of a signal is 100 ms. Then the frequency The of this signal in kilohertz is ______.

  1. AOption (a)

    10

  2. BOption (b)

    10-1

  3. COption (c)

    10-2

  4. DOption (d)

    10-3

View answer & explanation

Correct answer

Answer: (c)C.

10-2

Why this answer is correct

Data:

Period = T = 100 ms

Formula:

Frequency;f=1T;{\rm{Frequency;f}} = \frac{1}{{\rm{T}}}{\rm{;}}

Calculation:                        

f=1100;ms=1100×10−3s=10;s−1=10;Hertz{\rm{f}} = \frac{1}{{100{\rm{;ms}}}} = \frac{1}{{100 × {{10}^{ - 3}}{\rm{s}}}} = 10{\rm{;}}{{\rm{s}}^{ - 1}} = 10{\rm{;Hertz}}

f = 10 × 10-3 kilohertz = 10-2  kilohertz

Question 40

Match List I with List II:

LR: Regular language, LCF: Context free language

LREC: Recursive language, LRE: Recursively enumerable language.

List IList II
(A) Recursively Enumerable language(I) L̅REC ∪ LRE
(B) Recursive language(II) L̅CF ∪ LREC
(C) Context Free language(III) LR ∩ LCF

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - II, B - III, C - I 

  2. BOption (b)

    A - III, B - I, C - II 

  3. COption (c)

    A - I, B - II, C - III

  4. DOption (d)

    A - II, B - I, C - III

View answer & explanation

Correct answer

Answer: (c)C.

A - I, B - II, C - III

Why this answer is correct

The correct answer is option 3.

Key Points

 L̅REC ∪ LRE  = (Recursive  ∪ Recursively enumerable)=  Recursively enumerable

Recursive languages closed under complement so,  L̅REC is Recursive. Union of recursive and recursively enumerable is recursively enumerable.

L̅CF ∪ LREC    = (not Context-free ∪ Recursive ) =(Recursive ∪ Recursive)= Recursive.

Context-free is not closed for a complement so, L̅CF is Recursive.  The union of recursive and recursive is recursive.

LR ∩ LCF         = (Regular ∩ Context Free ) = Context Free.

The intersection of regular and context-free is Context Free.

∴ Hence the correct answer is A - I, B - II, C - III.

Additional Information

RegularDCFLCFLCSLRecursiveREL
UnionYNYYYY
IntersectionYNNYYY
ComplementYYNYYN
DifferenceYNNYYN
PrefixYYYYYY
SuffixYYYYYY
SubstringYYYYYY
ConcatenationYNYYYY
ReversalYNYYYY
Kleen closureYNYYYY
positive closureYNYYYY
subsetNNNNNN
substitutionYNYNNY
HomomorphismYNYNNY
Inverse HomomorphismYYYYYY
Y=Closed N=Not closed

Question 41

Consider a relational schema S = (U, V, W, X, Y, Z) on which the following functional dependencies hold:

{U → V, VW → X, Y → W, X → U}

Which are the candidate keys among following options?

  1. AOption (a)

    UY, VY

  2. BOption (b)

    UY, VY, XY

  3. COption (c)

    UYZ, VYZ, VWZ

  4. DOption (d)

    UYZ, VYZ, XYZ

View answer & explanation

Correct answer

Answer: (d)D.

UYZ, VYZ, XYZ

Why this answer is correct

The correct answer is option 4.

Concept:

A candidate key is a column, or set of columns, in a table that can uniquely identify any database record without referring to any other data

Explanation:

The following functional dependencies,

U → V, VW → X, Y → W, X → U

S = (U, V, W, X, Y, Z)

Here YZ is an independent key. So, for every key, the YZ should their. Hence only option 4 is containing YZ for all keys.

∴ Hence the correct answer is UYZ, VYZ, XYZ.

 

Options Verify:

UY+=UVWXY, VY+=UVWXY Here Z is not closed. Hence option 1 is incorrect.UY+=UVWXY, VY+=UVWXY, XY+=UVWXY  Here Z is not closed. Hence option 1 is incorrect.UYZ+=UVWXYZ, VYZ+=UVWXYZ, VWZ+=UVWXZ Here Y is not closed for VWZ+. Hence option 1 is incorrect.UYZ+=UVWXYZ, VYZ+=UVWXYZ, XYZ+=UVWXYZ Correct Keys.

Question 42

Using ‘RSA’ public key cryptosystem. if p = 3, q = 11 and d = 7, find the value of e and encrypt the number ‘19’. 

  1. AOption (a)

    20, 19

  2. BOption (b)

    33, 11

  3. COption (c)

    3, 28

  4. DOption (d)

    77, 28

View answer & explanation

Correct answer

Answer: (c)C.

3, 28

Why this answer is correct

The correct answer is option 3. 

Data:

p = 3, q = 11 and d = 7

Formula:

Φ(n)=(p-1)x(q-1)

n=p x q

Calculation:

n=3 x 11 =33

Φ(n)==(3-1)x(11-1) = 20

ex7 mod Φ(n)=1

Option 3

if e=3, 7x3 mod 20 =1

Encrypt key Memod n= C

C=193mod 33

C=28

∴ Hence the correct answer is (3,28)

 

RSA Algorithm (Rivest Shamir Adleman):

  • Step 1: choose two large primes, p,q
  • Step 2: Compute n=pxq , Φ(n)=(p-1)x(q-1)
  • Step 3: Choose a number relatively prime to Φ(n) and call it 'd' , GCD(d, Φ(n))=1
  • Find 'e' such that, exd mod Φ(n)=1
  • Encrypt key Memod n= C where C=ciper text
  • Decrypt key Cdmod n= M where M=plain text

Question 43

Given below are two statements:

Statement I: Hardwired control unit can be optimized to produce fast mode of operation.

Statement II: Indirect addressing mode needs two memory reference to fetch the operand.

In the light of the above statements. choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true.

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1.

Key Points

Control signals are provided by a hardwired circuit in hardwired control techniques. The main goal of the control unit is to produce the control signal in the correct order. The speed of a hardwired control unit can be optimized.

Hence statement I is correct

 Indirect addressing mode needs two memory references to fetch operand as the address of the operand is not given in instruction but the address field contains the address where the address of the operand is stored.

Hence statement II is correct.

​

Additional Information

  • Advantages of Hardwired Control unit:
  • ​It is faster than the microprogrammed control unit.​
  • It can be optimized to produce a fast mode of operation.
  • Disadvantages of Hardwired control unit:
  • ​Instruction set, the control logic is directly implemented.
  • Requires a change in the wiring if the design has to be controlled.
  • An occurrence of an error is more.
  • It requires a more chip area, therefore, it is a costlier control unit.

Question 44

Match List I with List II

Let R1 = {(1, 1), (2, 2), (3, 3)} and R2 = {(1, 1), (1, 2), (1, 3), (1, 4)}

List IList II
(A) R1 ∪ R2(I) {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)}
(B) R1 - R2(II) {1, 1}
(C) R1 ∩ R2(III) {(1, 2), (1, 3), (1, 4)}
(D) R2 - R1(IV) {(2, 2), (3, 3)}

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - I, B - II, C - IV, D - III 

  2. BOption (b)

    A - I, B - IV, C - III, D - II 

  3. COption (c)

    A - I, B - III, C - II, D - IV 

  4. DOption (d)

    A - I, B - IV, C - II, D - III  

View answer & explanation

Correct answer

Answer: (d)D.

A - I, B - IV, C - II, D - III  

Why this answer is correct

The correct answer is option 4.

Key Points

R1 U R2 (union) is the relation containing all tuples that appear in R1, R2, or both. 

                     R1 ∪ R2= R1 or R2= R1+R2- R1 ∩ R2 

                             R1 ∪ R2 =  {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)}​

 R1 - R2 (set difference) is the relation containing all tuples of R1 that do not appear in R2

                    R1 - R2 =  R1 -R1 ∩ R2 

                    R1 - R2= {(2, 2), (3, 3)}

R1 ∩ R2 (intersection) is the relation containing all tuples that appear in both R1 and R2.

                   R1 ∩ R2 = R1and R2=  {1, 1}​                   

 R2 - R1 (set difference) is the relation containing all tuples of R2 that do not appear in R1

                   R2 - R1=R2 -R1 ∩ R2  = {(1, 2), (1, 3), (1, 4)}

∴ Hence the correct answer is A - I, B - IV, C - II, D - III.

Question 45

Match List I with List II

List IList II
(A) Handshaking(I) I/O interface informs the CPU   that device is ready for transfer
(B) Programmed I/O(II) requires two control signals   working in opposite directions
(C) Interrupt-initiated I/O(III) has local memory & control   large set of I/O devices.
(D) I/O processor(IV) require CPU to check the I/O   flag & perform transfer

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - I, B - II, C - 10, D - IV 

  2. BOption (b)

    A - II, B - IV, C - III, D - I 

  3. COption (c)

    A - II, B - IV, C - I, D - III

  4. DOption (d)

    A - IV, B - III, C - II, D - I 

View answer & explanation

Correct answer

Answer: (c)C.

A - II, B - IV, C - I, D - III

Why this answer is correct

The correct answer is option 3.

Key Points

Handshaking:

When one computer sends a message to another indicating that it wants to create a contact channel, it is called handshaking.  It requires two control signals working in opposite directions

Programmed I/O:

​​The output of the I/O instructions written in the computer programme is the trigger. It requires the CPU to check the I/O   flag & perform the transfer

Interrupt-initiated I/O:

Interrupt powered I/O is a different way to deal with I/O. Interrupt I/O is a method of monitoring input/output operation by sending a signal from a peripheral or terminal that needs to send or receive data. I/O interface informs the CPU that the device is ready for transfer

I/O processor:

A processor with direct memory access is known as an input-output processor (IOP). The computer system is divided into memory units and processors in this way. I/O processor has local memory & control a large set of I/O devices.

∴ Hence the correct answer is A-II, B - IV, C - I, D - II.

Question 46

A Company has a choice of two languages L1 and L2 to develop a software for their client. Number of LOC required to develop an application in L2, is thrice the LOC in language L1. Also, software has to be maintained for next 10 years. Various parameters for two languages. are given below to decide which language should be preferred for development.

PARAMETERL1L2
Man-year needed for developmentLOC/1000LOC/1000
Development costRs. 70,000Rs. 90,000
Cost of Maintenance per yearRs. 1,00,000Rs. 40,000

 

Total cost of project include cost of development and maintenance. What is the LOC for L1 for which cost of developing the software with both languages must be same ?

  1. AOption (a)

    2000

  2. BOption (b)

    6000

  3. COption (c)

    3000

  4. DOption (d)

    5000

View answer & explanation

Correct answer

Answer: (c)C.

3000

Why this answer is correct

The correct answer is option 3

Formula:

The total cost of the project = Total development cost + Total maintenance cost

Calculation:

Let p1 be the LOC using L1 and p2 be the LOC using L2.

Total cost of the project using L1 = (p1/1000) x 70,000 + (10 x 1,00,000) = 70p1 + 10,00,000

Total cost of the project using L2 = (p2/1000) x 90,000 + (10 x 40,000) = 90p2 + 4,00,000

Given that p2 = 3xp1

=>70p1 + 10,00,000 = 90p2 + 4,00,000

=>70p1 + 10,00,000 = 270p1 + 4,00,000

=> 200p1 = 6,00,000

=> p1 = 3000

Question 47

Which of the following statements is true ?

  1. AOption (a)

    The union of two context free languages is context free.

  2. BOption (b)

    The intersection of two context free languages is context free.

  3. COption (c)

    The complement of a context free language is context free.

  4. DOption (d)

    If a language is context free, it can always be accepted by a deterministic pushdown automaton.

View answer & explanation

Correct answer

Answer: (a)A.

The union of two context free languages is context free.

Why this answer is correct

The correct answer is option1

Key Points

  • Context-free language is closed under Union, Concatenation, and Kleen closure. But not closed under complementation and intersection.
  • If a Language is Context Free, it can be either deterministic or non-deterministic language. only deterministic languages are accepted by the deterministic pushdown automaton.
  • Let L1 and L2 be Context-free language

Option 1: 

L1 ∪ L2 is context-free

As context-free languages are closed under union. So it is correct

Question 48

Consider a hypothetical machine with 3 pages of physical memory, 5 pages of virtual memory, and < A, B, C, D, A, B, E, A, B, C, D, E, B, A, B > as the stream of page references by an application. If P and Q are the number of page faults that the application would incur with FIFO and LRU page replacement algorithms respectively. then (P,Q) = ______. (Assuming enough space for storing 3 page frames)  

  1. AOption (a)

    (11, 10)

  2. BOption (b)

    (12, 11)

  3. COption (c)

    (10, 11)

  4. DOption (d)

    (11, 12)

View answer & explanation

Correct answer

Answer: (d)D.

(11, 12)

Why this answer is correct

The correct answer is option 4.

Key Points

3 pages of physical memory mean 3 frames (so at a time only max 3 pages in  frames)

5 pages of  virtual memory mean 5 page

 FIFO (First In, First Out)

    The operating system uses this algorithm to keep track of all pages in memory in a queue, with the oldest page at the top. When a page has to be replaced, the first page in the queue is chosen for replacement.

Page faults= A B C  D A  B E  C D  B A 

ADDDEEEBB
BBAAACCCA
CCCBBBDDD

Page faults= 11

Least Recently Used –

   In this algorithm, the page will be replaced which is the least recently used.

Page faults=  A B C D A B E C D E B A

Page faults= 12

ADDDECCCBB
BBAAAADDDA
CCCBBBBEEE

 

∴ Hence the correct answer is (11, 12).

Question 49

What is the radix of the numbers if the solution to the quadratic equation x2 - 10x + 26 = 0 is x = 4 and x = 7 ?

  1. AOption (a)

    8

  2. BOption (b)

    9

  3. COption (c)

    10

  4. DOption (d)

    11

View answer & explanation

Correct answer

Answer: (d)D.

11

Why this answer is correct

The correct answer is option 4.

Key Points

If one solve the quadratic equation, ax2 + bx + c

then the sum of roots of quadratic equation = −b/a

Quadratic equation x2 - 10x + 26 = 0

since 4 and 7 are the roots of the equation

∴ −ba=(10)r(1)r=(4)r+(7)r\frac{-b}{a} = \frac{(10)_r}{(1)_r} = (4)_r + (7)_r

r = 4 + 7 = 11

∴ Hence the correct answer is 11.

Alternate Method

In this case, it would be sufficient to take one solution and put it into the equation. Say we do it with x=4. Convert the coefficients into base 10. Let the radix be r.

x2 - 10x + 26 = 0

(4)2 – (1 × r1 + 0 × r0) × 4 + (2 × r1 + 6 × r0)=0 

16 − 4r + 2r + 6 = 0

2r = 22

r = 11

Question 50

Which of the following UML diagrams has a static view ?

  1. AOption (a)

    Collaboration diagram

  2. BOption (b)

    Use-Case diagram

  3. COption (c)

    State chart diagram

  4. DOption (d)

    Activity diagram

View answer & explanation

Correct answer

Answer: (b)B.

Use-Case diagram

Why this answer is correct

The correct answer is option 2.

Key PointsUML (Unified Modeling Language) diagrams can be categorized into two main types: structural diagrams (which present a static view of the system) and behavioral diagrams (which represent the dynamic aspects).

  • Collaboration diagram – Represents interactions between objects or parts in terms of sequenced messages. It is a kind of behavioral diagram.
  • Use-Case diagram – Represents the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies between those use cases. It is a kind of structural diagram, providing a static view of the system's functionality.
  • State chart diagram – Shows how an object changes its state in response to events. It is a type of behavioral diagram.
  • Activity diagram – Represents workflows of stepwise activities and actions with support for choice, iteration and concurrency. It is considered a behavioral diagram.

Therefore, the diagram that represents a static view among the options listed is the Use-Case diagram.

Question 51

Software reliability is described with respect to

(A) Execution Time

(B) Calendar Time

(C) Clock Time

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (B) and (C) only

  3. COption (c)

    (A), (B) and (C)

  4. DOption (d)

    (A) and (C) only

View answer & explanation

Correct answer

Answer: (c)C.

(A), (B) and (C)

Why this answer is correct

The correct answer is option 3.

Key Points

  • The execution time of a programme is the time that a processor spends actually executing the program's instructions.
  • The second kind of time is calendar time It is the familiar time that we normally experience.
  • Clock time is the normal wall clock time.

and Software reliability is described with respect to all these.

∴ Hence the correct answer is (A), (B) and (C).

Additional Information

Software reliability, like hardware reliability, is defined as the probability that the software system will work without failure under specified conditions and for a specified period of time.

Question 52

Concerning phong shading and Gouraud shading in a 3D scene, which of the following statements are true ?

(A) Gouraud shading requires more computation than phong shading.

(B) Gouraud shading linearly interpolates the color of an interior pixel from the color at the vertices

(C) Phong shading interpolates over the normal vectors specified at the vertices.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) and (C) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (A), (B) and (C)

View answer & explanation

Correct answer

Answer: (c)C.

(B) and (C) only

Why this answer is correct

The correct answer is option 3.

Key Points

Statement 1: FALSE: 

Gouraud shading requires less calculation and this greatly decreases the cost of shading steeply. 

Statement 2: TRUE:

Gouraud shading linearly interpolates the color of an interior pixel from the color at the vertices. The original paper makes it clear Gouraud shading is a linear interpolation of colour between vertices, specifically.

Statement 3:TRUE:

Phong shading interpolates over the normal vectors specified at the vertices.

∴ Hence the correct answer is (B) and (C) only.

Question 53

How many ways are there to pack six copies of the same book into four identical boxes, where a box can contain as many as six books ?

  1. AOption (a)

    4

  2. BOption (b)

    6

  3. COption (c)

    7

  4. DOption (d)

    9

View answer & explanation

Correct answer

Answer: (d)D.

9

Why this answer is correct

The correct answer is option 4.

Key Points

Here, there are six copies of the same book into four identical boxes(same box). We will enumerate all ways to pack the books. For each way to pack the books, we will list the number of books in the box with the largest number of books, followed by the numbers of books in each box containing at least one book, in order of decreasing the number of books in abox

6,0,0,0 

5,1,0,0

4,2,0,0

4,1,1,0

3,3,0,0

3,2,1,0

3,1,1,1

2,2,2,0

2,2,1,1.

So the total number of ways is 9.

∴ Hence the correct answer is 9.

Question 54

Consider L = L1 ∩ L2

Where L1 = {0m1m20n1n |m, n >= 0}

L2 = {0m1n2k | m, n, k ≥ 0}

Then, the language L is

  1. AOption (a)

    Recursively enumerable but not context free

  2. BOption (b)

    Regular

  3. COption (c)

    Context free but not regular

  4. DOption (d)

    Not recursive

View answer & explanation

Correct answer

Answer: (c)C.

Context free but not regular

Why this answer is correct

The correct answer is option 3.

Key Points

  • L1 will first contain 0's followed by an equal number of 1's. After that, there will be a single 2 which will again be followed by 0's and an equal number of 1's i.e.   L1={2,012,00112,20011,01201,0011201,0120011,001120011,........}
  • L2={epsilon,0,1,2,01,12,012,00112,20011,01201,0011201,0120011,001120011,............}
  • L=L1∩L2={2,012,00112,0001112,........}
  • L=L1∩L2={0m1m2/ m>=0}, which is a context free language but not regular language.

∴ Hence the correct answer is Context-free but not regular.

Additional Information

Question 55

Firewall is a device that filters access to the protected network from the outside network. Firewalls can filter the packets on the basis of

(A) Source IP Address

(B) Destination IP Address

(C) TCP Source Port

(D) UDP Source Port

(E) TCP Destination Port

Choose the correct answer from the options given below:

  1. AOption (a)

    (A), (B) and (C) only

  2. BOption (b)

    (B) and (E) only

  3. COption (c)

    (C) and (D) only

  4. DOption (d)

    (A), (B), (C), (D) and (E) only

View answer & explanation

Correct answer

Answer: (d)D.

(A), (B), (C), (D) and (E) only

Why this answer is correct

The correct answer is option 4.

Key Points

Network layer Firewall can filter on Source And Destination IP address, Source and Destination Port no for both TCP and UDP packet.

​∴ Hence the correct answer is (A), (B), (C), (D), and (E) only.​

Additional Information

What is a Firewall?

            A firewall is a form of cybersecurity device that filters network traffic. Network nodes can be separated from external traffic sources, internal traffic sources, or even individual applications using firewalls.

Question 56

Given below are two statements:

Statement I: A genetic algorithm is a stochastic hill-climbing search in which a large population of states is maintained.

Statement II: In nondeterministic environments, agents can apply AND-OR search to generate contingent plans that reach the goal regardless of which outcomes occur during execution.

In the light of the above statements, choose the Correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1.

Key Points

A genetic algorithm is a stochastic hill-climbing algorithm that maintains a wide population of states. Mutation and crossover, which blends pairs of states from the population, create new states.

Hence Statement I is correct.

Agents may use AND-OR search in non-deterministic environments to produce contingent plans that achieve the target regardless of which outcomes occur during execution.

Hence Statement II is correct

​

Additional Information

  • AND-OR search trees: 
  • ​OR nodes: The only branching in a deterministic setting is implemented by the agent's own choices in each state; we call these nodes OR nodes.
  • AND nodes: Branching is often implemented in a non-deterministic setting by the environment's choice of outcome for each action, which we call nodes AND nodes.

Question 57

The data node and name node in HADOOP are

  1. AOption (a)

    Worker Node and Master Node respectively

  2. BOption (b)

    Master Node and Worker Node respectively

  3. COption (c)

    Both Worker Nodes

  4. DOption (d)

    Both Master Nodes

View answer & explanation

Correct answer

Answer: (a)A.

Worker Node and Master Node respectively

Why this answer is correct

The correct answer is option 1

Key Points

The main difference between NameNode and DataNode in Hadoop is that the NameNode is the master node in Hadoop Distributed File System (HDFS) that manages the file system metadata while the DataNode is a slave node in Hadoop distributed file system that stores the actual data as instructed by the NameNode.

Additional Information

  • NameNode stores the metadata of all files in HDFS. Metadata includes file permission, names, and location of each block. Namenode maps these blocks to DataNodes.
  • The data nodes store and retrieve blocks as instructed by the NameNode.

Question 58

A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes and L be the number of leaves in a complete n-ary tree. If L = 41, and I = 10, What is the value of n ?

  1. AOption (a)

    3

  2. BOption (b)

    4

  3. COption (c)

    5

  4. DOption (d)

    6

View answer & explanation

Correct answer

Answer: (c)C.

5

Why this answer is correct

The correct answer is option 3.

Key Points

If the tree is 1-ary and 'I' is an internal node, the number of leaves is 1

If the tree is 2-ary and  'I' is an internal node, the number of leaves is I+1

If the tree is 3-ary and 'I' is an internal node, the number of leaves is 2I+1

If the tree is 4-ary and  'I' is an internal node, the number of leaves is 3I+1

If the tree is 5-ary and 'I' is an internal node, the number of leaves is 4I+1

If the tree is n-ary and  'I' is an internal node, the number of leaves is (n-1)I+1

Given that leaves L= 41, internal nodes I=10

L=(n-1)I+1

41=10(n-1)+1

10n=50

n=5 

∴ Hence the correct answer is 5.

 

Internal nodes  I=10

Leaf nodes  L=41

In an n-ary tree, the levels start at 0 and there are nk nodes at each level, where k is the level number.

Total number of nodes−L=I

(1+n1+n2+⋯+nK)−L=I

(1+n1+n2+⋯+nK)−41=10

(n1+n2+⋯+nK)=50

 n(nK−1)n−1\frac{n(n^K−1)}{n-1}=50

Option verify, if n=3, nK=35 is not equal to leaves.

if n=4, nK=39 is not equal to leaves.

if n=5, nK=41 is equal to leaves. So, it is 5-ary tree.

if n=6, nK=43 is not equal to leaves.

Question 59

Match List - I with List - II. List I gives 3 × 3 matrices representing 2D transformations and List - II shows the corresponding transformation diagrams.

List I (Matrix)List II (Transformation Diagram)
(A) \(\left[ {\begin{array}{*{20}{c}} 2&0&0\ 0&2&0\ 0&0&1 \end{array}} \right]\)(I)
(B) \(\left[ {\begin{array}{*{20}{c}} 1&0&2\ 0&1&2\ 0&0&1 \end{array}} \right]\)(II)
(C) \(\left[ {\begin{array}{*{20}{c}} {0.5}&{ - 0.866}&0\ {0.866}&{0.5}&0\ 0&0&1 \end{array}} \right]\)(III)
(D) \(\left[ {\begin{array}{*{20}{c}} 1&2&0\ 0&1&0\ 0&0&1 \end{array}} \right]\)(IV)

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - IV, B - II, C - III, D - I 

  2. BOption (b)

    A - IV, B - III, C - II, D - I

  3. COption (c)

    A - III, B - II, C - IV, D - I

  4. DOption (d)

    A - II, B - IV, C - III, D - I

View answer & explanation

Correct answer

Answer: (d)D.

A - II, B - IV, C - III, D - I

Why this answer is correct

The correct answer is option 4.

Key Points

\(\left[ {\begin{array}{*{20}{c}} 2&0&0\ 0&2&0\ 0&0&1 \end{array}} \right]\) It is the scaling matrix. 2 in x and y-direction by a factor,

Hence A-II is the correct pair.

\(\left[ {\begin{array}{*{20}{c}} 1&0&2\ 0&1&2\ 0&0&1 \end{array}} \right]\) is the translation matrix. Vector 2 in each direction of x and y

Hence  B-IV is the correct pair

\(\left[ {\begin{array}{*{20}{c}} {0.5}&{ - 0.866}&0\ {0.866}&{0.5}&0\ 0&0&1 \end{array}} \right]\)is an angle of 60 degrees rotation matrix.

Hence  C-III is the correct pair

\(\left[ {\begin{array}{*{20}{c}} 1&2&0\ 0&1&0\ 0&0&1 \end{array}} \right]\)is the shear matrix of quantity 2 with only x-shear.

Hence  D-I is the correct pair

∴ Hence the correct answer is A-II, B - IV, C - III, D - I.

Question 60

The following program is stored in memory unit of the basic computer. What is the content of the accumulator after the execution of program? (All location numbers listed below are in hexadecimal).

LocationInstruction
210CLA
211ADD 217
212INC
213STA 217
214LDA 218
215CMA
216AND 217
2171234H
2189CE2H
  1. AOption (a)

    1002H

  2. BOption (b)

    2011H

  3. COption (c)

    2022H

  4. DOption (d)

    0215H

View answer & explanation

Correct answer

Answer: (d)D.

0215H

Why this answer is correct

The correct answer is option 4.

Explanation

LocationInstructionexecution of program
210CLAClear accumulator (set to 0)
211ADD 217Add contents of location 217 i.e 1234 h to accumulator
212INCIncrement accumulator by 1 so accumulator contain 1235 H
213STA 217Store this value 1235 H at location 217
214LDA 218Load accumulator with the content of 218 so accumulator now has 9CE2 H
215CMAComplement (1’s complement) accumulator so accumulator now have 631D H
216AND 217Perform bitwise AND operation with the content of 217 i.e with 1235 H  i.e and of 631D H & 1235 H which will be 0215 H
2171234 H
2189CE2 H

 

(9CE2)16 = (1001 1100 1110 0010)2

1's complement of (9CE2)16 = (0110 0011 0001 1101)2 = (631D)16

(631D)16 & (1235)16 = (0215)16

Hence the correct answer is 0215H.

Question 61

Consider a code with only four valid code words: 0000000000, 0000011111, 1111100000, and 1111111111. This code has distance 5. If the code word arrived is 0000000111 then the original code word must be ______.

  1. AOption (a)

    0000011111

  2. BOption (b)

    0000000000

  3. COption (c)

    1111100000

  4. DOption (d)

    1111111111

View answer & explanation

Correct answer

Answer: (a)A.

0000011111

Why this answer is correct

The correct answer is option 1.

Key Points

Arrange one below the other the XOR operations

For correcting, the d-bit error hamming distance should be 2d+1.

So,2d+1=5

d=2

It means the hamming distance between the codeword 0000000111 and gives option should be 2-bits. Only Option 1 matches.

Option verify:

(xor)   0000000111 0000011111 ----------------------------- 0000011000 (2-bit error)(xor)    0000000111 0000000000 --------------------------- 00000001110 (3-bit error)(xor  0000000111 1111100000 ------------------------ 1111100111 (8-bit error)(xor)  0000000111 1111111111 --------------------- 1111111000 (7-bit error)

                                                                                                                           

0000011111 is minimum with the 2-bit error.

∴ Hence the correct answer is 0000011111.

Question 62

In the context of 3D Computer graphics, which of the following statements is/are correct?

(A) Under perspective projection, each set of parallel lines in the object do not stay parallel in the image (except those that are parallel to the viewplane to start with).

(B) Applying a perspective transformation in the graphics pipeline to a vertex involves dividing by its 'z' coordinate.

(C) Perspective transformation is a linear transformation.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) and (C) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (A), (B) and (C)

View answer & explanation

Correct answer

Answer: (a)A.

(A) and (B) only

Why this answer is correct

The correct answer is option 1.

Key Points

  • Under perspective projection, each set of parallel lines in the object do not stay parallel in the image The lines converge to the middle of the projection at a single point. Points of intersection of converging lines with the screen plane generate the projected image on the screen.

           Hence statement I is correct.

  • Applying a perspective transformation in the graphics pipeline to a vertex involves dividing by its 'z' coordinate.

           Hence statement II is correct.

  • Perspective transformation is a non-linear transformation.​

           Hence statement III is incorrect.

Question 63

Consider a machine with a byte addressable main memory of 216 bytes and block size of 8 bytes. Assume that a direct mapped cache consisting of 32 lines used with this machine. How many bits will be there in Tag. line and word field of format of main memory addresses ?

  1. AOption (a)

    8, 5, 3

  2. BOption (b)

    8, 6, 2

  3. COption (c)

    7, 5, 4

  4. DOption (d)

    7, 6, 3

View answer & explanation

Correct answer

Answer: (a)A.

8, 5, 3

Why this answer is correct

The correct answer is option 1.

 

Key Points

Direct Mapping: 

Given Data,

Main memory size =216 bytes

No of blocks in Main memory (M)=216  ÷ 23

Block Size (P)= 23 bytes

No of blocks in the cache memory (N) =25 bytes 

Tag=28=Tag bits= log2(M/N)

line or cache block= 25 =cache block  bits= log2N

word field or word offset= 23=word offset bits=log2P​

∴ Hence the correct answer is (8,5,3).

Important Points

N = No of blocks in cache memory  =(cache memory size)/Block size

M=  No of blocks in main memory   = (main memory size)/Block size

P=Block size

Question 64

To create an object-behavioral model, the analyst performs the following steps:

(A) Evaluates all use-cases

(B) Builds state transition diagram for the system.

(C) Reviews the object behaviour model to verify accuracy and consistency

(D) Identifies events that do not derive the interaction sequence.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A), (B) and (C) only

  2. BOption (b)

    (A), (B) and (D) only

  3. COption (c)

    (B), (C) and (D) only

  4. DOption (d)

    (A), (C) and (D) only

View answer & explanation

Correct answer

Answer: (a)A.

(A), (B) and (C) only

Why this answer is correct

The correct answer is option 1.

Key Points

 The behavioral model indicates how the software will respond to external events. To create the model, the analyst must perform the following steps.

  1. Evaluate all use-cases to fully understand the sequence of interaction within the system.
  2. Identify events that drive the interaction sequence and understand how these events relate to specific objects.
  3. Create a sequence for each use-case
  4. Build a state diagram for the system
  5. Review the behavioral model to verify accuracy and consistency.

∴ Hence the correct answer is (A), (B) and (C) only.

Question 65

Consider the following languages: 

\({L_1} = { {a^{{{̇ z}^z}}}|̇ Z;is;an;integer} \)

L2 = {azż | Ż ≥ 0}

L3 = {ωω | ω ϵ {a, b}* }

Which of the languages is (are) regular ?

Choose the correct answer from the options given below:

  1. AOption (a)

    L1 and L2 only

  2. BOption (b)

    L1 and L3 only

  3. COption (c)

    L1 only

  4. DOption (d)

    L2 only

View answer & explanation

Correct answer

Answer: (d)D.

L2 only

Why this answer is correct

The correct answer is option4

Only the language L2 is regular.

Key Points

\({L_1} = { {a^{{{̇ z}^z}}}|̇ Z;is;an;integer} \)

∴ L1 = {a1, a4, a27, a256, .....}

L2 = {azż | Ż ≥ 0}

∴ L2 = {ε, a11, a22, a33, ......}

L3 = {ωω | ω ϵ {a, b}* }

L3 = set of all strings starting and ending with the same word.

Explanation:

L1 does not contain any pattern to form a loop. Hence it's not possible to construct a DFA for L1.

L2 is a regular language since a DFA can be constructed using a loop that after every 11 symbols, the automata reaches the final state.

In L2, once the word 'ω' is scanned, there is no way to compare the next word with the starting symbol of the first word.

Question 66

Consider the following recursive Java function f that takes two long arguments and returns a float value:

public static float f (long m, long n) {

float result = (float)m / (float)n;

if(m < 0 | n < 0) return 0.of;

else result - = f(m * 2,n * 3);

return result ;

}

Which of the following real values best approximates the value of f (1, 3) ?

  1. AOption (a)

    0.2

  2. BOption (b)

    0.4

  3. COption (c)

    0.6

  4. DOption (d)

    0.8

View answer & explanation

Correct answer

Answer: (a)A.

0.2

Why this answer is correct

The correct answer is option 1.

Key Points

The function f(1,3) pass the values to m,n. Then the value will typecast to float and result=0.3333. Then it enters into else statement the function f is f(2,9). 

And finally it returns result as 0.20000003.

∴ Hence the correct answer is 0.2.

Question 67

Suppose you are compiling on a machine with 1-byte chars, 2-byte shorts, 4-byte ints, and 8-byte doubles, and with alignment rules that require the address of every primitive data element to be an integer multiple of the element's size. Suppose further that the compiler is not permitted to reorder fields: padding is used to ensure alignment. How much space will be consumed by the following array?

struct {

short s;

char c;

short t;

char d;

double r;

int i;

} A[10]; /10-element array of structs/

  1. AOption (a)

    150 bytes

  2. BOption (b)

    320 bytes

  3. COption (c)

    240 bytes

  4. DOption (d)

    200 bytes

View answer & explanation

Correct answer

Answer: (c)C.

240 bytes

Why this answer is correct

The correct answer is option 3.

Key Points

  • "alignment rules" that "require the address of every primitive data element to be an even multiple of the element’s size". It's not very interesting that we're talking about alignment rules; we knew that already.
  • "require the address" of "every primitive data element" to be "an even multiple of the element’s size". Now we're getting somewhere. We have a requirement and a scope:
  • Requirement: The address is an even multiple of the element's size.
  • Scope: Every primitive data element.
  • So, every time we position an element, we must impose the requirement. It may also mean "even" as in "integral" rather than "multiple of two"

That would make the array:

OffsetVariableSizeRange
0s20-1
4c12-2
8t24-5
12d16-6
16r88-15
24i416-19
28*420-23
32s224-25
34c126-26
36t228-29
38d130-30
48r832-39
56i440-43
60*444-47

 

In that case, you have 24 bytes per element for a total of 240 bytes. Again, you need padding to ensure that r is aligned correctly.

∴ Hence the correct answer is 240 bytes.

Question 68

Match List I with List II

List I (E – R symbols)List II (Description)
(A) (I) Key Attribute Type
(B) (II) Weak Entity Type
(C) (III) Total Participation of Entity in   a relation
(D) (IV) Multivalue Attribute type

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - II, B - IV, C - II, D - I 

  2. BOption (b)

    A - IV, B - I, C - II, D - III

  3. COption (c)

    A - II, B - I, C - IV, D - III

  4. DOption (d)

    A - III, B - IV, C - I, D - II

View answer & explanation

Correct answer

Answer: (c)C.

A - II, B - I, C - IV, D - III

Why this answer is correct

The correct answer is option 3.

Key Points

E-R diagrams and their corresponding descriptions.

Question 69

What kind of clauses are available in conjunctive normal form ?

  1. AOption (a)

    Disjunction of literals

  2. BOption (b)

    Disjunction of variables

  3. COption (c)

    Conjunction of literals

  4. DOption (d)

    Conjunction of variables

View answer & explanation

Correct answer

Answer: (a)A.

Disjunction of literals

Why this answer is correct

The correct answer is option 1

Key Points

In Boolean Logic, conjunctive normal form or CNF means the product of sums ( POS ) which clearly states that it is a product of clauses which in turn are the sum of literals.

For Example,

Y = (A + B) (A' + B)

Y is in the form of Conjunctive Normal Form. It is a product of (A + B) and (A' + B) which are Sums of A and B, A' and B.

Question 70

Suppose you have a Linux file system where the block size is 2K bytes, a disk address is 32 bits, and an i-node contains the disk addresses of the first 12 direct blocks of file, a single indirect block, and a double indirect block. Approximately, what is the largest file that can be represented by an i-node?  

  1. AOption (a)

    513 Kbytes

  2. BOption (b)

    513 MBytes

  3. COption (c)

    537 Mbytes

  4. DOption (d)

    537 KBytes

View answer & explanation

Correct answer

Answer: (b)B.

513 MBytes

Why this answer is correct

The correct answer is option2

Solution:

Size of the disk block = 2048 Bytes

disk address = 32 bits = 4 Bytes

Number of addresses per block = 2048/4 = 512 = 29

Maximum file size = 12 Direct Blocks + 1 indirect block + 1 double indirect block

                            = 12 + 29 + 29 * 29

                            = 12 + 29 + 218

The size of each block = 211 Bytes

Maximum size of the file = ( 12 + 29 + 218 ) × 211 Bytes

∴ Maximum size of the file =   513.0234 ≈ 513 MBytes

Question 71

Consider the following linear programming (LP):

Max. Z = 2x1 + 3x2 

Such that 2x1 + x2 ≤ 4

x1 + 2x2 ≤ 5

x1, x2 ≥ 0

The optimum value of the LP is

  1. AOption (a)

    23

  2. BOption (b)

    9.5

  3. COption (c)

    13

  4. DOption (d)

    8

View answer & explanation

Correct answer

Answer: (d)D.

8

Why this answer is correct

The correct answer is option 4.

Key Points

Max Z=2x1+3x2

2x1 + x2 ≤ 4

x1 + 2x2 ≤ 5           x1, x2 ≥ 0

Graphical method,

 

Draw lines by removing inequality Z at (1,2)  =2+6=8

Z at (2,0) =4+0 =4

Z at (0,5/2)

    =0+15÷2 =7.5

∴ Hence the correct answer is 8.

Hint

The smart way to answer as per the given options

Question 72

The process of removing details from a given state representation is called ______

  1. AOption (a)

    Extraction

  2. BOption (b)

    Mining

  3. COption (c)

    Selection

  4. DOption (d)

    Abstraction

View answer & explanation

Correct answer

Answer: (d)D.

Abstraction

Why this answer is correct

The correct answer is option 4.

Key Points 

The 'process of removing detail' from a 'given state representation' is called an abstraction.

∴ Hence the correct answer is Abstraction.

Additional Information 

  • Abstraction is a type of Artificial Intelligence problem formulation and problem-solving process.
  • In the analysis of structures or objects, this method includes the elimination of physical, temporal, or spatial information in order to concentrate on more important details.
  • The abstraction method is a simple principle in computer science that is used as a declarative statement in many programming languages such as Java and C++.

Question 73

Arrange the following types of machine in descending order of complexity.

(A) SISD

(B) MIMD

(C) SIMD

Choose the correct answer from the options given below:

  1. AOption (a)

    A, B, C

  2. BOption (b)

    C, B, A

  3. COption (c)

    B, C, A

  4. DOption (d)

    C, A, B

View answer & explanation

Correct answer

Answer: (c)C.

B, C, A

Why this answer is correct

The correct answer is option 3.

Key Points

Order of complexity. MIMD>SIMD>SISD

∴ Hence the correct answer is B, C, A.

Important Points 

Based on Flynn’s classification

MIMD (multiple instruction stream, multiple data stream):

This includes machines with multiple processing units that can apply multiple instructions to different data at the same time. The MIMD machines are the most complicated, but they also hold the most promise for increasing productivity by concurrent processing. Concurrency here means that not only are multiple processors running at the same time but also that multiple programs (processes) are running at the same time, concurrently.

SIMD (single instruction stream, multiple data stream):

This means that a single instruction is applied to several data sets at the same time. Many different processing units are activated by a single control unit in these machines.

SISD (single instruction stream, single data stream):

This is the von Neumann principle of serial computer architecture, which only executes one instruction at a time.

Question 74

Given below are different properties of 3D projections from A-D. Identify the correct order on the basis of property true of (i) a perspective projection only, (ii) an orthographic projection only, (iii) both orthographic and projective transformations and (iv) neither orthographic nor projective transformation, respectively.

(A) Straight lines are mapped to straight lines.

(B) Distances and angles are (in general) preserved.

(C) Far away objects appear the same size as closer ones

(D) Requires homogeneous coordinates in order for it to be encoded into a linear transformation.

Choose the correct answer from the options given below:

  1. AOption (a)

    D, C, B, A

  2. BOption (b)

    B, C, D, A

  3. COption (c)

    D, C, A, B

  4. DOption (d)

    C, D, B, A

View answer & explanation

Correct answer

Answer: (c)C.

D, C, A, B

Why this answer is correct

The correct answer is option 3.

Key Points​

3D projectionsProperties
(i)a perspective projection only(D)Requires homogeneous coordinates in order for it to be encoded into a linear transformation
(ii)an orthographic projection only(C)Far away objects appear the same size as closer ones (as orthographic projection  preserve dimensions)
(iii)both orthographic and projective transformations(A)Straight lines are mapped to straight lines (in both)
(i)vneither orthographic nor projective transformation.(B)Distances and angles are (in general) preserved

 

∴ Hence the correct answer is D, C, A, B.

Question 75

In HTML, <map> is used for

  1. AOption (a)

    defining a path between two nodes in an image

  2. BOption (b)

    defining clickable region in an image

  3. COption (c)

    highlighting an area in an image

  4. DOption (d)

    defining the site-map of a web-site

View answer & explanation

Correct answer

Answer: (b)B.

defining clickable region in an image

Why this answer is correct

The correct answer is option 2.

Key Points

  • The <map> tag is used to define an image map. An image map is an image with clickable areas.
  • The required name attribute of the <map> element is associated with the 's use map attribute and creates a relationship between the image and the map.
  • An image map is made up of an image with clickable areas. When you click on the image, it will open to a new or previously selected destination.

Code

<html> <head><br>

...

</head> <body><br>

...

<map name = "html">

<area shape = "circle" coords = "154,150,59" href = "about/about_team.htm" alt = "Team" target = "_self" />

</map>

</body> </html>

∴ Hence the correct answer is defining the clickable region in an image.

Question 76

Which of the following is/are behavioral testing technique(s) ?

(A) Equivalence Partitioning

(B) Graph-Based Teating Method

(C) Boundery Value Analysis

(D) Data flow Testing

(E) Loop Testing

Choose the correct answer from the options given below:

  1. AOption (a)

    (B) and (D) only

  2. BOption (b)

    (A), (B) and (C) only

  3. COption (c)

    (D) and (E) only

  4. DOption (d)

    (A), (C) and (E) only

View answer & explanation

Correct answer

Answer: (b)B.

(A), (B) and (C) only

Why this answer is correct

The correct answer is option 2.

Key Points

Black-box testing, also known as behavioural testing, focuses on the software's functional specifications. In other words, black-box testing allows a software developer to create sets of input conditions that completely exercise all of a program's functional requirements. The methods for behavioural testing are as follows.

  1. graph-based testing methods
  2. equivalence partitioning
  3. boundary value analysis
  4. comparison testing
  5. orthogonal array testing

 ∴ Hence the correct answer is (A), (B) and (C) only.

Question 77

Which of the following is NOT true in problem solving in artificial intelligence?

  1. AOption (a)

    Implements heuristic search techniques

  2. BOption (b)

    Solution steps are not explicit

  3. COption (c)

    Knowledge is imprecise

  4. DOption (d)

    It works on or implements repetition mechanism

View answer & explanation

Correct answer

Answer: (d)D.

It works on or implements repetition mechanism

Why this answer is correct

The correct answer is option 4.

Key Points

  1. Heuristic search is a search technique that seeks to solve a problem by iteratively enhancing the solution using a heuristic function or a cost analysis. Heuristic search is two types.  Direct Heuristic Search Techniques in AI( Breadth-First Search (BFS) and Depth First Search (DFS).) and Weak Heuristic Search Techniques in AI (Best-First Search, A* Search, etc)
  2. Every AI program has to do the process of searching for the solution steps that are not explicit in nature.
  3. knowledge plays a vital role in intelligence as well as creating artificial intelligence.

∴ Hence the incorrect statement is It works on or implements a repetition mechanism.

Question 78

Given below are two statements:

Statement I: The problem "Is L1 ∧ L2 = ϕ?" is undecidable for context sensitive languages L1 and L2.

Statement II: The problem "Is WϵL?" is decidable for context sensitive language L, (where W is a string).

In the light of the above statements, choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1.

Key Points

  • The problem "Is L1 ∧ L2 = ϕ?" is undecidable for context-sensitive languages L1 and L2. Here L1∧ L2 is a disjoint operator it's undecidable problem.

Hence statement I is correct.

  • The problem "Is WϵL?" is decidable for context-sensitive language L, (where W is a string). Here W is a string that is accepted by the particular language is a membership problem and its decidable problem.

Hence statement II is correct.

Additional Information

Context-sensitive language is accepted by linear bounded automata and only membership(WϵL) problems are decidable.

Context-free language is accepted by pushdown automata and only membership problems(WϵL), finiteness L=finite, emptiness L=Φ are decidable.

Question 79

Consider a disk system having 60 cylinders. Disk requests are received by a disk drive for cylinders 10, 22, 20, 2, 40, 6, and 38, in that order. Assuming the disk head is currently at cylinder 20, what is the time taken to satisfy all the requests if it takes 2 milliseconds to move from one cylinder to an adjacent one and Shortest Seek Time First (SSTF) algorithm is used ?

  1. AOption (a)

    240 milliseconds

  2. BOption (b)

    96 milliseconds

  3. COption (c)

    120 milliseconds

  4. DOption (d)

    112 milliseconds

View answer & explanation

Correct answer

Answer: (c)C.

120 milliseconds

Why this answer is correct

The correct answer is option 3.

Key Points

Shortest Seek Time First (SSTF)

SSTF =(22-20+22-10+10-6+6-2+38-2+40-38)

          =2+12+4+4+36+2

          =60

It takes 2 milliseconds to move from one cylinder to adjacent one = 60x2  =120 milliseconds

∴ Hence the correct answer is 120 milliseconds.

Question 80

Which of the following are applications of symbol table ?

(A) Storage allocation

(B) Checking type compatability

(C) Suppressing duplicate error messages

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) and (C) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (A), (B) and (C)

View answer & explanation

Correct answer

Answer: (d)D.

(A), (B) and (C)

Why this answer is correct

The correct answer is option 4.

Key Points

Symbol table can be used for

  • Storage allocation
  • Checking type compatibility
  • Suppressing duplicate error messages

∴ Hence the correct answer is (A), (B) and (C).

Additional Information

 The symbol table is a data structure that contains a record for each identifier along with its attribute such as type, initial value, scope, a lifetime.

Question 81

Let G1 and G2 be arbitrary context free languages and R an arbitrary regular language.

Consider the following problems:

(A) Is L(G1) = L(G2)?

(B) Is L(G2) ≤ L(G1)?

(C) Is L(G1) = R?

Which of the problems are undecidable ?

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) only 

  2. BOption (b)

    (B) only

  3. COption (c)

    (A) and (B) only

  4. DOption (d)

    (A), (B) and (C)

View answer & explanation

Correct answer

Answer: (d)D.

(A), (B) and (C)

Why this answer is correct

The correct answer is option 4.

Key Points

S.NOFA RegularPDA DCFLPDA CFLLBA CSLRecursive HTMREL TM
1Membership  WεLDDDDDUD
2Finiteness L= finiteDDDUDUDUD
3Equivalence  L1=L2DDUDUDUDUD
4Is L1⊆ L2 Subset CheckingDUDUDUDUDUD
5Emptiness L1=ΦDDDUDUDUD
6Disjoint Operator is L1∩L2=ΦDUDUDUDUDUD
7Is L= Σ* TotalityDUDUDUDUDUD
8Is L regular languageDDUDUDUDUD
- D   =decidable - UD=undecidable

According to the above table, rows 3,4, and 8 it's undecidable.

∴ Hence the correct answer is (A), (B) and (C).

Question 82

If algorithm A and another algorithm B take log2(n) and √n microseconds, respectively, to solve a problem, then the largest size n of a problem these algorithms can solve. respectively. in one second are_____ and _____.

  1. AOption (a)

    2106and;106{2^{{{10}^6}}}and;{10^6}

  2. BOption (b)

    2106and;1012{2^{{{10}^6}}}and;{10^{{12}}}

  3. COption (c)

    2106and;6.106{2^{{{10}^6}}}and;{6.10^6}

  4. DOption (d)

    2106and;6.1012{2^{{{10}^6}}}and;{6.10^{12}}

View answer & explanation

Correct answer

Answer: (b)B.

2106and;1012{2^{{{10}^6}}}and;{10^{{12}}}

Why this answer is correct

The correct answer is option 2.

Explanation:

A microsecond is 10-6 seconds. Hence, one second =106 microseconds

One hour=60x60x106= 3.6x109 microseconds

One month=2.592x1012microseconds

One century=3.1104x1015microseconds

f(n)=logn in this case,the largest value n such that logn <=106.

We rewrite as, 2logn <= 2(10)^6 

thus, 21000000 = (210)100000 = (103)100000 = 10300000

Hence, log2(n) and √n, In one second

2106and;1012{2^{{{10}^6}}}and;{10^{{12}}} the value will be 106 and 106

Hence the correct answer is option 2.

Question 83

Which of the following is not an intermediate code form ?

  1. AOption (a)

    Syntax trees

  2. BOption (b)

    Three address codes

  3. COption (c)

    Quadrupules

  4. DOption (d)

    Post fix Notation

View answer & explanation

Correct answer

Answer: (c)C.

Quadrupules

Why this answer is correct

The correct answer is option 3.

Key Points

  • Intermediate code can be represented in three forms, which are postfix notation, Syntax trees, Three address code.
  • In a compiler, three address code can be implemented as records with fields for operator and operands. There are three such representations, Quadruples, Triples, Indirect triples.

∴ Hence the correct answer is Quadruples.

Question 84

Consider the following properties:

A. Reflexive

B. Antisymmetric

C. Symmetric

Let A = {a, b, c, d, e, f, g} and R= {(a, a),(b, b),(c, d),(c, g),(d, g),(e, e),(f, f),(g, g)} be a relation on A. Which of the following property (properties) is (are) satisfied by the relation R ?

  1. AOption (a)

    Only A

  2. BOption (b)

    Only C

  3. COption (c)

    Both A and B

  4. DOption (d)

    B and not A

View answer & explanation

Correct answer

Answer: (d)D.

B and not A

Why this answer is correct

The correct answer is option 4.

Key Points

  • If a binary relation R over a set X relates every element of X to itself, it is said to be reflexive. Since (c,c) and (d,d) is not given in the given question, it is not reflexive.
  • A binary relation is antisymmetric if there is no pair of distinct elements of X each of which is related by R to the other. The given relation R is antisymmetric because for (c,d) (d,c) is not present in R. Similarly for (c,g) and (d,g).
  • A binary relation is a type of binary relation. An example is the relation "is equal to", because if a=b is true then b=a is also true. Here since (c,d) is pair in a given relation R for which (d,c) is not present in it. So. it violates the Symmetric property of the relation. Hence it is not symmetric.

 ∴ Hence the correct answer is B and not-A.

Question 85

The number of positive integers not exceeding 100 that are either odd or the square of an integer is ______.

  1. AOption (a)

    63

  2. BOption (b)

    59

  3. COption (c)

    55

  4. DOption (d)

    50

View answer & explanation

Correct answer

Answer: (c)C.

55

Why this answer is correct

The correct answer is option 3.

Key Points

By using inclusion exclusion principle, |AUB|= |A|+|B|-|A∩B|

Number of odd numbers in the range of (1-100)=100 ÷ 2=50 (1,3,5,7....97,99)=|A|

Number of squares=10 (1,4,9,16,25,36,49,64,81,100)=|B|

Number of odd numbers and squares=5 (1,9,25,49,81)=|A∩B|

Number of positive integers not exceeding 100 that are either odd or the square=|AUB|= 50+10-5=55

∴ Hence the correct answer is 55.

Question 86

Which of the following statements regarding XML is/are True ?

(A) XML is a set of tags designed to tell browsers how to display text and images in a web page.

(B) XML defines a syntax for representing data. but the meaning of data varies from application to application

(C) < Letter >, < LETTER > and < letter > are three different tags in XML.

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) and (C) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (A), (B) and (C )

View answer & explanation

Correct answer

Answer: (c)C.

(B) and (C) only

Why this answer is correct

The correct answer is option 3.

Key Points

  • XML was created with the aim of transporting data, with an emphasis on what data is.
  • HTML was developed with the intention of presenting data with an emphasis on how it appears.

Statement A: ​FALSE:

HTML is a collection of tags that tell web browsers how to view text and images on a website.

Statement B: TRUE 

While XML specifies a syntax for representing data, the meaning of data varies by application.

Statement C: TRUE  

XML is case sensitive and hence < Letter >, < LETTER > and < letter > are three different tags in XML.

∴ Hence the correct answer is (B) and (C) only.

Comprehension: Questions concern a disk with a sector size of 512 bytes, 2000 tracks per surface, 50 sectors per track, five double-sided platters, and average seek time of 10 milliseconds.

Question 87

If T is the capacity of a track in bytes, and S is the capacity of each surface in byte, then (T, S) = _____.

  1. AOption (a)

    (50 K, 50000 K)

  2. BOption (b)

    (25 K, 25000 K)

  3. COption (c)

    (25 K, 50000 K)

  4. DOption (d)

    (40 K, 36000 K)

View answer & explanation

Correct answer

Answer: (c)C.

(25 K, 50000 K)

Why this answer is correct

The correct answer is option 3.

Key Points

Track capacity = bytes/sector × sectors/track = 512 × 50 = 25K bytes/track 

Surface capacity = bytes/track × tracks/surface = 25K × 2000 = 50, 000K  bytes/surface 

∴ Hence the correct answer is (25 K, 50000 K).

Question 88

What is the capacity of the disk, in bytes ?

  1. AOption (a)

    25,000 K

  2. BOption (b)

    500,000 K

  3. COption (c)

    250,000 K

  4. DOption (d)

    50,000 K

View answer & explanation

Correct answer

Answer: (b)B.

500,000 K

Why this answer is correct

The correct answer is option 2.

Key Points

capacity of the disk = bytes/sector x sector/track x track/surface x surface/disk=512 x 50 x 2000 x 5 x 2

=500000K Bytes/disk

∴ Hence the correct answer is 500,000 K.

Question 89

If the disk platters rotate at 5400 rpm (revolutions per minute), then approximately what is the maximum rotational delay ?

  1. AOption (a)

    0.011 seconds

  2. BOption (b)

    0.11 seconds

  3. COption (c)

    0.0011 seconds

  4. DOption (d)

    1.1 seconds

View answer & explanation

Correct answer

Answer: (a)A.

0.011 seconds

Why this answer is correct

The correct answer is option 1.

Key Points

if the disk platters rotate at 5400rpm, the time required for one complete rotation, which is the maximum rotational delay,

5400 rotations= 1 minute

one rotation = 15400\frac{1}{5400} × 60 seconds

maximum rotational delay = 0.011seconds. 

∴ Hence the correct answer is 0.011seconds.

Question 90

If one track of data can be transferred per revolution, then what is the data transfer rate ? 

  1. AOption (a)

    2,850 KBytes/second

  2. BOption (b)

    4,500 KBytes/second

  3. COption (c)

    5,700 KBytes/second

  4. DOption (d)

    2,250 KBytes/second

View answer & explanation

Correct answer

Answer: (d)D.

2,250 KBytes/second

Why this answer is correct

The correct answer is option 4.

Key Points

The capacity of a track is=bytes / sector x sector / track= 512x50=25k

Since one track of data can be transferred per revolution,

Data transfer rate = tracksize÷rotational delay

if the disk platters rotate at 5400rpm, the time required for one complete rotation will be, 1/5400 x60= 0.011 seconds

Rotational delay=0.011

Data transfer rate=2250K÷ 0.011= 2,250 KBytes/second

∴ Hence the correct answer is 2,250 KBytes/second.

Question 91

Given below are two statements:

Statement I: The disk has a total number of 2000 cylinders.

Statement II: 51200 bytes is not a valid block size for the disk.

In the light of the above statements, choose the correct answer from the options given below:

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1. 

Key Points

Statement I: correct.

The number of cylinders is 2000, which is the same as the number of tracks on each platter.

Hence it is correct.

Statement II: correct

The block size will be a multiple of the sector size. 51200 is not a valid block size in this case because block size cannot exceed the size of a track, which is 25600 bytes.

Hence it is correct.

Question 92

Post office protocol (POP) is a message access protocol which is used to extract message for client. In this regard, which of the following are true ?

(A) POP has two modes, Delete mode and keep

(B) In Delete mode, mail is deleted from mail box after each retrival

(C) In Delete mode, mail is deleted from mail box before each retrieval

(D) In keep mode, mail is deleted before retrival

(E) In keep mode, mail remains in mail box after retrival

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A), (D) and (E) only

  3. COption (c)

    (A), (B), (C) and (D) only

  4. DOption (d)

    (A), (B) and (E) only

View answer & explanation

Correct answer

Answer: (d)D.

(A), (B) and (E) only

Why this answer is correct

The correct answer is option 4.

Key Points

Statement A: TRUE:  

Post Office Protocol (POP) is a type of computer networking and Internet standard protocol that has two modes, Delete mode and keep mode.

Statement B: TRUE:  

In Delete mode, the mail is deleted from the mailbox after each retrieval.

and hence statement C is FALSE

Statement E: TRUE**:**  

In keep mode, mail remains in a mailbox after retrieval.

and statement D is FALSE

Therefore the correct answer is (A), (B), and (E) only.

Hint

Delete Mode ( delete after reading ).

Keep Mode ( stores even after reading ).

Question 93

Given below are two statements:

Statement I: Quality control involves the series of inspections, reviews and tests used throughout the software process. to ensure each work product meets the requirements placed upon it.

Statement II: Quality assurance consists of auditing and reporting functions of management. In the light of the above statements.

choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true.

View answer & explanation

Correct answer

Answer: (a)A.

Both Statement I and Statement II are true

Why this answer is correct

The correct answer is option 1.

Key Points

Quality control 

Quality control is a series of inspections, reviews, and tests conducted during the software development process to ensure that each work product follows the specifications. A feedback loop to the process that produced the work product is included in quality control. When the work items produced fail to meet their expectations, the process is fine-tuned using a combination of calculation and feedback. Quality management is regarded as an important part of the production process in this approach.

      Quality control activities may be fully automated, entirely manual, or a combination of automated tools and human interaction. A key concept of Quality control is that all work products have defined, measurable specifications to which we may compare the output of each process. The feedback loop is essential to minimize the defects produced.

Hence Statement I is correct.

Quality assurance 

Management's auditing and monitoring activities make up quality assurance. The aim of quality assurance is to provide management with the information they need to make informed decisions about product quality, allowing them to gain knowledge and trust that the product is achieving its objectives.

    Of course, if the data provided through quality assurance identify problems, it is the managements responsibility to address the problems and apply the necessary resources to resolve quality issues.

Hence Statement II is correct.

Comprehension: Consider the following table structures related to a university for given questions.

EMPLOYEE

NAMEVARCHAR (30)NOT NULL,
EIDVARCHAR (10)NOT NULL,
DEPTNOINT (5)NOT NULL,
HODEIDVARCHAR (10),
SALARYINT (10),

PRIMARY KEY (EID),

FOREIGN KEY (HODEID) REFRENCES EMPLOYEE (EID),

FOREIGN KEY (DEPTNO) REFRENCES DEPARTMENT (DID);

DEPARTMENT

DIDINT (5)NOT NULL,
DNAMEVARCHAR (30)NOT NULL,
HODIDVARCHAR (10)NOT NULL,
HODNAMEVARCHAR (30),

PRIMARY KEY (DID),

UNIQUE (DNAME),

FOREIGN KEY (HODID) REFERENCES EMPLOYEE (EID),

PROJECT WORE:

EMPIDVARCHAR (10)NOT NULL,
PROJNOINT (5)NOT NULL,
PROJECTLOCVARCHAR (30)NOT NULL,

PRIMARY KEY (EMPID, PROJNQ),

FOREIGN KEY (EMPID) REFERENCES EMPLOYEE (EID),

Question 94

Refer table, structures given above, University decided to give all employees in the ‘SCIENCE’ department a 20% rise in salary. Which of the following query/queries will compute the above results?

(A)

UPDATE EMPLOYEE

SET SALARY = SALARY*1.20

WHERE DEPT NO. IN (SELECT DID FROM DEPARTMENT WHERE DNAME='SCIENCE');

(B)

UPDATE TABLE EMPLOYEE

SET SALARY = SALARY*1.20

WHERE DNAME='SCIENCE’;

(C)

ALTER TABLE EMPLOYEE

SET SALARY=SALARY*1.20

WHERE DEPTNO. IN (SELECT DNAME FROM DEPARTMENT WHERE DNAME ='SCIENCE’)

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (C) only

View answer & explanation

Correct answer

Answer: (b)B.

(A) only

Why this answer is correct

The correct answer is option 1.

Key Points

Syntax:  

UPDATE table_name

SET column1 = value1, column2 = value2, ...

WHERE condition;

Option A:

UPDATE EMPLOYEE

SET SALARY = SALARY*1.20

WHERE DEPT NO. IN (SELECT DID FROM DEPARTMENT WHERE DNAME='SCIENCE');

Option B:

UPDATE TABLE EMPLOYEE SET SALARY = SALARY*1.20 WHERE DNAME='SCIENCE’;

Here, DNAME is not an attribute of an employee table it's an incorrect query.

Option C:

ALTER TABLE EMPLOYEE

SET SALARY=SALARY*1.20

WHERE DEPTNO. IN (SELECT DNAME FROM DEPARTMENT WHERE DNAME ='SCIENCE’)

Here, the ALTER TABLE statement is used to add, delete, or modify columns in an existing table and used to add and drop various constraints on an existing table. Alter table is mainly used for changing table structure or constraints. Here DNAME is not an attribute of an employee table it's an incorrect query.

∴ Hence the correct answer is (A).

Question 95

Which of the following query/queries return the employee ID and name of employees whose salary is greater than the salary of all employees in department number 20 of university. Order result by employee ID (refer table structures given above).

(A)

SELECT EID, NAME

FROM EMPLOYEE

WHERE SALARY > (SELECT SALARY FROM EMPLOYEE WHERE DEPTNO=20) ORDER BY EID:

(B)

SELECT EID, NAME

FROM EMPLOYEE

WHERE SALARY > (SELECT SALARY FROM EMPLOYEE WHERE DEPTNO=20);

(C)

SELECT EID, NAME

FROM EMPLOYEE

WHERE SALARY > ALL(SELECT SALARY FROM EMPLOYEE WHERE DEPTNO=20)

ORDER BY EID

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) and (C) only

  3. COption (c)

    (B) only

  4. DOption (d)

    (C) only

View answer & explanation

Correct answer

Answer: (d)D.

(C) only

Why this answer is correct

The correct answer is option 4.

Key Points

SELECT SALARY FROM EMPLOYEE WHERE DEPTNO=20

The above inner query will be written the salary of an employee whose department number is 20. This will match with, the salary of the employee > salary of at least one employee.

Query: 

SELECT EID, NAME

FROM EMPLOYEE

WHERE SALARY > ALL(SELECT SALARY FROM EMPLOYEE WHERE DEPTNO=20)

ORDER BY EID

The query returns the employee ID and name of employees whose salary is greater than the salary of all employees in department number 20 of the university. Order result by employee ID

Question 96

In reference to the above given table structures, which of the following query/queries will drop the ‘SALARY’ column from 'EMPLOYEE' table ?

(A) ALTER TABLE EMPLOYEE DROP SALARY CASCADE;

(B) ALTER TABLE EMPLOYEE DROP SALARY RESTRICT;

(C) ALTER EMPLOYEE DROP SALARY:

Choose the correct answer from the options given below:

  1. AOption (a)

    (A) and (B) only

  2. BOption (b)

    (A) and (C) only

  3. COption (c)

    (B) and (C) only

  4. DOption (d)

    (A) only

View answer & explanation

Correct answer

Answer: (a)A.

(A) and (B) only

Why this answer is correct

The correct answer is option 1.

Key Points

 Alter table Syntax:

ALTER TABLE table-Name    

DROP [ COLUMN ] column-name [ CASCADE | RESTRICT ]

  • The keyword COLUMN, CASCADE, RESTRICT are optional. The default is CASCADE. If you use the RESTRICT option, the column drop will be rejected if it would invalidate a dependent schema object. If CASCADE is defined, the column drop should also remove any other schema objects that have become invalid.
  • Since the salary field is not present in any other table, CASCADE | RESTRICT has no impact.
  • (C) ALTER EMPLOYEE DROP SALARY is incorrect syntax.

∴ Hence the correct answer is  (A) and (B) only.

Question 97

Given below are two statements to find the sum of salaries of all employees of the English department as well as the maximum. minimum and average salary in the English department.

STATEMENT I: SELECT SUM (SALARY). MAX (SALARY), MIN (SALARY), AVG (SALARY) FROM EMPLOYEE, DEPARTMENT

WHERE DEPTNO=DID AND DNAME='ENGLISH';

STATEMENT II: SELECT SUM (SALARY), MAX (SALARY), MIN (SALARY), AVG (SALARY) FROM EMPLOYEE, DEPARTMENT

WHERE DNAME='ENGLISH';

In the light of the above statements, choose the correct answer from the options given below

  1. AOption (a)

    Both Statement I and Statement II are true

  2. BOption (b)

    Both Statement I and Statement II are false

  3. COption (c)

    Statement I is correct but Statement II is false

  4. DOption (d)

    Statement I is incorrect but Statement II is true

View answer & explanation

Correct answer

Answer: (c)C.

Statement I is correct but Statement II is false

Why this answer is correct

The correct answer is option 3.

Key Points

Two table tables (join condition) must be matched so that records can be linked uniquely.

Query: 

SUM (SALARY). MAX (SALARY), MIN (SALARY), AVG (SALARY) FROM EMPLOYEE, DEPARTMENT WHERE DEPTNO=DID AND DNAME='ENGLISH';

Without DEPTNO=DID condition as in statement II, there will be the cartesian product of two tables (EMPLOYEE, DEPARTMENT) and it will appear many duplicate rows with DNAME='ENGLISH'.

Hence Statement I is correct but Statement II is false.

Question 98

On the basis of above given table structures, retrieve the distinct employee ID (EMPID) of all employees of university who are working on project No.20, 30 and 40. 

  1. AOption (a)

    SELECT EMPID

    FROM PROJECTWORK

    WHERE PROJNO=(20, 30, 40);

  2. BOption (b)

    SELECT EMPID

    FROM PROJECTWOREK

    WHERE PROJNO IN (20, 30, 40);

  3. COption (c)

    SELECT DISTINCT EMPID

    FROM PROJECTWORK

    WHERE PROJNO IN (20, 30, 40);

  4. DOption (d)

    SELECT DISTINCT EMPID

    FROM PROJECTWORK

    WHERE PROJNO=20, 30, 40;

View answer & explanation

Correct answer

Answer: (c)C.

SELECT DISTINCT EMPID

FROM PROJECTWORK

WHERE PROJNO IN (20, 30, 40);

Why this answer is correct

The correct answer is option 3.

Key Points

Since the primary key is a combination of two keys (EMPID, PROJNQ) so duplicate values may occur in EMID and PROJNQ. So distinct keys are required to eliminate duplicates in the combined table. And IN is a set operator it matches all table values to the set values.

∴ Hence the correct answer is the below query.

SELECT DISTINCT EMPID

FROM PROJECTWORK

WHERE PROJNO IN (20, 30, 40);

Question 99

Match List I with List II

List IList II
(A) Branch-and-bound(I) Keeps track of all partial paths which can be candidate for further exploration.
(B) Steepest-accent hill climbing(II) Detects difference between current state and goal state
(C) Constraint satisfaction(III) Discovers problem state(s) that satisfy a set of constraints.
(D) Means-end-analysis(IV) Considers all moves from current state and selects best move

 

Choose the correct answer from the options given below:

  1. AOption (a)

    A - I, B - IV, C - III, D - II 

  2. BOption (b)

    A - I, B - II, C - III, D - IV 

  3. COption (c)

    A - II, B - I, C - III, D - IV 

  4. DOption (d)

    A - II, B - IV, C - III, D - I 

View answer & explanation

Correct answer

Answer: (a)A.

A - I, B - IV, C - III, D - II 

Why this answer is correct

The correct answer is option 1.

Key Points

Branch-and-bound:  

Keeps track of all partial paths which can be a candidate for further exploration. (ex: A Search, BFS)*

Steepest-accent hill climbing: 

Considers all moves from the current state and selects the best move. (ex:hill-climbing algorithm. )

Constraint satisfaction: 

Discovers problem state(s) that satisfy a set of constraints. (ex: Eight queens puzzle. Map coloring problem.)

Means-end-analysis: 

Detects the difference between the current state and the goal state. (ex: Means-end-analysis)

∴ Hence the correct answer is A - I, B - IV, C - III, D - II.

Question 100

In a binary max heap containing n numbers, the smallest element can be found in ______ time.  

  1. AOption (a)

    O(n)

  2. BOption (b)

    O(log2 n)

  3. COption (c)

    O(1)

  4. DOption (d)

    O(log2 log2 n)

View answer & explanation

Correct answer

Answer: (a)A.

O(n)

Why this answer is correct

The correct answer is option 1.

Key Points

  • The heap's smallest values will always be present on the last level or second last of the heap in a MAX heap, and the time complexity of reaching the last level of the heap is O(n).
  • We must use a linear search to search all of the elements in order to find the smallest element and heap.
  • It will take O(n) time to traverse all of the elements using linear search.

Hence the correct answer is O(n).

100 questions in the full paper