Previous Year Paper

UGC NET Paper 2: Computer Science 20th Dec 2018 Paper (Previous Year Paper)

Held in 2018

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

An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?

  1. AOption (a)

    245.248.136.0/21 and 245.248.128.0/22

  2. BOption (b)

    245.248.128.0/21 and 245.248.128.0/22

  3. COption (c)

    245.248.132.0/22 and 245.248.132.0/21

  4. DOption (d)

    245.248.136.0/24 and 245.248.132.0/21

View answer & explanation

Correct answer

Answer: (a)A.

245.248.136.0/21 and 245.248.128.0/22

Why this answer is correct

The correct answer is 245.248.136.0/21 and 245.248.128.0/22

 

Since Half of 4096 post addresses must be given organization A, we can set the 12th bit to 1, include that bit into the network path of organization A. So the valid allocation of address to A is 245.248.136.0/21.

The 12th bit is set to 0, but we need only half of the 2048 address, 13th bit can be set to be 0 addresses to B is 245.248.128.0/22.

Hence the correct answer is 245.248.136.0/21 and 245.248.128.0/22.

Question 2

Suppose a system has 12 instances of some resources with n processes competing for that resource. Each process may require 4 instances of the resource. The maximum value of n for which the system never enters into deadlock is

  1. AOption (a)

    3

  2. BOption (b)

    4

  3. COption (c)

    5

  4. DOption (d)

    6

View answer & explanation

Correct answer

Answer: (a)A.

3

Why this answer is correct

Data:

Available Resources = R = 12

Max need per process = 4

Concepts:

Deadlock can occur If any process gets available resource < needed (requested) resource

Max resource per process to be in deadlock = needed – 1 = 4 – 1 = 3

For n process, max resource to be in deadlock = n × 3 = 3n

If one resource (tape drive) is added, any of the n processes can take it a finish its execution leaving behind the allocated resource and hence the system will be deadlock free.

Calculation:

For n process, min resource for the system not to be in deadlock state = n + 1 ≤ R

3n + 1 ≤ 12

3n ≤ 11

∴ nmax = 3

Tips and Tricks:

n × (m - 1) + 1 ≤ R

where n is the number of processes

m is the maximum resource need per process

R is the available system resources.

Question 3

To overcome difficulties in Readers-Writers problem, which of the following statement/s is/are true?

  1. Writers are given exclusive access to shared objects

  2. Readers are given exclusive access to shared objects

  3. Both readers and writers are given exclusive access to shared objects.

Choose the correct answer from the code given below:

  1. AOption (a)

    1 only

  2. BOption (b)

    Both 2 and 3

  3. COption (c)

    2 only

  4. DOption (d)

    3 only

View answer & explanation

Correct answer

Answer: (a)A.

1 only

Why this answer is correct

In Readers-Writers problem, more than one Reader is allowed to read simultaneously but if a Writer is writing then no other writer or any reader can have simultaneous access to that shared object. So, Writers are given exclusive access to shared objects.

Hence option 1 is correct

Question 4

Consider the vocabulary with only four propositions A, B, C and D. How many models are there for the following sentence?

(⌐ ​ A ∨​ ⌐ ​ B ∨​ ⌐ ​ C ∨​ ⌐ ​ D)

  1. AOption (a)

    8

  2. BOption (b)

    7

  3. COption (c)

    15

  4. DOption (d)

    16

View answer & explanation

Correct answer

Answer: (c)C.

15

Why this answer is correct

Concepts:

Number of models is nothing but number of TRUE in final statement.

Using De Morgan’s Law

(¬ ​A ∨​ ¬ B ∨​ ¬ C ∨​ ¬ ​ D) ≡ ¬ (A ∧ B ∧ C ∧ D)

Truth Table:

ABCD(A ∧ B ∧ C ∧ D)¬ (A ∧ B ∧ C ∧ D)
TTTTTF
TTTFFT
TTFTFT
TTFFFT
TFTTFT
TFTFFT
TFFTFT
TFFFFT
FTTTFT
FTTFFT
FTFTFT
FTFFFT
FFTTFT
FFTFFT
FFFTFT
FFFFFT

 

15 models are there for given statement

Important Points:

(¬ ​A ∨​ ¬ B ∨​ ¬ C ∨​ ¬ ​ D) ≡ ¬ (A ∧ B ∧ C ∧ D)

Number of variables = 4

Statement possible = 24 = 16

Since (A ∧ B ∧ C ∧ D) AND operation will give true statement only when all are TRUE

Therefore, number of models in (A ∧ B ∧ C ∧ D) = 1 and

number of models in ¬ (A ∧ B ∧ C ∧ D) = 16 – 1 = 15

Question 5

Suppose P, Q and R are co-operating processes satisfying Mutual Exclusion condition. Then if the process Q is executing in its critical section then

  1. AOption (a)

    ‘P’ executes in critical section

  2. BOption (b)

    ‘R’ executes in critical section

  3. COption (c)

    Neither ‘P’ nor ‘R’ executes in their critical section

  4. DOption (d)

    Both ‘P’ and ‘R’ executes in critical section

View answer & explanation

Correct answer

Answer: (c)C.

Neither ‘P’ nor ‘R’ executes in their critical section

Why this answer is correct

Concepts:

A mutual exclusion (mutex) is a program object that prevents simultaneous access to a shared resource.

A critical section is a code segment that accesses shared variables and has to be executed as an atomic action. The critical section problem refers to the problem of how to ensure that at most one process is executing its critical section at a given time.

PROCESS:

ENTRY SECTION
Process Q CRITICAL SECTION
EXIT SECTION
REMAINDER SECTION

 

Since process ‘Q’ is in the critical section then other processes P and R cannot be in the critical section. Therefore neither ‘P’ nor ‘R’ executes in their critical section.

Question 6

A Computer uses a memory unit with 256K word of 32 bits each. A binary instruction code is stored in one word of memory. The instruction has four parts: an indirect bit, an operation code and a register code part to specify one of 64 registers and an address part. How many bits are there in operation code, the register code part and the address part?

  1. AOption (a)

    7, 7, 18

  2. BOption (b)

    18, 7, 7

  3. COption (c)

    7, 6, 18

  4. DOption (d)

    6, 7, 18

View answer & explanation

Correct answer

Answer: (c)C.

7, 6, 18

Why this answer is correct

Data:

1 word = 32 bits = 4 bytes

Memory size = 256K word = 218 word

Indirect bits = 1

Number of registers = n = 64

Formula:

Number of bits needed to present a register = ⌈log2 n⌉

Calculation:

Number of bits needed to present a register = ⌈log2 64⌉ = 6

Binary Instruction (32 bit):

Indirect bit (1-bit)Operation Code (x-bits)Register Code (6-bits)Address Part (18-Bits)

 

1 + x + 6 + 18 = 32

∴ x = 7

Therefore 7,6 and 18 bits are there in operation code, the register code part and the address part respectively.

Question 7

Consider the following set of processes and the length of CPU burst time given in milliseconds:

ProcessCPU Burst time (ms)
P15
P27
P36
P44

 

Assume that processes being scheduled with Round-Robin Scheduling Algorithm with Time Quantum 4ms. Then the waiting time for P4 is _________ ms.

  1. AOption (a)

    0

  2. BOption (b)

    4

  3. COption (c)

    12

  4. DOption (d)

    6

View answer & explanation

Correct answer

Answer: (c)C.

12

Why this answer is correct

Scheduling Algorithm: Round-Robin

Time Quantum: 4 milliseconds

Gantt chart:

P1P2P3P4P1P2P3

 

0 4 8 12 16 17 20 22

Process Table:

ProcessArrival Time (AT)Burst Time (BT)Completion Time (CT)Turnaround Time (TAT)Waiting Time (WT)
P105171712
P207202013
P306222216
P404161612

 

Therefore, the waiting time for P4 is 12 milliseconds.

Formula used:

TAT = CT – AT

WT = TAT – BT

Important Points:

Since arrival time is not given of processes is not given consider all the process arrive at time = 0 and by convention, the process with lowest id associated with it executes first, that is, P1 followed by P2 and so on.

Question 8

The number of substrings that can be formed from string given by “a d e f b g h n m p” is

  1. AOption (a)

    10

  2. BOption (b)

    45

  3. COption (c)

    56

  4. DOption (d)

    55

View answer & explanation

Correct answer

Answer: (c)C.

56

Why this answer is correct

Concepts:

A substring is a contiguous sequence of characters within a string.

Example:

String: “GATE”

Substring: G, A, T, E, GA, AT, TE, GAT, ATE, GATE and Λ (empty string or null string)

Therefore, number of substrings = 11

Formula:

If character is not repeated, then

number;of;substring=n×(n+1)2+1{\rm{number;of;substring}} = \frac{{{\rm{n}} \times \left( {{\rm{n}} + 1} \right)}}{2} + 1

Calculation:

String: “a d e f b g h n m p”

∴ number of characters = n = 10

Repetition is not present in a string

number;of;substring=10×(10+1)2+1=56;{\rm{number;of;substring}} = \frac{{10 \times \left( {10 + 1} \right)}}{2} + 1 = 56;

Question 9

In computers, subtraction is generally carried out by

  1. AOption (a)

    1’s complement

  2. BOption (b)

    10’s complement

  3. COption (c)

    2’s complement

  4. DOption (d)

    9’s complement

View answer & explanation

Correct answer

Answer: (c)C.

2’s complement

Why this answer is correct

  • In computers, subtraction is generally carried out by 2’s complement.
  • In two's-complement representation, positive numbers are simply represented as themselves, and negative numbers are represented by the two's complement of their absolute value;
<br>

Example:

Consider a 4-bit numbers

Range: (–24-1 to 24-1 – 1) → (–8 to 7)

Perform: 6 – 4 = 6 + (– 4)

(6)10 = 0110

(4)10 = 0100, 2’s complement of 4 = (–4)10 = (1100)2

0110 + 1100 = 10010 (discard the carry)

∴ 0110 + 1010 = 0010

(0010)2 = (2)10

Question 10

The Boolean expression A̅⋅B + A.B̅ + A.B is equivalent to

  1. AOption (a)

    A + B

  2. BOption (b)

    A.B

  3. COption (c)

    A+B‾\overline {A + B}

  4. DOption (d)

    A̅.B

View answer & explanation

Correct answer

Answer: (a)A.

A + B

Why this answer is correct

A̅⋅B + A.B̅ + A.B

= A̅ . B + A(B̅ + B)

∵ B̅ + B = 1

= A̅.B + A

∵ x + yz = (x + y).(x + z)

= (A + A̅).(A + B)

= (A + B)

A̅⋅B + A.B̅ +A.B is equivalent to (A + B)

Question 11

Consider a disk pack with 32 surfaces, 64 tracks and 512 sectors per pack. 256 bytes of data are stored in a bit serial manner in a sector. The number of bits required to specify a particular sector in the disk is

  1. AOption (a)

    19

  2. BOption (b)

    20

  3. COption (c)

    18

  4. DOption (d)

    22

View answer & explanation

Correct answer

Answer: (b)B.

20

Why this answer is correct

Data:

Number of Surfaces = 32 = 25

Tracks per surface = 64 = 26

Sectors per surface = 512 = 29

bytes per sector = 512 = 29

Formula:

number of sectors = s= no. surfaces × tracks per surface × sectors per track

bits required to specify a particular sector = ⌈log2 s⌉

Calculation:

s= no. surfaces × tracks per surface × sectors per track

s = 25 × 26 × 29 = 220

bits required to specify a particular sector = ⌈log2 220⌉ = 20

Question 12

Consider a system with 2 level cache. Access times of Level 1, Level 2 cache and main memory are 0.5 ns, 5 ns and 100 ns respectively. The hit rates of Level 1 and Level 2 caches are 0.7 and 0.8 respectively. What is the average access time of the system ignoring the search time within cache?

  1. AOption (a)

    20.75 ns

  2. BOption (b)

    7.55 ns

  3. COption (c)

    24.35 ns

  4. DOption (d)

    35.20 ns

View answer & explanation

Correct answer

Answer: (b)B.

7.55 ns

Why this answer is correct

Data:

T1 = 0.5 ns, T2 = 5 ns and T3 = 100 ns

H1 = 0.7, H2 = 0.8

Average access time = Tavg

Formula:

Tavg = H1T1 + (1 - H1) H2 (T1 + T2) + (1 - H1) (1 - H2) (T1 + T2 + T3)

Since search time within cache is ignored

Tavg = H1T1 + (1 - H1) H2 (T2) + (1 - H1) (1 - H2) (T3)

Calculation:

Tavg = 0.5 × 0.7 + 0.3 × 0.8 × 5 + 0.3 × 0.2 × 100

Tavg = 0.35 + 1.2 + 6 = 7.55 ns

Notes:

1 ns = 10 - 9 s

Question 13

Consider the following x86 - assembly language instructions:

MOV AL, 153

NEG AL

The contents of the destination register AL (in 8 - bit binary notation), the status of Carry Flag (CF) and Sign Flag (SF) after the execution of above instructions, are

  1. AOption (a)

    AL = 0110 0110; CF = 0; SF = 0

  2. BOption (b)

    AL = 0110 0111; CF = 0; SF = 1

  3. COption (c)

    AL = 0110 0110; CF = 1; SF = 1

  4. DOption (d)

    AL = 0110 0111; CF = 1; SF = 0

View answer & explanation

Correct answer

Answer: (a)A.

AL = 0110 0110; CF = 0; SF = 0

Why this answer is correct

(153) 2 → 1001 1001

NEG → 1’s complement of (153) 2 → 0110 0110

Therefore AL = 0110 0110 since it is a positive number and no carry occurs

∴ SF = 0 and CF = 0

Therefore option 1 is correct.

Question 14

Suppose for a process P, reference to pages in order are 1, 2, 4, 5, 2, 1, 2, 4. Assume that main memory can accommodate 3 pages and the main memory has already pages 1 and 2 in the order 1 - first, 2 - second. At this moment, assume FIFO Page Replacement Algorithm is used then the number of page faults that occur to complete the execution of process P is

  1. AOption (a)

    6

  2. BOption (b)

    4

  3. COption (c)

    3

  4. DOption (d)

    5

View answer & explanation

Correct answer

Answer: (d)D.

5

Why this answer is correct

Page Replacement Algorithm: FIFO

Reference to pages: 1, 2, 4, 5, 2, 1, 2, 4.

Page 1 and 2 are present in order: 1 and 2 in page frame:

12452124
11155554
22222111
444422
HHMMHMMM

 

Miss = page fault = 5

Important Points

M → miss

H → hit

Question 15

Consider the following statements:

(i) Auto increment addressing mode is useful in creating self - relocating code.

(ii) If auto increment addressing mode is included in an instruction set architecture, then an additional ALU is required for effective address calculation.

(iii) In auto increment addressing mode, the amount of increment depends on the size of the data item accessed.

Which of the above statements is/are true?

  1. AOption (a)

    (iii) only

  2. BOption (b)

    (ii) and (iii) only

  3. COption (c)

    (i) and (ii) only

  4. DOption (d)

    (ii) only

View answer & explanation

Correct answer

Answer: (a)A.

(iii) only

Why this answer is correct

  • Self - relocating code takes always some address in memory and hence auto - increment addressing mode is not used for self - relocating code.
  • In auto - increment addressing mode the address where next data block to be stored is generated automatically depending upon the size of single data item required to store.
  • Additional ALU is not required for effective address calculation if auto addressing mode is included in an instruction set architecture.
  • Within a loop, auto - increment addressing mode can be used to step through all the elements of an array or vector.

Since statement (iii) is correct, therefore option 1 is correct.

Question 16

The elements 42, 25, 30, 40, 22, 35, 26 are inserted one by one in the given order into a max heap. The resultant max-heap is stored in an array implementation as

  1. AOption (a)

    <42, 35, 40, 22, 25, 26, 30>

  2. BOption (b)

    <42, 35, 40, 22, 25, 30, 26>

  3. COption (c)

    <42, 40, 35, 25, 22, 26, 30>

  4. DOption (d)

    <42, 40, 35, 25, 22, 30, 26>

View answer & explanation

Correct answer

Answer: (d)D.

<42, 40, 35, 25, 22, 30, 26>

Why this answer is correct

Concepts:

After inserting each element, we will apply MAX-Heapify operation to get the MAX-Heap.

Insert: 42, 25 and 30

Insert: 40 apply MAX-Heapify

New order: 42, 40, 30, 25, 22

Insert: 35 apply MAX-Heapify

New order: 42, 40, 35, 25, 22, 30 and 26

Diagram:  resultant MAX_Heap

Question 17

Consider two sequences X and Y:

X = <0,1,2,1,3,0,1 >

Y = <1,3,2,0,1,0 >

The length of longest common subsequence between X and Y is

  1. AOption (a)

    4

  2. BOption (b)

    2

  3. COption (c)

    3

  4. DOption (d)

    5

View answer & explanation

Correct answer

Answer: (a)A.

4

Why this answer is correct

Concepts:

If there is match, A[i, j] = A[i – 1, j  – 1] + 1

If not match: max(A[i – 1, j], A[i, j – 1])

Table of longest common subsequence:

X0121301
Y00000000
100111111
300111222
200122222
001122233
101223334
001223344

 

Therefore, length of longest common subsequence = x = 4

Question 18

Match List 1 with List 2 and choose the correct answer from the code given below:

List I (Graph Algorithm)List II (Time Complexity)
a) Dijkstra’s algorithmi) Θ(E log E)
b) Kruskal’s algorithmii) Θ(V3)
c) Floyd-Warshall algorithmiii) Θ(V2)
d) Topological sortingiv) Θ(V + E)

 

Where V and E are the number of vertices and edges in graph respectively.

  1. AOption (a)

    (a)-(i), (b)-(iii), (c)-(iv), (d)-(ii)

  2. BOption (b)

    (a)-(i), (b)-(iii), (c)-(ii), (d)-(iv)

  3. COption (c)

    (a)-(iii), (b)-(i), (c)-(ii), (d)-(iv)

  4. DOption (d)

    (a)-(iii), (b)-(i), (c)-(iv), (d)-(ii)

View answer & explanation

Correct answer

Answer: (c)C.

(a)-(iii), (b)-(i), (c)-(ii), (d)-(iv)

Why this answer is correct

Graph AlgorithmTime Complexity)
Dijkstra’s algorithmΘ (V​2)
Kruskal’s algorithmΘ (Elog E)
Floyd-Warshall algorithmΘ(V3)
Topological sortingΘ(V + E)

 

  • Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph and time complexity is O(V​2).
  • Kruskal's algorithm is a minimum-spanning-tree algorithm which finds an edge of the least possible weight that connects any two trees in the forest.
  • A topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v,u comes before v.
  • Floyd–Warshall algorithm is an algorithm for finding shortest paths in a weighted graph with positive or negative edge weights. A single execution of the algorithm will find the lengths of shortest paths between all pairs of vertices.

Question 19

Suppose that everyone in a group on N people wants to communicate secretly with the (N - 1) others using symmetric Key cryptographic system. The communication between any two person should not be decodable by the others in the group. The number of keys required in the system as a whole to satisfy the confidentiality requirement is

  1. AOption (a)

    2N

  2. BOption (b)

    N(N - 1)

  3. COption (c)

    N(N - 1)/2

  4. DOption (d)

    (N - 1)2

View answer & explanation

Correct answer

Answer: (c)C.

N(N - 1)/2

Why this answer is correct

Concept:

In a symmetric key cryptographic system, both parties have access to the key. So, the first person has N-1 keys with other N-1 people, the second one has another N-2 with N-2 people (since 1 is already considered) and so on till 1.

Formula

∑i=1i=n=n(n+1)2\sum_{i =1}^{i=n} =\frac{n(n+1)}{2}

Calculation

Total number of keys required = 1 + 2 + 3 + … + (N – 2) + (N – 1)

where n = N – 1  

∑i=1i=N−1=N−1((N−1)+1)2=N(N−1)2\sum_{i =1}^{i=N-1}=\frac{N -1((N -1) +1)}{2} = \frac{N(N-1)}{2}

Question 20

Which of the following statement/s is/are true?

(i) Firewall can screen traffic going into or out of an organization.

(ii) Virtual private networks can simulate an old leased network to provide certain desirable properties.

Choose the correct answer from the code given below:

  1. AOption (a)

    (i) only

  2. BOption (b)

    Neither (i) nor (ii)

  3. COption (c)

    Both (i) and (ii)

  4. DOption (d)

    (ii) only

View answer & explanation

Correct answer

Answer: (c)C.

Both (i) and (ii)

Why this answer is correct

Statement I: TRUE

Firewall is a device installed between the internal network of an organization and rest of the internet. It is designed to forward some packets and filter others.

It screens traffic going into or out of an organization. It filters all incoming packets destined for a specific host. It is a packet filter firewall or proxy-based firewall.

Statement II: TRUE

Virtual private network uses the global internet for both intra and inter-organization communication but require privacy in their internal communication.

It allows sharing of resource and privacy both at the same time. It can simulate an old leased network to provide certain desirable properties.

Question 21

Consider the following statements related to AND-OR Search algorithm.

S​1​: A solution is a subtree that has a goal node at every leaf.

S​2​: OR nodes are analogous to the branching in a deterministic environment

S​3​: AND nodes are analogous to the branching in a non-deterministic environment.

Which one of the following is true referencing the above statements?

Choose the correct answer from the code given below:

  1. AOption (a)

    S1- False, S2- True, S3- True

  2. BOption (b)

    S1- True, S2- True, S3- True

  3. COption (c)

    S1- False, S2- True, S3- False

  4. DOption (d)

    S1- True, S2- True, S3- False

View answer & explanation

Correct answer

Answer: (b)B.

S1- True, S2- True, S3- True

Why this answer is correct

AND- OR search algorithm:

AND OR search algorithm is different from other algorithms in the way that it finds goal node at each state in order to reach the final goal state. It works in non-deterministic environment.

And OR search algorithm works in the following way:

  1. It has to find a solution tree of subtrees.

  2. Solution tree contains the root of the subtrees.

  3. If a non-terminal AND node is in subtree and solution tree then all its children are in solution tree.

  4. If a non-terminal OR node is in subtree and solution tree then exactly one of its children are in solution tree.

AND OR search tree may contain nodes that root identical subtrees (sub problems with identical optimal solutions) which can be unified. When unifiable nodes are merged, search tree becomes a graph and its size becomes smaller.

Question 22

Which homogeneous 2D matrix transforms the figure (a) on the left side to the figure (b) on the right?

  1. AOption (a)

    \(\left[ {\begin{array}{*{20}{c}} 1&{ - 2}&6\ 1&0&2\ 0&0&1 \end{array}} \right]\)

  2. BOption (b)

    \(\left[ {\begin{array}{*{20}{c}} 0&{ - 2}&6\ 1&0&1\ 0&0&1 \end{array}} \right]\)

  3. COption (c)

    \(\left[ {\begin{array}{*{20}{c}} 0&2&6\ 1&0&1\ 0&0&1 \end{array}} \right]\)

  4. DOption (d)

    \(\left[ {\begin{array}{*{20}{c}} 0&2&{ - 6}\ 2&0&1\ 0&0&1 \end{array}} \right]\)

View answer & explanation

Correct answer

Answer: (b)B.

\(\left[ {\begin{array}{*{20}{c}} 0&{ - 2}&6\ 1&0&1\ 0&0&1 \end{array}} \right]\)

Why this answer is correct

To transform figure on left side into figure on right side, two things must be done in this.

  1. It requires anticlockwise rotation by 90 degree.

  2. It requires translation along x-axis and y-axis.

In case of 2-D, rotation is done by:

\(P = ;\left[ {\begin{array}{*{20}{c}} {\cos \theta }&{ - ;sin\theta }\ {sin\theta }&{cos\theta } \end{array}} \right]\)

In case of 3-D rotation, also rotation is with respect to 2 on y-axis

\(P = ;\left[ {\begin{array}{{20}{c}} {\cos 90}&{ - sin90}&0\ {sin90}&{cos90}&0\ 0&0&1 \end{array}} \right] = ;\left[ {\begin{array}{{20}{c}} 0&{ - 1}&0\ 1&0&0\ 0&0&1 \end{array}} \right]\)

So, final matrix after rotation = \(\left[ {\begin{array}{*{20}{c}} 1&{ - 2}&0\ 1&0&0\ 0&0&1 \end{array}} \right]\)

Next step is translation, along x-axis translation factor is 6 units and along y- axis translation factor is 1 unit.

Translation matrix = \(\left[ {\begin{array}{*{20}{c}} 1&0&{tx}\ 0&1&{ty}\ 0&0&1 \end{array}} \right]\)

By putting tx = 6 and ty = 1

Final matrix will be = \(\left[ {\begin{array}{{20}{c}} 1&{ - 2}&{tx}\ 1&0&{ty}\ 0&0&1 \end{array}} \right] = \left[ {\begin{array}{{20}{c}} 0&{ - 2}&6\ 1&0&1\ 0&0&1 \end{array}} \right]\)

Question 23

Which of the following is true for ​semi-dynamic environment?

  1. AOption (a)

    The environment itself does not change with the passage of time but the agent’s performance score does.

  2. BOption (b)

    The environment changes while the agent is deliberating.

  3. COption (c)

    Even if the environment changes with the passage of time while deliberating, the performance score does not change.

  4. DOption (d)

    Environment and performance score, both changes simultaneously.

View answer & explanation

Correct answer

Answer: (a)A.

The environment itself does not change with the passage of time but the agent’s performance score does.

Why this answer is correct

Concept:

Agent: An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators. Example: human agents, robotic agents etc.

Agent is also equal to architecture and program combination.

Explanation:

Factors that are considered in agents are its performance measure, environment, actuators, sensors.

  • Performance: safe, fast, legal, maximize profits.
  • Environment: Roads, pedestrians, customers
  • Actuators: steering wheel, accelerator, brake.
  • Sensors: Cameras, speedometer, GPS, keyboard.

Environment types: fully observable, deterministic, static, dynamic, single agent, semi dynamic.

  • Fully observable: It means to check everything is available to it via its sensors.
  • Deterministic: It depends only on current state and agent’s action.
  • Static: agent is deliberating over what to do
  • Dynamic: agent should consult the world when choosing actions

Semi-dynamic: If the environment itself does not change with the passage of time but the agent’s performance does.

Question 24

Which of the following statements is/are true?

P: Software Reengineering is preferable for software products having high failure rates, having poor design and/or having poor code structure

Q: Software Reverse Engineering is the process of analyzing software with the objective of recovering its design and requirement specification.

  1. AOption (a)

    P only

  2. BOption (b)

    Neither P nor Q

  3. COption (c)

    Q only

  4. DOption (d)

    Both P and Q

View answer & explanation

Correct answer

Answer: (d)D.

Both P and Q

Why this answer is correct

P: Software Reengineering is preferable for software products having high failure rates, having poor design and/or having poor code structure

This statement is correct. Reengineering is the examination, analysis, and alteration of an existing software system to reconstitute it in a new form and the subsequent implementation of the new form. This process encompasses a combination of other processes such as reverse engineering, reverse documentation, restructuring, translation and forward engineering. Software reengineering is preferable for software products having high failure rates, having poor design and having poor code structure.

Q: Software Reverse Engineering is the process of analyzing software with the objective of recovering its design and requirement specification.

This statement is correct. Software reverse engineering is the process of analysing software with the objective of recovering its design and requirement specification. In reverse engineering, it starts from implementation, then design phase, then analysis phase and then requirements phase.

Question 25

Software coupling involves dependencies among pieces of software called modules. Which of the following are correct statements with respect to module coupling?

P: Common Coupling occurs when two modules share the same global data

Q: control Coupling occur when modules share a composite data structure and use only part of it.

R: Content coupling occurs when one module modifies or relies on the internal working of another module.

  1. AOption (a)

    P and Q only

  2. BOption (b)

    P and R only

  3. COption (c)

    Q and R only

  4. DOption (d)

    All of P, Q and R

View answer & explanation

Correct answer

Answer: (b)B.

P and R only

Why this answer is correct

Concept:

Coupling: It means interaction between components. It is the degree of interdependence between software modules.

Explanation:

Types of coupling are common coupling, control coupling, content coupling, data coupling, stamp coupling.

  • Common coupling: It occurs when two modules share the same global data. It is the most undesirable because if we wish to change the shared data, all the procedures accessing this shared data will need to be modified.
  • Content coupling: It occurs when one module modifies or relies on the internal working of another module.
  • Control coupling: When modules communicate by passing control information. In this one module decides the function of other module or changes its flow of execution.

Question 26

The third-generation mobile phone are digital and based on

  1. AOption (a)

    AMPS

  2. BOption (b)

    Broadband CDMA

  3. COption (c)

    CDMA

  4. DOption (d)

    D-AMPS

View answer & explanation

Correct answer

Answer: (b)B.

Broadband CDMA

Why this answer is correct

There are three generations in cellular telephony.

  • First Generation: It was designed for voice communication using analog signals. Example: AMPS (Advanced mobile phone system) is one of the leading analog cellular system. It uses FDMA to separate channels in a link. AMPS operates in the ISM 800 MHz band.
  • Second Generation: To provide higher quality mobile voice communication, these generation of cellular phone are required. These are used for digital voice communication. Example: D- AMPS, CDMA, GSM. The product of evolution of analog AMPS into a digital system is digital AMPS. D-AMPS uses TDMA and FDMA. GSM stands for global system for mobile communication. It provides duplex communication by using two digital bands.
  • Third generation: It refers to a combination of technologies that provide a variety of services. It can provide both digital data and voice communication. Main goal of third generation cellular telephony is to provide universal personal communication. These are based on broadband CDMA. Example: IMT-DS, IMT-MC etc

Question 27

Consider the following two languages:

L​1​ = {x | for some y with |y| = 2|x|, xy∈ L and L is regular language}

L​2​ = {x | for some y such that |x| = |y|, xy∈ L and L is regular language}

Which one of the following is correct?

  1. AOption (a)

    Both L​1​ and L​2​ are regular languages

  2. BOption (b)

    Both L1​ and L2​ are not regular languages

  3. COption (c)

    Only L​1​ is regular language

  4. DOption (d)

    Only L2​ is regular language

View answer & explanation

Correct answer

Answer: (a)A.

Both L​1​ and L​2​ are regular languages

Why this answer is correct

Answer: Option 1

Explanation:

If y = 8 and |y| = 2|x| then |x| = 3 since it finite it will be finite automaton.

If y = 8 and |y| = |x| then |x| = 8 since it finite it will be finite automaton.

Statement says for some y and hence L​1​ and L2 both are accepted by finite automata. Therefore, they are regular language

Question 28

The Software Requirement Specification (SRS) is said to be ______ if and only if no subset of individual requirements described in it conflict with each other.

  1. AOption (a)

    Correct

  2. BOption (b)

    Consistent

  3. COption (c)

    Unambiguous

  4. DOption (d)

    Verifiable

View answer & explanation

Correct answer

Answer: (b)B.

Consistent

Why this answer is correct

Concept:

Software requirement specification (SRS) is the starting point of the software development activity. Requirement specification phase consists of two basic activities: problem or requirement analysis and requirement specification.

Explanation:

In problem or requirement analysis, it deals with understanding of problem, goals and constraints. In second, the focus is on clearly specifying what has been found during analysis. Issues such as representation, specification languages and tools and checking the specification are addressed during this activity. Requirement phase terminated with the production of validate software requirement specification document.

Main purpose of SRS:

  • To bridge the communication gap. It is the medium through which clinet and user needs are accurately specified.
  • It forms the basis of software development.
  • Helping the clients to understand their own needs.

The Software Requirement Specification (SRS) is said to be consistent if and only if no subset of individual requirements described in it conflict with each other.

Question 29

If the frame buffer has 10-bits per pixel and 8-bits are allocated for each of the R, G and B components then what would be the size of the color lookup table (LUT)

  1. AOption (a)

    (2​10​ + 2​11) bytes

  2. BOption (b)

    (210​ + 2​8) bytes

  3. COption (c)

    (210​ + 224) bytes

  4. DOption (d)

    (28​ + 2​9) bytes

View answer & explanation

Correct answer

Answer: (a)A.

(2​10​ + 2​11) bytes

Why this answer is correct

Frame buffer has 10 bits per pixel and 8 bits are allocated for each R, G and B components.

As frame buffer has 10 bits. So, entries in color lookup table = 210

8 bits for each component. Collectively 24 bits for all three components.

It means 24/8 = 3 bytes are for R, G and B component collectively.

Size of color look up table = number of entries in look up table × size of each entry

Size of look up table = 210 × 3 = 3072 = (210 + 211) Bytes

Question 30

Which of the following HTML5 codes will affect the horizontal as well as vertical alignment of the table content?

  1. AOption (a)

    < td halign = " middle" valign = " center" > BASH < / td >

  2. BOption (b)

    < td style = " text − align : center; vertical − align : middle; " > BASH < / td >

  3. COption (c)

    < td align = "middle" valign = " center" > BASH < / td >

  4. DOption (d)

    < td style = " horizontal − align: center; vertical − align : middle; " > BASH < / td >

View answer & explanation

Correct answer

Answer: (b)B.

< td style = " text − align : center; vertical − align : middle; " > BASH < / td >

Why this answer is correct

< td style = " text − align : center; vertical − align : middle; " > BASH < / td >

The above code of the following HTML5 codes will affect the horizontal as well as vertical alignment of the table content because:

  • The text-align-align property determines the horizontal alignment of the content in or, such as left, right, or center.
  • The vertical-align-align attribute determines the vertical alignment (such as top, bottom, or center) of the content in or.

Question 31

Consider the following terminology and match List 1 and List 2 and choose the correct answer from the code given below

b = branch factor

d = depth of shallowest solution

M = Maximum depth of the search tree

I = depth limit

List 1List 2
a) BFSi) O(bd)
b) DFSii) O(bd)
c) Depth – Limited Searchiii) O(bm)
d) Iterative deepening Searchiv) O(bl)
  1. AOption (a)

    a-iii, b-ii, c-iv, d-i

  2. BOption (b)

    a-ii, b-iii, c-iv, d-i

  3. COption (c)

    a-i, b-ii, c-iv, d-iii

  4. DOption (d)

    a-i, b-iii, c-iv, d-ii

View answer & explanation

Correct answer

Answer: (b)B.

a-ii, b-iii, c-iv, d-i

Why this answer is correct

BFS:

Breadth first search in artificial intelligence is implemented as FIFO. Path is find out by considering the number of edges in that path. Start from the root node, it considers all the nodes. But at the end, selects the path having lowest number of edges. If b is the branching factor and d is the depth. Then overall cost of BFS is O(bd).

DFS:

It is based on the concept of LIFO as that of stack procedure. It considers the nodes one by one from root node to the leaf as a single path. If it does not terminate it can go to the infinity. If b is the branching factor and m is the depth. Then cost of DFS is O(bm).

Depth – Limited Search

In this, depth is specified first, and all the nodes are traversed till that depth then it goes on to next level. If b is the branching factor. Then overall cost of depth limited search is O(bl).

Iterative – deepening search:

It starts from root node i.e. depth 1, expands all the nodes and then goes on to the depth 2, expand all the nodes of that depth. In this way, it expands all the nodes. If b is the branching factor and d is the depth, then overall cost is O(bd).

Question 32

Data warehouse contains ______ data that is never found in operational environment.

  1. AOption (a)

    Scripted

  2. BOption (b)

    Encoded

  3. COption (c)

    Encrypted

  4. DOption (d)

    Summary

View answer & explanation

Correct answer

Answer: (d)D.

Summary

Why this answer is correct

Data warehousing:

It is a phenomenon that grew from huge amount of electronic data stored in recent years and from the urgent need to use that data to accomplish goals that go beyond the routine tasks linked to daily processing. Data warehousing is used in various applications such as: Trade, craftsmanship, financial services, transport industry, telecommunication etc.

Data warehouse architecture contains following points:

  • Source system
  • Source data transport layer
  • Data quality control and profiling layer
  • Metadata management layer
  • Data integration layer
  • Data processing layer
  • End user reporting layer

Developing a data warehouse is no different from any other project. It requires complete planning, requirements, design, implementation. Data warehouse contains summary data that is not found in operational environment. Developing strategy of data warehouse is to establish virtual data warehouse. It is simply to build a copy of operational data from a single operational system and enable the data warehouse from a series of information access tools.

Diagram:

Question 33

Consider ISO-OSI network architecture reference model. Session layer of this model offer Dialog control, token management and ______ as services.

  1. AOption (a)

    Synchronization

  2. BOption (b)

    Asynchronization

  3. COption (c)

    Errors

  4. DOption (d)

    Flow control

View answer & explanation

Correct answer

Answer: (a)A.

Synchronization

Why this answer is correct

In ISO-OSI architecture, there are seven layers in this model. Starting from physical layer (layer 1), then data link layer, network layer, transport layer, session layer, presentation layer, application layer (layer - 7) respectively.

In this layer our main focus is on work of session layer.

Session layer:

Session layer is the network dialog controller. It establishes, maintains and synchronizes the interaction among communicating system. It is responsible for dialog control, token management and synchronization in the network.

  • Dialog control: Session layer allows two systems to enter into a dialog. It allows the communication between two processes to take place in either half-duplex or full – duplex.
  • Synchronization: It allows a process to add checkpoints to a stream of data.
  • Token management: It prevents two parties from attempting the same critical operation at the same time

Question 34

Which of the following statements is/are ​false?

P: The clean-room strategy to software engineering is based on the incremental software process model.

Q: The clean-room strategy to software engineering is one of the ways to overcome “unconscious” copying of copyrighted code.

Choose the correct answer from the code given below:

  1. AOption (a)

    Neither P and Q

  2. BOption (b)

    P only

  3. COption (c)

    Both P and Q

  4. DOption (d)

    Q only

View answer & explanation

Correct answer

Answer: (a)A.

Neither P and Q

Why this answer is correct

Clean room software engineering model is an incremental software paradigm for the development of zero defect and high reliability software using box structure specification, statistical quality control and certification.

It is a practical development and certification approach that uses statistical quality control to reduce software defects, to overcome unconscious copying of copyrighted code.

Characteristics of cleanroom software engineering approach:

  • Incremental development process model
  • Formal methods for specification and design
  • Correctness verification
  • Statistically based, independent testing

The development life cycle starts with a specification that not only defines function and performance requirements but also identifies operational usage of software and nested sequence of user function subsets that can be developed and tested as increments which accumulate into the final system.

Question 35

Consider the following pseudo-code fragment, where m is a non-negative integer that has been initialized:

p=0;

k=0;

while(k < m)

        p = p + 2k;

        k=k+1;

end while

Which of the following is a loop invariant for the while statement?

(Note: a loop variant for a while statement is an assertion that is true each time guard is evaluated during the execution of the while statement).

  1. AOption (a)

    p = 2k - 1 and 0≤k < m

  2. BOption (b)

    p = 2k+1 - 1 and 0≤k < m

  3. COption (c)

    p = 2k-1 and 0≤k≤m

  4. DOption (d)

    p = 2k+1 - 1 and 0≤k≤m

View answer & explanation

Correct answer

Answer: (b)B.

p = 2k+1 - 1 and 0≤k < m

Why this answer is correct

Concept:

Loop invariant: It states that a desired property is maintained in the loop. Three parts are in this : implementation (it should be true before the loop runs), it must be true before and after each iteration of the loop and must terminate successfully after execution.

Explanation:

Given in the pseudo code: initially k = 0 and p = 0

After 1st iteration:

For k = 0, p = p + 2k = 0 + 20 = 1

After 2nd iteration:

For k =1, p = 1 + 21 = 3

After 3rd iteration:

For k = 2, p= 3 + 22 = 7

Now , check which option gives same value of p when k = 0, 1 ,2 ,3….

Option 1: incorrect

p = 2k - 1 and 0≤k < m

When k = 0, p = 20 - 1 = 0

Option 2: correct

p = 2k+1 - 1 and 0≤k < m          

When k = 0, p = 20+1 – 1 = 1          

When k = 1, p = 21+1 – 1 = 3

When k = 2, p = 22+1 – 1 = 7

Option 3: incorrect

When k = 0, p = 20-1 = 0.5         

Option 4: incorrect

It is also giving same values, but it is not true in the case as k<=m in that, which should be k<m.

Question 36

The K-coloring of an undirected graph G = (V, E) is a function C: V ➝ {0, 1, ......, K-1} such that c(u) ≠ c(v) for every edge (u, v) ∈ E Which of the following is not correct?

  1. AOption (a)

    G has no cycles of odd length

  2. BOption (b)

    G has cycle of odd length

  3. COption (c)

    G is 2-colorable

  4. DOption (d)

    G is bipartite

View answer & explanation

Correct answer

Answer: (b)B.

G has cycle of odd length

Why this answer is correct

A k- coloring of a graph G is mapping f: V(G) -> {set of k elements called colors}, such that adjacent vertices are mapped onto different elements.

A graph is called k – colourable, if it has a k-coloring. A k-coloring of a graph G(V, E) is a partitioning V = V1 U V2 U V3 ………… U Vk into at most k independent sets of G.

Properties of K- colourable graph are:

  1. A cycle of length n>=3 is – chromatic if n is even and 3- chromatic if n is odd

  2. A graph is bi- colourable (2- chromatic) if and only if it has no odd cycles.

  3. A non - empty graph G is bi colourable if and only if G is bipartite.

Question 37

Consider the following statements

S1:​ A heuristic is admissible if it never overestimates the cost to reach the goal

S2: ​A heuristic is monotonous if it follows triangle inequality property.

Which one of the following is true referencing the above statements?

  1. AOption (a)

    Statement S1 is true but statement S2 is false.

  2. BOption (b)

    Statement S1 is false but statement S2 is true.

  3. COption (c)

    Neither of the statements S1 and S2 are true

  4. DOption (d)

    Both the statements S1 and S2 are true.

View answer & explanation

Correct answer

Answer: (d)D.

Both the statements S1 and S2 are true.

Why this answer is correct

S1: ​A heuristic is admissible if it never overestimates the cost to reach the goal        [correct]

A heuristic search carries the additional knowledge about the problem which helps in reaching the goal. A heuristic function is considered for finding the cost of the path. Cost is estimated if there is a path from a given node to goal node. When it reaches goal state, then at that instant cost will be zero. Heuristic search is admissible if it never overestimates the cost to reach the goal.

S2: ​A heuristic is monotonous if it follows triangle inequality property.              [Correct]

Heuristic search is a minimum cost solution to find the best path for a problem. A heuristic search is monotonous if it follows triangle inequality property. First, we visit a node to find an optimal path to it.  Triangle inequality problem: h(n1) <= c (n1 -> n2) + h(n2).

Question 38

Consider the following problems:

(i) Whether a finite automaton halts on all inputs?

(ii) Whether a given Context Free Language is Regular?

(iii) Whether a Turing Machine computes the product of two numbers?

Which one of the following is correct?

  1. AOption (a)

    Only (ii) and (iii) are undecidable problems

  2. BOption (b)

    (i), (ii) and (iii) are undecidable problems

  3. COption (c)

    Only (i) and (ii) are undecidable problems

  4. DOption (d)

    Only (i) and (iii) are undecidable problems

View answer & explanation

Correct answer

Answer: (a)A.

Only (ii) and (iii) are undecidable problems

Why this answer is correct

Statement i: Decidable

A language is decidable when there is a machine which halts for every string in that language and goes to non-final state for string not in the language. A finite automaton is a special case of a Turing machine which halts on all inputs that are in the language, so it is decidable.

Statement ii: Undecidable

Regular property of context free languages is undecidable.  This can be proved by taking regular language as Σ*. Assume both G and R as part of input problem. For any family of languages, whether it is equal to other language is decidable if both L1 and L2 are subset of each other.

Statement iii: Undecidable

Turing machine is for recursive enumerable languages (for type 0 problems). Type 0 problems are undecidable. If we do not know about the Turing machine, it could possible that result for any two numbers will go into infinite loop and never halt. If it happens, then problem is undecidable.

Question 39

Consider the following two statements:

S1: TCP handles both congestion and flow control

S2: UDP handles congestion but not flow control

Which of the following option is correct with respect to the above statements (S1) and (S2)?

  1. AOption (a)

    Both S1 and S2 are correct

  2. BOption (b)

    Neither S1 nor S2 is correct

  3. COption (c)

    S1 is not correct but S2 is correct

  4. DOption (d)

    S1 is correct but S2 is not correct

View answer & explanation

Correct answer

Answer: (d)D.

S1 is correct but S2 is not correct

Why this answer is correct

S1: TCP handles both congestion and flow control          [Correct]

  • TCP (Transmission control protocol) is a connection oriented reliable transport protocol. It provides process to process communications using port numbers.
  • It provides services like flow control, error control, congestion control. A packet that is sent is known as segment in TCP.
  • In TCP, transmission requires three phases: connection establishment, data transfer and connection termination. It uses three way handshaking mechanism for connection establishment and termination.

S2: UDP handles congestion but not flow control       [incorrect]

  • UDP (User datagram protocol) is called a connectionless, unreliable transport protocol.
  • It does not add anything to the services of IP except providing process to process communication.
  • There is no flow control, error control and congestion control mechanism in UDP. To send a message from one process to another,
  • UDP protocol encapsulates and decapsulates messages in an IP datagram.

Question 40

Match the following secret key algorithm (List 1) with the corresponding key lengths (List 2) and choose the correct answer from the code given below,

List 1List 2
a) Blow Fishi) 128-256 bits
b) DESii) 128 bits
c) IDEAiii) 1 – 448 bits
d) RC5iv) 56 bits
  1. AOption (a)

    (a)-(ii), (b)-(iii), (c)- (iv), (d)-(i)

  2. BOption (b)

    (a)-(iv), (b)-(iii), (c)- (ii), (d)-(i)

  3. COption (c)

    (a)-(iii), (b)-(iv), (c)- (ii), (d)-(i)

  4. DOption (d)

    (a)-(iii), (b)-(iv), (c)- (i), (d)-(ii)

View answer & explanation

Correct answer

Answer: (c)C.

(a)-(iii), (b)-(iv), (c)- (ii), (d)-(i)

Why this answer is correct

Blow fish: 

  • Blow fish is a symmetric or private key block cipher.
  • It has a variable key length maximum up to 448 bits.
  • Block size in blow fish mechanism is 64 bits. This algorithm is divided into parts: key expansion, data encryption and data decryption.
  • It is fast than other algorithms. It simply uses addition, XOR, look up table with 32- bit operands. It requires less memory to run.

DES:

  • It stands for data encryption standard.
  • It is a symmetric key block cipher to encrypt the data.
  • It operates on a 64 bit of plain text and uses a key of 56 bits. 48 bits of key is used in each round of DES.
  • It divides the process in 16 rounds with an initial permutation and final permutation. 8 substitution boxes are uses in which each s-box map 6 bits to 4 bits.
  • Permutation box is used. Then a final permutation is applied from right to left to yield cipher text.

IDEA:

  • It stands for international data encryption algorithm. It is also a symmetric key block cipher.
  • It takes 64 bits blocks as input and uses 128 bit key to encrypt the data. This algorithm runs eight and a half round for encrypting the data. It avoids substitution boxes and table lookups used in the block ciphers. It uses various key sub blocks and operates in XOR which is used for addition and subtraction purpose. It is divided into four parts each of which is divided into 16 bits.

RC5:

In RC5, number of keys are not of fixed size (all can be of variable length). Also, plain text can be of 32, 64 or 128 bits. Number of rounds are in between 0 – 255. Also, key size can be in between 0 to 255 bits or 1 to256 bits.

Question 41

If a graph (G) has no loops or parallel edges and if the number of vertices(n) in the graph is n≥3, then the graph G is Hamiltonian if

(i) deg(v) ≥n/3 for each vertex v

(ii) deg(v) + deg(w) ≥ n whenever v and w are not connected by an edge.

(iii) E (G) ≥ 1/3 (n - 1)(n - 2) + 2

  1. AOption (a)

    (i) and (iii) only

  2. BOption (b)

    (ii) and (iii) only

  3. COption (c)

    (iii) only

  4. DOption (d)

    (ii) only

View answer & explanation

Correct answer

Answer: (d)D.

(ii) only

Why this answer is correct

Hamiltonian graph:

A Hamiltonian graph is one which contain a Hamiltonian cycle. A Hamiltonian cycle is a cycle in which each vertex is visited exactly once.

Properties of Hamiltonian graph:

  1. A graph has a Hamiltonian circuit if each vertex has degree >=3

  2. If G= (V, E) has n>=3 vertices and every vertex has degree >=n/2, then G has a Hamilton circuit

  3. If G is a graph with n vertices and n>=3, also deg(u) + deg(v) >=n, if u and v are not connected by an edge, then G has a hamiltonion circuit.

  4. E(G) = ½(n - 1)(n - 2) + 2

Question 42

Match each UML diagram in List 1 with appropriate description in List 2

List 1List 2
a) State Diagrami) Describe how the external entities (people, devices) can interact with the system
b) Use case diagramii) Used to describe the static or structural view of a system.
c) Class diagramiii) Used to show the flow of a business process, the steps of a use case or the logic of an object behaviour
D) Activity diagramiv) Used to describe the dynamic behaviour of objects and could also be used to describe the entire system behaviour
  1. AOption (a)

    (a)-(i), (b)-(iv), (c) -(iii), (d)-(ii)

  2. BOption (b)

    (a)-(iv), (b)-(ii), (c) -(i), (d)-(iii)

  3. COption (c)

    (a)-(iv), (b)-(i), (c) -(ii), (d)-(iii)

  4. DOption (d)

    (a)-(i), (b)-(iv), (c) -(ii), (d)-(iii)

View answer & explanation

Correct answer

Answer: (c)C.

(a)-(iv), (b)-(i), (c) -(ii), (d)-(iii)

Why this answer is correct

State diagram:

State diagram is a behavioural model which contains states, actions and transition between states. They are used in object oriented modelling. It tell about the states that an object can visit. It is used to describe the dynamic behaviour of objects and could also be used to describe the entire system behaviour.

Use case diagram:  

It displays the relationship among actors and use cases. It describes how external entities interact with the system. A use case is a set of scenarios that describes an interaction between a user and system. Two main components in use case diagram are actor and usecase.

Class diagram:

It describes the structure of a system by showing the system’s classes, their attributes and the relationship among classes. It is used to describe the structural view of the system. It also displays relationships such as containment, inheritance, associations and others.

Activity diagram:

It displays a special state diagram where most of the states are action states and most of the transitions are triggered by completion of the actions in the source states. It is used to show the flow of business process or the logic of an object behaviour.

Question 43

Consider the C/C++ function f() given below:

void f(char w [ ] )

{

int x = strlen(w); //length of a string

char c;

for(int i = 0; i < x; i++)

{

c = w[i];

w[i] = w[x - i - 1];

w[x - i - 1] = c;

}

}

Which of the following is the purpose of f()?

  1. AOption (a)

    It output the content of the array with the characters rearranged so they are no longer recognized a the words in the original phrase.

  2. BOption (b)

    It output the contents of the array with the characters shifted over by one position.

  3. COption (c)

    It outputs the contents of the array in the original order.

  4. DOption (d)

    It outputs the contents of the array in the reverse order.

View answer & explanation

Correct answer

Answer: (c)C.

It outputs the contents of the array in the original order.

Why this answer is correct

Suppose we have a string:  w = “TESTBOOK”

Length of the string = 9              // including null string in array w

int x = strlen(w);                                  // x= 9

this string is in the form of an array w.

where w[0]= T, w[1] = E, w[2] = S, w[3] = T, w[4] = B, w[5] = O, w[6] = O, w[7]= K, w[8]= null string

Iteration 1:

For (int i = 0; i < x; i++)                // condition becomes true as, 0< 8

c = w[i];                                        // c = w[0] = T

w[i] = w[x - i - 1];                        // w[0] = w[8-0-1]= w[7] = K

w[x - i - 1] = c;                            // w[8- 0 -1 ] = w[7] = T

Iteration 2:

For (int i = 0; i < x; i++)                // condition becomes true as, 1< 8

c = w[i];                                        // c = w[1] = E

w[i] = w[x - i - 1];                        // w[1] = w[8-1-1]= w[6] = O

w[x - i - 1] = c;                            // w[8- 1 -1 ] = w[6] = E

Iteration 3:

For (int i = 0; i < x; i++)                // condition becomes true as, 2< 8

c = w[i];                                        // c = w[2] = S

w[i] = w[x - i - 1];                        // w[2] = w[8-2-1]= w[5] = O

w[x - i - 1] = c;                            // w[8- 2 -1 ] = w[5] = S

Iteration 4:

For (int i = 0; i < x; i++)                // condition becomes true as, 3< 8

c = w[i];                                        // c = w[3] = T

w[i] = w[x - i - 1];                        // w[3] = w[8-3-1]= w[4] = B

w[x - i - 1] = c;                            // w[8- 3 -1 ] = w[4] = T

After this array becomes:

w[0]= K, w[1] = O, w[2] = O, w[3] = B, w[4] = T, w[5] = S, w[6] = E, w[7]= T, w[8]= null string

Iteration 5:

For (int i = 0; i < x; i++)                // condition becomes true as, 4< 8

c = w[i];                                        // c = w[4] = T

w[i] = w[x - i - 1];                        // w[4] = w[8-4-1]= w[3] = B

w[x - i - 1] = c;                            // w[8- 4 -1 ] = w[3] = T

Iteration 6:

For (int i = 0; i < x; i++)                // condition becomes true as, 5< 8

c = w[i];                                        // c = w[5] = S

w[i] = w[x - i - 1];                        // w[5] = w[8-5-1]= w[2] = O

w[x - i - 1] = c;                            // w[8- 5 -1 ] = w[2]= S

Iteration 7:

For (int i = 0; i < x; i++)                // condition becomes true as, 6< 8

c = w[i];                                        // c = w[6] = E

w[i] = w[x - i - 1];                        // w[6] = w[8-6-1]= w[1] = O

w[x - i - 1] = c;                            // w[8- 6 -1 ] = w[1]= E

Iteration 8:

For (int i = 0; i < x; i++)                // condition becomes true as, 7< 8

c = w[i];                                        // c = w[7] = T

w[i] = w[x - i - 1];                        // w[7] = w[8-7-1]= w[0] = K

w[x - i - 1] = c;                            // w[8- 7 -1 ] = w[0]= T

After this final array will be:

w[0]= T, w[1] = E, w[2] = S, w[3] = T, w[4] = B, w[5] = O, w[6] = O, w[7]= K, w[8]= null string

So, it outputs the content of the array in original order.

Question 44

Data Scrubbing is

  1. AOption (a)

    A process to upgrade the quality of data after it is moved into a data warehouse

  2. BOption (b)

    A process to upgrade the quality of data before it is moved into a data warehouse

  3. COption (c)

    A process to lead the data in the warehouse and to create the necessary indexes

  4. DOption (d)

    A process to reject data from the data warehouse and to create necessary indexes

View answer & explanation

Correct answer

Answer: (b)B.

A process to upgrade the quality of data before it is moved into a data warehouse

Why this answer is correct

DATA SCRUBBING:

  • Data scrubbing also known as data cleansing deals with detecting and removing errors and inconsistencies from data in order to improve the quality of data.
  • Data quality problems are present in single data collections such as files and databases. It is a process to upgrade the quality of data before it is moved into a database warehouse.
  • No matter how data are collected there will be some level of error in that. Error prevention methods can reduce the errors but cannot eliminate them.

Data scrubbing process:

  1. It involves repeated cycles of screening, diagnosing, treatment and documentation of this process.
  2. As patterns of errors are identified, data collection and entity procedures should be adapted to correct those patterns and reduce future errors.

Steps that are involved in this process are:

a) Screening:

It involves systematically looking for suspect features in assessment questionnaires, databases.

b) Diagnosis: 

It identifies the nature of defective data Treatment: It means deleting, editing or leaving the data as it is. It requires an in-depth understanding of all types and sources of errors possible during data collection and entry processes.

c) Documenting:

It changes entails leaving an adult trail of errors detected, alterations, additions and error checking and will allow a return to the original value if required.

Question 45

In mathematical logic, which of the following are statements?

(i) There will be snow in January

(ii) What is the time now?

(iii) Today is Sunday

(iv) You must study Discrete Mathematics.

  1. AOption (a)

    (iii) and (iv)

  2. BOption (b)

    (i) and (ii)

  3. COption (c)

    (i) and (iii)

  4. DOption (d)

    (ii) and (iv)

View answer & explanation

Correct answer

Answer: (c)C.

(i) and (iii)

Why this answer is correct

Concept:

In mathematical logic, a statement is a sentence which is either true or false. It may contain words or symbols. In general, it has two parts: 1) assumption 2) conclusion.

A mathematical sentence is a sentence that states a fact and it becomes statement when it results in either true or false.

Explanation:

Statement (i): There will be snow in January

It is a mathematical statement because either there will be snow in January or there will not be snow in January. It has only two possible values either true or false.

Statement (ii): What is the time now?

In this case, there is no meaning of true or false. It is only asking the current time and you can answer that but not in true or false.

Statement (iii): Today is Sunday

It is a statement. As, it is true of Sunday and false on any other day. So, there are two possibilities of either true or false.

Statement (iv): You must study Discrete Mathematics.

It is not a statement. It is not giving meaning in true or false sense.

Question 46

Consider the following language:

L1​ = {an+m bn am | n, m ≥ 0}

L2​ = {an+m bn+m an+m |n, m ≥ 0}

Which one of the following is correct?

  1. AOption (a)

    Only L​1​ is Context Free Language

  2. BOption (b)

    Both L1​ and L2​ are not Context Free Language

  3. COption (c)

    Only L​2​ is Context Free Language

  4. DOption (d)

    Both L1​ and L​2​ are Context Free Language

View answer & explanation

Correct answer

Answer: (a)A.

Only L​1​ is Context Free Language

Why this answer is correct

Statement I: Correct

L1​ = {an+m bn am | n, m ≥ 0} = {am an bn am | n, m ≥ 0} 

The above language is accepted by Deterministic Pushdown Automaton (DPDA)and hence it is a context-free language (CFL)

Explanation:

  • Push all the a’s that come as input and when b’s come as input pop “n” number of a’s for “n” b’s from top of the stack
  • When again a’s come as input pop-up all the remaining a’s (“m” number of a’s) from top of the stack for “m” number of a’s coming as input.
<br>

Since we can have a Deterministic Pushdown Automaton (DPDA) for L1​ so we can say L​1​ is a CFL.

Statement II: Incorrect

L2​ = {an+m bn+m an+m |n, m ≥ 0} = {ap bp ap | p ≥ 0} where n + m = p

The above language is not accepted by Pushdown Automaton (PDA)and hence it is a not context-free language (CFL)

Question 47

Identify the correct sequence in which the following packets are transmitted on the network by a host when a browser requests a web page from a remote server, assuming that the host has been restarted.

  1. AOption (a)

    HTTP GET request, DNS query, TCP SYN

  2. BOption (b)

    DNS query, TCP SYN, HTTP GET request

  3. COption (c)

    TCP SYN, DNS query, HTTP GET request

  4. DOption (d)

    DNS query, HTTP Get request, TCP SYN

View answer & explanation

Correct answer

Answer: (b)B.

DNS query, TCP SYN, HTTP GET request

Why this answer is correct

Sequence in which the given packets are transmitted on the network by a host when a browser requests a web page from a remote server.

STEP 1:

DNS query is sent to Domain name server to convert the Domain name into its IP address.

Step 2:

TCP SYN request packet is sent by sender to establish a connection for data transmission.

Step 3:

HTTP GET request is used to request data from a specified IP address.

Question 48

In 3D Graphics, which of the following statements about perspective and parallel projection is/are true?

P:​ In a perspective projection, the farthest an object is from the center of projection, the smaller it appears.

Q: ​ Parallel projection is equivalent to a perspective projection where the viewer is standing infinitely far away

R: ​ Perspective projections do not preserve straight lines.

  1. AOption (a)

    P and R only

  2. BOption (b)

    P, Q and R

  3. COption (c)

    Q and R only

  4. DOption (d)

    P and Q only

View answer & explanation

Correct answer

Answer: (d)D.

P and Q only

Why this answer is correct

  • In perspective projection, objects that are far away appear smaller, and objects that are near appear bigger.
  • A perspective projection of an object is often considered more realistic than a parallel projection, since it more closely resembles human vision and photography
  • Parallel projection is equivalent to a perspective projection where the viewer is standing infinitely far away
  • Perspective projections preserve straight lines.

Question 49

Consider the following tables (relations):

Students:

Roll-NoName
18CS101Ramesh
18CS102Mukesh
18CS103Ramesh

 

Performance:

Roll-NoCourseMarks
18CS101DBMS60
18CS101Compiler Design65
18CS102DBMS80
18CS103DBMS85
18CS102Compiler Design75
18CS103Operating System70

 

Primary keys in the tables are shown using Underline. Now, Consider the following query:

SELECT S.Name, Sum (P.Marks)

FROM Students S, Performance P

WHERE S.Roll-No = P.Roll-No

GROUP BY S.Name

The number of rows returned by the above query is

  1. AOption (a)

    3

  2. BOption (b)

    2

  3. COption (c)

    0

  4. DOption (d)

    1

View answer & explanation

Correct answer

Answer: (b)B.

2

Why this answer is correct

Query: SELECT * FROM Students S, Performance P WHERE S.Roll-No = P.Roll-No

Let R be the output relation of the above query:

R:

Roll-NoNameCourseMarks
18CS101RameshDBMS60
18CS101RameshCompiler Design65
18CS102MukeshDBMS80
18CS102MukeshCompiler Design75
18CS103RameshDBMS85
18CS103RameshOperating System70

 

Query: SELECT S.Name, Sum (P.Marks) FROM R GROUP BY S.Name

Output:

S:

NameMarks
Ramesh280
Mukesh155

 

The number of rows returned by given query are 2.

Question 50

Consider the following boolean equations:

(i). ​wx + w(x + y) + x(x + y) = x+wy

(ii). (wx’(y+xz’)+w’x’)y = x’y

What can you say about the above equations?

  1. AOption (a)

    Both (i) and (ii) are true

  2. BOption (b)

    (i) is true and (ii) is false

  3. COption (c)

    Both (i) and (ii) are false

  4. DOption (d)

    (i) is false and (ii) is true

View answer & explanation

Correct answer

Answer: (a)A.

Both (i) and (ii) are true

Why this answer is correct

Expression i: wx + w(x + y) + x(x + y)=x+wy

 LHS = wx + w(x + y) + x(x + y)

        = wx + wx + wy + x + x.y

        = x(w + w + 1 + y) + wy

        = x + wy  = RHS

Expression ii:  wx’(y+xz’)+w’x’)y = x’y

LHS = (wx’(y+xz’)+w’x’)y

       = (wx’y + wx’xz’ + w’x’)y

       = wx’yy + w’x’y

       = wx'y + wx’y

       = (w + w’)x’y = RHS

Both (i) and (ii) are true

Question 51

Find the boolean expression for the logic circuit shown below:

(1-NAND gate, 2-NOR gate, 3-NOR gate)

  1. AOption (a)

    AB

  2. BOption (b)

    AB̅

  3. COption (c)

    A̅ B̅

  4. DOption (d)

    A̅ B

View answer & explanation

Correct answer

Answer: (a)A.

AB

Why this answer is correct

De Morgan’s’ Law

X+Y‾=Xˉ.Yˉ\overline {X + Y} = \bar X.\bar Y

XY‾=Xˉ+Yˉ\overline {XY} = \bar X + \bar Y

Let P be the output of 1- NAND gate

P=A.B‾{\rm{P}} = \overline {{\rm{A}}.{\rm{B}}}

Let Q be the output of 1- NAND gate

Q=Aˉ+B‾{\rm{Q}} = \overline {\bar A + B}

Y=P+;Q‾=PˉQˉa{\rm{Y}} = \overline {{\rm{P}} + {\rm{;Q}}} = \bar P\bar Qa

Y=;A.B‾;‾.;Aˉ+B‾‾;;{\rm{Y}} = {\rm{;}}\overline {\overline {{\rm{A}}.{\rm{B}}} ;} .;\overline {\overline {\bar A + B} } ;;

Y = (A.B). (A̅ + B)

Y = A.B.A̅  + A.B.B

∵ A.A̅  = 0 and B.B = B

Y = AB

Question 52

The decimal floating-point number -40.1 represented using IEEE-754 32-bit representation and written in hexadecimal form is _____

  1. AOption (a)

    0xC2206000

  2. BOption (b)

    0xC2006666

  3. COption (c)

    0xC2006000

  4. DOption (d)

    0xC2206666

View answer & explanation

Correct answer

Answer: (d)D.

0xC2206666

Why this answer is correct

Concept:

32-bit floating-point representation of a binary number in IEEE- 754 is

Sign (1 bit)Exponent (8 bit)Mantissa bit (23 bits)
<br>

In IEEE-754 format, 32-bit (single precision)

(-1)s × 1.M × 2E – 127

Calculation:

Convert: 40.1 to binary

Step 1: convert 40

240
2200
2100
250
221
210
01 ↑

 

(40)10 = (101000)2

Step 2: convert .1 to binary

0.1 × 2 = 0.2           (0)

0.2 × 2 = 0.4           (0)

0.4 × 0.2 = 0.8        (0)

0.8 × 0.2 = 1.6        (1)

0.6 × 0.2 = 1.2        (1)

0.2 × 0.2 = 0.4        (0)  and so on

Given binary number is

(40.1)10 = (101000.000110011001100…)2

(40.1)10 = 1.0100 0000 1100 1100 … × 25

Signed (1 bit) = 1 (given number is negative)

Exponent (8 bit) = 5 + 127 = 132

∴ Exponent = (132)10 = (1000 0100)2

Mantissa (23 bits ) = 0100 0000 1100 1100 1100 110

Sign (1 bit)Exponent (8 bit)Mantissa bit (23 bits)
11000 01000100 0000 1100 1100 1100 110

 

(1100 0010 0010 0000 0110 0110 0110 0110)2 = (C2206666)16

(C2206666)16 = 0xC2206666

Question 53

________ system call creates new process in Unix.

  1. AOption (a)

    fork

  2. BOption (b)

    fork new

  3. COption (c)

    create

  4. DOption (d)

    create new

View answer & explanation

Correct answer

Answer: (a)A.

fork

Why this answer is correct

Concept:

  • In Unix like operating system, the fork system call is used for creating a new process where a process is a copy of itself, which is called the child process.
  • The fork system call is usually a system call, implemented in the kernel.
  • After a new child process is created, both processes will execute the next instruction following the fork() system call.
  • If n times fork then total number of process create is 2n in which number of child processes created is 2n – 1
<br>

Example:

If 5 times fork system call is called then,

Total number of processes = 25 = 32

Total number of child processes created = 25 - 1 = 31

Question 54

A process residing in main memory and ready and waiting for execution, is kept on

  1. AOption (a)

    Job Queue

  2. BOption (b)

    Execution Queue

  3. COption (c)

    Wait Queue

  4. DOption (d)

    Ready Queue

View answer & explanation

Correct answer

Answer: (d)D.

Ready Queue

Why this answer is correct

Data structure used is Queue, implement using linked list where processes are kept

Type of QueueDescription
Job QueueWhen process enter the system (secondary Memory), it is kept in Job Queue
Ready QueueProcess waiting in system (Main memory) ready to execute is kept in Ready Queue
Device QAnything related to input or output

Question 55

Consider the following minimax game tree search

What will be the value propagated at the root?

  1. AOption (a)

    6

  2. BOption (b)

    3

  3. COption (c)

    5

  4. DOption (d)

    4

View answer & explanation

Correct answer

Answer: (c)C.

5

Why this answer is correct

From the above game tree, it is clear the value propagated at the root is 5.

Question 56

________ command is used to remove a relation from an SQL database.

  1. AOption (a)

    Update table

  2. BOption (b)

    Remove table

  3. COption (c)

    Delete table

  4. DOption (d)

    Drop table

View answer & explanation

Correct answer

Answer: (d)D.

Drop table

Why this answer is correct

Concept:

A database system provides a data-definition language (DDL) to specify the database schema

Example of DDL commands: CREATE, DROP etc.

Explanation:

DROP TABLE command:

The DROP TABLE command is used to drop an existing table in a database.

SYNTAX:

DROP TABLE table_name;

Important Point:

UPDATE command:

The UPDATE command is used to modify the existing records in a table

SYNTAX:

UPDATE table_name

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

WHERE condition;

DELETE command:

The DELETE command is used to delete existing records in a table.

SYNTAX:

DELETE FROM table_name WHERE condition;

Notes

Remove table is not a command in SQL.

Question 57

Consider the language L given by (assume Σ = { 2 } )

L = {2nk | k > 0, and n is non − negative integer number}

The minimum number of states of finite automaton which accept the language L is

  1. AOption (a)

    n

  2. BOption (b)

    n + 1

  3. COption (c)

    2n

  4. DOption (d)

    n(n + 1)/2

View answer & explanation

Correct answer

Answer: (b)B.

n + 1

Why this answer is correct

Given language is : L = {2nk | k > 0, and n is non − negative integer number}

Case 1:

Consider n = 1,

Then k can be 1, 2 ,3,….

Strings possible in this case : {2, 22, 23, 24,…………}

DFA for this:

States possible with n = 1 are 2.

Case 2:

When n = 2

Then k can be 1, 2, 3….

Strings possible in this case : {22, 24, 26, 28,……}

DFA for this:

States possible when n = 2 are 3.

So, in general we are getting n + 1 states in DFA

Question 58

Consider the statements below:

“There is a country that borders both India and Nepal.”

Which of the following represents the above sentence correctly?

  1. AOption (a)

    ∃c Border(Country(c), India ∧ Nepal)

  2. BOption (b)

    ∃c Country(c) ∧ Border(c, India) ∧ Border(c, Nepal)

  3. COption (c)

    [∃c Country(c)] ⇒ [Border(c, India) ∧ Border(c, Nepal)]

  4. DOption (d)

    ∃c Country(c) ⇒ [ Border(c, India) ∧ Border(c, Nepal)]

View answer & explanation

Correct answer

Answer: (b)B.

∃c Country(c) ∧ Border(c, India) ∧ Border(c, Nepal)

Why this answer is correct

c- It represents country

∃c – it means there exists a country

Border(c, India) – it means border between India and c

Border(c, Nepal) – it means border between Nepal and c

Variables are two: India and Nepal

Given statement: “There is a country that borders both India and Nepal.”

AND is true only when Border(c, India) and Border(c, Nepal) is 1.

Country must have border with both India and Nepal. So, and operation supports it.

AND is denoted by ∧ in proposition logic.

Correct option is:

∃c Country(c) ∧ Border(c, India) ∧ Border(c, Nepal)

It means there exists a country c and it borders both India and Nepal.

Question 59

Use Dual Simplex Method to solve the following problem:

Maximize z = -2x​1​ -3x2

subject to:

x1​ + x2​ ≥ 2

2x​1​ + x2​ ≤ 10

x​1​ + x2​ ≤ 8

x​1, x2​ ≥ 0

  1. AOption (a)

    x​1​ = 6, x2​ = 2 and z = -18

  2. BOption (b)

    x1​ = 2, x2​ = 6 and z = -22

  3. COption (c)

    x​1​ = 2, x2​ = 0 and z = -4

  4. DOption (d)

    x1​ = 0, x​2​ = 2 and z = -6

View answer & explanation

Correct answer

Answer: (c)C.

x​1​ = 2, x2​ = 0 and z = -4

Why this answer is correct

Maximize z = -2x1 – 3x2

Check all the options one by one and put the value and find in which we are getting the maximum value which is also satisfying the given equations form.

Option 1: x​1​ = 6, x2​ = 2 and z = -18

Here, z is -18

x1​ + x2​ ≥ 2                      // 6+ 2 ≥ 2 or 8 ≥ 2 [true]

2x​1​ + x2​ ≤ 10                 // 2*6 + 2 <=10 or 10<=10  [true]

x​1​ + x2​ ≤ 8                     // 6 + 2 <=8  or 8<=8     [true]

Also, x1 and x2 are >= 0

Option 2:  x1​ = 2, x2​ = 6 and z = -22

Z = -2x​1​ -3x2             // z = -4 – 18 = -22

x1​ + x2​ ≥ 2                      // 2+ 6 ≥ 2 or 8 ≥ 2 [true]

2x​1​ + x2​ ≤ 10                 // 2*4 + 6 <=10 or 10<=10  [true]

x​1​ + x2​ ≤ 8                     // 2 + 6 <=8  or 8<=8     [true]

Also, x1 and x2 are >= 0

When we check option 3) and option 4), they are also satisfying these conditions. But maximum value of z is in option 3 i.e. -4.

Question 60

Consider the midpoint (or Bresenham) algorithm for rasterizing lines given below:

(1) Input (x1, y1​) and (x2​, y​2)

(2) y = y1

(3) d = f(x1​ + 1, y1​ + ½) // f is the implicit form of a line

(4) for x = x​ 1​ to x​ 2

(5) do

(6) plot(x,y)

(7) if(d<0)

(8) then

(9) y = y + 1

(10) d = d + (y1​ - y2) + (x2​ - x1)

(11) else

(12) d = d + (y1 - y2)

(13) end

(14) end

Which statements are true?

P: For a line with slope m>1, we should change the outer loop in line (4) to be over y.

Q: Lines (10) and (12) update the decision variable d through an incremental evaluation of the line equation f.

R: The algorithm fails if d is ever 0.

  1. AOption (a)

    Q and R only

  2. BOption (b)

    P only

  3. COption (c)

    P and Q only

  4. DOption (d)

    P, Q and R

View answer & explanation

Correct answer

Answer: (c)C.

P and Q only

Why this answer is correct

Statement P: For a line with slope m>1, we should change the outer loop in line (4) to be over y.

Line 4) for x = x1 to x2 should be changed to be over y and slope m > 1

Slope of a line m = (y2 – y1)/ (x2 – x1). Because now it depends on x coordinates, to be over y it should depend on y coordinates.

Statement Q: Lines (10) and (12) update the decision variable d through an incremental evaluation of the line equation f.

It is clearly shown in the algorithm, that line (10) and line (12) are changing the values of d through incremental evaluation. i.e. adding d with itself.

d = d + (y1​ - y2) + (x2​ - x1)       ---- line (10)

d = d + (y1 - y2)                       ---- line (12)

R: The algorithm fails if d is ever 0

Algorithm does not fail when d is 0. because when d becomes greater than or equal to zero then it goes to line 12 and compute the value of. So, this statement is false.

Question 61

The solution of recurrence relation: T(n)=2T(sqrt(n)) + lg(n) is

  1. AOption (a)

    O(lg (n) lg(n))

  2. BOption (b)

    O(lg (n))

  3. COption (c)

    O(n lg (n))

  4. DOption (d)

    O(lg (n) lg(lg(n)))

View answer & explanation

Correct answer

Answer: (d)D.

O(lg (n) lg(lg(n)))

Why this answer is correct

T(n) = 2 T(sqrt(n)) + log n      ------------- (1)

Put n = 2m

Take logarithm both sides,

Log n = m

Put value of n in (1)

T (2m) = 2 T (2m/2) + m

Let, S(m) = T(2m)

So, S(m) = 2 S (m/2) + m

Use master’s theorem:

Here a = 2, b = 2

mlog⁡ba=;mlog⁡22=m{m^{{{\log }_b}a}} = ;{m^{{{\log }_2}2}} = m

Now both the mloga  and value of function are equal. So, complexity will be O(m log m)

Put value of m in terms of n.

So, complexity of given recurrence relation will be: O(logn log(logn))

Question 62

Suppose a cloud contains software stack such as Operating system, Application software, etc. This model is referred as _________ model.

  1. AOption (a)

    SaaS

  2. BOption (b)

    IaaS

  3. COption (c)

    MaaS

  4. DOption (d)

    PaaS

View answer & explanation

Correct answer

Answer: (a)A.

SaaS

Why this answer is correct

Concept:

Cloud computing provides a flexible environment to use resources at low cost. Cloud computing is a web based, distributed computing using which information, resources and software are distributed among different users. All the resources are on web, so this is the reason that there come various ways to provide services.

Explanation:

Cloud computing is internet-based computing where customers do not own the physical infrastructure. All services are on internet. Various services in cloud computing model are as follows:

SaaS – It stands for software as a service. In this, application is hosted as a service to customers who access it via internet. It provides packaged business process offerings that live in cloud. In this, cloud contains stack such as operating system, application software etc.

IaaS – It stands for infrastructure as a service. It is responsible for providing virtualized computing resources, network resources with IaaS users assemble their own virtual cluster on which they are responsible for installing, maintaining, and executing their own software stack.

PaaS – It stands for platform as a service. It supplies all the resources required to build applications and services completely by using internet without having to download or install software. It includes application design, development and hosting.

Question 63

In Linux operating system environment ________ command is used to print a file.

  1. AOption (a)

    print

  2. BOption (b)

    lpr

  3. COption (c)

    ptr

  4. DOption (d)

    pr

View answer & explanation

Correct answer

Answer: (b)B.

lpr

Why this answer is correct

Concept:

Linux is a version of Unix operating system. Linux has open source code.

It has three main components: kernel, system library and system utility.

It is portable, multi-programmed and secure.

There are various commands in Linux operating system which helps in performing various operations.

Explanation:

To print a file in Linux operating system, lp command is used also followed by the name of the file that is to be printed.

From given options, lpr is the command that is used to print a file in Linux.

Diagram of Linux:

Question 64

Consider the following Grammar G:

S ➝ A | B

A➝ a | c

B➝ b | c

Where {S, A, B} is the set of non-terminals, {a, b, c} is the set of terminals.

Which of the following statement(s) is/are correct?

S​ 1​ : LR(1) can parse all strings that are generated using grammar G.

S​ 2​ : LL(1) can parse all strings that are generated using grammar G.

  1. AOption (a)

    Both S​ 1​ and S​ 2

  2. BOption (b)

    Only S​ 2

  3. COption (c)

    Neither S​1​ nor S​ 2

  4. DOption (d)

    Only S​ 1

View answer & explanation

Correct answer

Answer: (c)C.

Neither S​1​ nor S​ 2

Why this answer is correct

Concept:

A grammar is LL(1) and LR(1) only if it is free from ambiguity and left recursion.

Ambiguous grammar: A grammar is known as ambiguous grammar when there is more than one derivation tree for a string.

Explanation:

Given grammar:

S ➝ A | B

A➝ a | c

B➝ b | c

Suppose we have to generate string “c”.

In this case we have two right most derivations possible for this string.

Case 1:

S -> A

S -> c                 // A-> c

Case 2:

S -> B

S - > c                 // B -> c

So, given grammar is ambiguous grammar. It cannot be LL(1) and LR(1).

Question 65

Consider R to be any regular language and L​1, L​2​ be any two context-free languages Which one of the following is correct?

  1. AOption (a)

    (L1 ∪ L2)’ − R is context free

  2. BOption (b)

    L1 − R is context free

  3. COption (c)

    L’1 is context free

  4. DOption (d)

    L1 ⋂ L2 is context free

View answer & explanation

Correct answer

Answer: (b)B.

L1 − R is context free

Why this answer is correct

Concept:

Context-free languages are closed under union and difference but not closed under complementation and intersection.

Explanation:

Option 1: (L1 ∪ L2)’ – R

As context-free languages are closed under union and set difference but not under complementation. Therefore (L1 ∪ L2)’ is not a context-free language and hence (L1 ∪ L2)’ – R is also not a context-free

Option 2: L1 – R is context-free

Every regular language is also closed under context-free language and the set difference of a context-free language from Regular Language is context-free. So, it is correct.

Option 3:  L’1 is context-free

L1 is a context-free language. According to the property, its complement can’t be context-free.

Option 4: L1 ∩ L2 is context-free

It violated the context-free language property. The intersection of two CFL’s is not CFL. So, it is incorrect.

Question 66

Consider the following method :

int f(int m, int n, boolean x, boolean y)

{

int res=0;

if(m<0) {res=n-m;}

else if(x || y) {

res= -1;

if(n==m) {res =1;}

}

else {res=n;}

return res;

} /*end of f */

If P is the minimum number of tests to achieve full statement coverage for f() and Q is the minimum number of tests to achieve full branch coverage for f(), then (P, Q) =

  1. AOption (a)

    (3, 4)

  2. BOption (b)

    (3, 2)

  3. COption (c)

    (2, 3)

  4. DOption (d)

    (4, 3)

View answer & explanation

Correct answer

Answer: (a)A.

(3, 4)

Why this answer is correct

Concept:

Branch coverage:

It means each branch in a statement must be executed at least once during testing of program.

Statement coverage:

It means all the statements of the program code must be executed at least once during testing.

Explanation:

To achieve full statement coverage, all the statements must be executed.

Statement coverage = (number of statement executed)/ total number of statements

In above code, there are three test cases required to achieve full statement coverage.

Case 1: when if condition becomes true,

int f(int m, int n, boolean x, boolean y)

{

int res=0;

if(m<0) {res=n-m;}

return res;

}

These statements will be executed.

Case 2: when other two cases of else will execute, then all remaining statements will also execute. By, three tests, full statement coverage is achieved.

Branch coverage: It is decision coverage and covers both true and false conditions.

Decision coverage = (number of decisions exercises)/ total number of decision outcomes.

It checks for true and false cases. In the above given code, there will be 4 tests required to achieve full branch coverage.

So, value of (P, Q) = (3, 4)

Question 67

A box contains six red balls and four green balls. Four balls are selected at random from the box. What is the probability that two of the selected balls will be red and two will be green?

  1. AOption (a)

    1/35

  2. BOption (b)

    1/14

  3. COption (c)

    1/9

  4. DOption (d)

    3/7

View answer & explanation

Correct answer

Answer: (d)D.

3/7

Why this answer is correct

Data:

red balls = 6  

green balls = 4

To Find:  The probability that two of the selected balls will be red and two will be green

Calculation:

Total balls = 6 + 4 = 10

4 balls from 10 balls can be selected in 10C4

2 red balls can be selected in 6C2 ways.

2 green balls from 4 green balls can be selected in 4C2 ways.

Probability that two selected balls will be red and two will be green = 6C2×4C210C4=;15×6210=;37\frac{{^6{{\rm{C}}_2}{ \times ^4}{{\rm{C}}_2}}}{{^{10}{{\rm{C}}_4}}} = ;\frac{{15 \times 6}}{{210}} = ;\frac{3}{7} 

Important Point

Since red and green ball is asked, we have multiplied

Question 68

Which of the following is not one of the principles of agile software development method?

  1. AOption (a)

    Following the plan

  2. BOption (b)

    Embrace change

  3. COption (c)

    Customer involvement

  4. DOption (d)

    Incremental delivery

View answer & explanation

Correct answer

Answer: (a)A.

Following the plan

Why this answer is correct

Agile software development has a major influence for a number of changes in how software developers plan and coordinate their work , how they communicate with customers and stakeholders , how software development is organized in small , medium sized and large companies from telecom and health sectors.

It basically focus on adapting to change and delivering products of high quality through simple work processes.

In agile software development model, a large product is broken into small incremental builds. These are then solved in various iterations. In agile method, every build is treated differently.

Principles of agile software development model:

  • Customer involvement: During the development of a software, we are not aware of all of its requirements initially. So, customer involvement is required in this to tackle all the necessary requirements so that product is development in an efficient manner and time.
  • Embrace change: It is responsive to any change in the development process
  • Incremental delivery: as in agile method, product is broken into small parts and each part of that is solved iteration wise. So, it is an incremental delivery process of software development.

Some other principles are working software, interaction between individuals etc. But following the plan is not in the principles of agile software development method.

Question 69

Software products need perfective maintenance for which of the following reasons?

  1. AOption (a)

    To rectify bugs observed while the system is in use.

  2. BOption (b)

    When the customers need the product to run on new platforms

  3. COption (c)

    To support the new features that users want it to support

  4. DOption (d)

    To overcome wear and tear caused by the repeated use of the software.

View answer & explanation

Correct answer

Answer: (c)C.

To support the new features that users want it to support

Why this answer is correct

Concept:

Software maintenance:

Any changes done in the software during its execution such as error correction, optimization etc. is software maintenance. Its objective is to preserve the value of software over time.

Explanation:

Types of software maintenance are:

Perfective maintenance: when there are new requirements from user side, then at that time changes made in the software is known as perfective maintenance. It makes the software more enhanced, clean structured, better than previous.

Adaptive maintenance: Changes done in the software environment that includes any work initiated as consequence of moving the software to different hardware or software is known as adaptive maintenance.

Preventive maintenance: It prevent software from future problems.

Corrective maintenance: It is related with fixing the errors. Changes done when there is defect or error in the software is known as corrective maintenance.

Question 70

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⋅0f;

else

result += f(m2, n3);

return result;

}

Which of the following integers best approximates the value of f(2,3)?

  1. AOption (a)

    0

  2. BOption (b)

    3

  3. COption (c)

    1

  4. DOption (d)

    2

View answer & explanation

Correct answer

Answer: (d)D.

2

Why this answer is correct

Function call: f(2, 3)              // m = 2 and n = 3

STEP 1:

float result = (float) m / (float) n;         // result = 2.0/ 3.0 = 0. 66

if (m < 0 || n < 0)                      // condition is false, else part will execute

result += f(m2, n3);           // result = 0.66 + f (4, 9)

STEP 2:

float result = (float) m / (float) n;         // result = 4.0/ 9.0 = 0. 44

if (m < 0 || n < 0)                      // condition is false, else part will execute

result += f(m2, n3);           // result = 0.66 + 0.44 + f (8, 27)

STEP 3:

float result = (float) m / (float) n;         // result = 8.0/ 27.0 = 0. 296

if (m < 0 || n < 0)                      // condition is false, else part will execute

result += f(m2, n3);           // result = 0.66+ 0.44 + 0.296 + f (16, , 81)

STEP 4:

float result = (float) m / (float) n;         // result = 16.0/ 81.0 = 0. 197

if (m < 0 || n < 0)                      // condition is false, else part will execute

result += f(m2, n3);           // result = 0.66+ 0.44 + 0.296 + 0.197 + f (32, 243)

STEP 5:

float result = (float) m / (float) n;         // result = 32.0/ 243.0 = 0. 131

if (m < 0 || n < 0)                      // condition is false, else part will execute

result += f(m2, n3);           // result = 0.66+ 0.44 + 0.296 + 0.197 + 0.131 + f (64, 729)

STEP 6:

float result = (float) m / (float) n;         // result = 64.0/ 729.0 = 0. 087

if (m < 0 || n < 0)                      // condition is false, else part will execute

result += f(m2, n3);           // result = 0.66+ 0.44 + 0.296 + 0.197 + 0.131 + 0.087 + f (128, 2187)

STEP 7:

result = 1.813 + 0.058 + f (256, 6561)

STEP 8:

result = 1.871 + 0.039 + f (512, 19683)

STEP 9:

result = 1.91 + f (1024, 59049)

STEP 10:

result = 1.91 + 0.017 + f(2048, 177,147)

Therefore the best approximates the value of f(2,3) is 2.

Question 71

In PERT/CPM, the merge event represents___________ of two or more events.

  1. AOption (a)

    splitting

  2. BOption (b)

    completion

  3. COption (c)

    beginning

  4. DOption (d)

    joining

View answer & explanation

Correct answer

Answer: (b)B.

completion

Why this answer is correct

Concept:

PERT (project evaluation and review technique) and CPM (critical path method) are two techniques to solve project scheduling problems. These are based on network-oriented techniques.

There is a slight difference between these two. It is that time estimation in case of CPM is deterministic and in case of PERT, it is probabilistic.

Explanation:

PERT/CPM consists of four parts:

  1. Planning: In this step, project is divided into small projects. Then these are again divided into activities.
  2. Scheduling: It prepares a time chart to show the start and finish of each activity.
  3. Allocation of resources: To complete a project, resources are required which is the work of this phase.
  4. Controlling: progress report from time to time is examined and a technical control should be implied over the project.

Networking representation of PERT/CPM includes activities, events, sequencing.

  • Activities: Any operation which has some start and end, that is known as activity. Types are predecessor activity, successor activity, dummy activity.
  • Events: Event specifies the completion of some activity and start of new one. Events are classified as merge event, burst event, merge and burst event. Merge event represents joining of two or more activities of an event (or completion of two or more events), while burst event is when one activity is leaving the event.

Question 72

In 3D Graphics, which of the following statement/s is/are true?

P: Back-face culling is an example of an image-precision visible-surface determination.

Q: Z-Buffer is a 16-bit, 32-bit, or 64-bit field associated with each pixel in a frame buffer that can be used to determine the visible surface at each pixel.

  1. AOption (a)

    P only

  2. BOption (b)

    Q only

  3. COption (c)

    Neither P nor Q

  4. DOption (d)

    P and Q

View answer & explanation

Correct answer

Answer: (b)B.

Q only

Why this answer is correct

Statement P*: Back-face culling is an example of an image-precision visible-surface determination.*

This statement is incorrect. Back face culling is a technique used to eliminate invisible back facing polygons (which are not facing viewer) from further processing.  Principle behind back face culling is that if a polygon on a 3D model is facing away from you, then it cannot be seen.

Statement Q: Z-Buffer is a 16-bit, 32-bit, or 64-bit field associated with each pixel in a frame buffer that can be used to determine the visible surface at each pixel.

This statement is correct.  Z buffer is a visible surface detection method. This is also known as depth buffer method. In this, depth values are stored for each position (x, y) during the surface processing. Each surface is processes separately in this. Depth values for pixel are compared and smallest z value determines the color or surface to be displayed. Z- buffer is a 16 – bit, 32 – bit or 64 – bit field associated with each pixel in a frame buffer that can be used to determine the visible surface at each pixel.

Question 73

Match the List 1 and List 2 and choose the correct answer from the code given below

List 1List 2
a) Equivalencei) p ⇒ q
b) Contrapositiveii) p ⇒ q : q ⇒ p
c) Converseiii) p ⇒ q : ¬ q ⇒ ¬ p
d) Implicationiv) p ⇔ q
  1. AOption (a)

    (a)-(i), (b)-(ii), (c)-(iii), (d)-(iv)

  2. BOption (b)

    (a)-(ii), (b)-(i), (c)-(iii), (d)-(iv)

  3. COption (c)

    (a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)

  4. DOption (d)

    (a)-(iii), (b)-(iv), (c)-(ii), (d)-(i)

View answer & explanation

Correct answer

Answer: (c)C.

(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)

Why this answer is correct

Truth Table:

pqp ⇒ qp ⇔ qq ⇒ p¬ p¬ q¬ q ⇒ ¬ p
TTTTTFFT
TFFFTFTF
FTTFFTFT
FFTTTTTT

 

From the above truth table,

Equivalence means p ⇔ q

Contrapositive means p ⇒ q : ¬ q ⇒ ¬ p

Converse means p ⇒ q : q ⇒ p

Implication means p ⇒ q

Important Point:

p ⇒ q ≡ ¬ q ⇒ ¬ p

Question 74

Which of the following statements are true?

(i) Every logic network is equivalent to one using just NAND gates or just NOR gates.

(ii) Boolean expressions and logic networks correspond to labelled acyclic digraphs.

(iii) No two Boolean algebras with n atoms are isomorphic.

(iv) Non-zero elements of finite Boolean algebras are not uniquely expressible as joins of atoms.

  1. AOption (a)

    (i) and (iv) only

  2. BOption (b)

    (i) and (ii) only

  3. COption (c)

    (i), (ii) and (iii) only

  4. DOption (d)

    (ii), (iii) and (iv) only

View answer & explanation

Correct answer

Answer: (b)B.

(i) and (ii) only

Why this answer is correct

(i) Every logic network is equivalent to one using just NAND gates or just NOR gates.

This is true. As NAND and NOR are universal gates. Every logic network is equivalent to using just NAND or NOR gate. NAND or NOR are complement of AND and OR gate respectively. Individually they are a complete set of logic as they can be used to implement any other Boolean function or gate.

(ii) Boolean expressions and logic networks correspond to labelled acyclic digraphs.

This statement is true. Boolean functions can be represented with the labelled acyclic graph.

Example:

(iii) No two Boolean algebras with n atoms are isomorphic.

Every finite Boolean algebra is isomorphic to an algebra of sets. Every finite Boolean algebra has 2n elements with n generators. In Boolean algebra, the immediate successors of minimum element are called as atoms. All Boolean algebra of order 2n are isomorphic to each other.

(iv) Non-zero elements of finite Boolean algebras are not uniquely expressible as joins of atoms.

As explained in option 3). All Boolean algebra of order 2n are isomorphic to each other. If there is a set A = {a1, a2, ….., an} contains set of all atoms of B where B = [and, or, not], then every non zero element of Boolean algebra can be expressed uniquely as join of subset of A. So, this given statement is incorrect.

Question 75

Which of the following problem is decidable for recursive language (L)?

  1. AOption (a)

    Is L = ф?

  2. BOption (b)

    Is w ∈ L, where w is a string?

  3. COption (c)

    Is L = R, where R is given regular set?

  4. DOption (d)

    Is L = Σ*?

View answer & explanation

Correct answer

Answer: (b)B.

Is w ∈ L, where w is a string?

Why this answer is correct

Concept:

Decidable language: A language is decidable if there exists a Turing machine which halts or accepts it.

Explanation:

A recursive language L is given.

Statement 1: Is L = ф?

This is emptiness property. Recursive languages are not decidable for emptiness problem. Problem whether a recursive language is empty cannot be solved.

Statement 2: Is w ∈ L, where w is a string?

It means membership property of recursive language. Recursive languages are decidable for membership property. If any string is in the language than either it halts in final state or accepted by Turing machine. So, it is decidable.

Statement 3: Is L = R, where R is given regular set?

Whether a recursive language is regular, is undecidable.

Statement 4: Is L = Σ?*

As, language is decidable when there is Turing machine which halts in final state. There no algorithm which can decide this property of recursive language. So, it is undecidable.

Question 76

Match List 1 with List 2 and choose the correct answer from the code given below

List 1List 2
a) Greedy best-first searchi) Selects a code for expansion if optimal path to that node has been found
b) A* Searchii) Avoids substantial overhead associated with keeping the sorted queue of nodes
c) Recursive best-first searchiii) Suffers from excessive node generation
d) Iterative-deepening A* Searchiv) Time complexity depends upon the quality of heuristic
  1. AOption (a)

    (a)-(iv), (b)-(iii), (c) -(ii), (d)-(i)

  2. BOption (b)

    (a)-(i), (b)-(iv), (c) -(iii), (d)-(ii)

  3. COption (c)

    (a)-(iv), (b)-(i), (c) -(ii), (d)-(iii)

  4. DOption (d)

    (a)-(i), (b)-(ii), (c) -(iii), (d)-(iv)

View answer & explanation

Correct answer

Answer: (b)B.

(a)-(i), (b)-(iv), (c) -(iii), (d)-(ii)

Why this answer is correct

Greedy best – first search:

It selects that path which appears best at the time when it is needed. It uses both the depth first and breadth first search algorithm to find the best path. It selects a code for expansion if optimal path to that node has been found.  Expand the nodes by considering the nodes closest to the goal node. Disadvantage of this search algorithm is that it can go into infinite loop using DFS.

A search:*

It is also used for best first search. It also find the best path by using heuristic function h(n) and start from the first node, it reaches the goal node. It has the features of greedy best first search algorithm. In this , f(n) = g(n) + h(n), where h(n) is the heuristic function , f(n) is the estimated cost to reach the goal node and g(n) is the cost to reach a node from the start state. In this , time complexity depends on the heuristic function.

Recursive best – first search:

It is a search algorithm that is linear with respect to the maximum search depth. It can visit the same node multiple times. It is similar to the recursive implementation of depth first search algorithm. It works by maintaining on the recursion stack the complete path to current node being expanded as well as immediate nodes on that path. That’s why it suffers from excessive node generation.

Iterative deepening A search:*

It finds the shortest path between start node and any member of goal nodes. It is similar to iterative deepening depth first search algorithm. It does not go to same node again and again. It just explores the most promising node. It avoids substantial overhead associated with keeping the sorted queue of nodes.

Question 77

The four-byte IP Address consists of

  1. AOption (a)

    Neither network nor Host Address

  2. BOption (b)

    Network Address

  3. COption (c)

    Both Network and Host Address

  4. DOption (d)

    Host Address

View answer & explanation

Correct answer

Answer: (c)C.

Both Network and Host Address

Why this answer is correct

IP address that is 4 bytes long is known as IPv4 address. IPv4 address uniquely and universally defines the connection of a device to the internet. IP addresses are unique.  There are two notations of an IP address:

Binary notation and decimal notation.  An IP address consists of both host and network address.

Two types of classification of IP addresses are: classful addressing and classless addressing

Classful addressing:  In this address space is divided into five classes: class A, B, C, D and E.

  • In class A, one byte is for network ID and three bytes are for host ID.
  • In class B, two bytes are for network ID and two bytes are for host ID
  • In class C, three bytes are for network ID and one byte for host ID.

Diagram:

Question 78

Consider the schema R = (A, B, C, D, E, F) on which the following functional dependencies hold:

A ➝ B

B, C ➝ D

E ➝ C

D ➝ A

What are the candidate keys of R?

  1. AOption (a)

    AEF, BEF and DEF

  2. BOption (b)

    AEF, BEF and BCF

  3. COption (c)

    AE and BE

  4. DOption (d)

    AE, BE and DE

View answer & explanation

Correct answer

Answer: (a)A.

AEF, BEF and DEF

Why this answer is correct

Concept:

Candidate key: it is the set of attributes which uniquely identifies a relation. It is also known as superkey with no repeated attributes.

Explanation:

Given relation R = {A, B, C, D, E}

A ➝ B

B, C ➝ D

E ➝ C

D ➝ A

Find the closure of keys given. If all the attributes of relation are present in the closure, then it will be the candidate key of that relation.

Option1: AEF, BEF and DEF

(AEF)+ = {A, E, F, B, C, D}

(BEF)+ = {B, E, F, C, D, A}

(DEF)+ = {D, E, F, C, A, B}

These are the candidate keys of given relation.

Option2: AEF, BEF and BCF

(AEF)+ = {A, E, F, B, C, D}

(BEF)+ = {B, E, F, C, D, A}

(BCF)+ = {B, C, F, D, A}        // E is not present in the closure. Not the candidate key

Option3: AE and BE

(AE)+ = {A, E, C, B, D, }       //F is not present, not a candidate key

(BE)+ = {B, E, C, D, A}        //F is not present, not a candidate key

Option4: AE, BE and DE

(AE)+ = {A, E, C, B, D, }       //F is not present, not a candidate key

(BE)+ = {B, E, C, D, A}        //F is not present, not a candidate key

(DE)+ = {D, E, A, C, B}        //F is not present, not a candidate key

Question 79

Consider the graph shown below:

Use Kruskal’s algorithm to find the minimum spanning tree of the graph. The weight of this minimum spanning tree is

  1. AOption (a)

    13

  2. BOption (b)

    16

  3. COption (c)

    17

  4. DOption (d)

    14

View answer & explanation

Correct answer

Answer: (b)B.

16

Why this answer is correct

Concept:

Kruskal’s algorithm: It is used to find the minimum spanning tree of a graph. It uses the make set procedure. First, all the edges are sorted in ascending order and then added into the set. If the vertices corresponding to that edge are already in the set than that edge will not be considered.

Explanation:

 

Edges in sorted order :

BI = 1                                     

CD = 1

HG = 1

BC= 2

HI = 2

GI = 2

HA =2

AI = 3

GF = 3

AB = 4

FI = 4

EI = 4

CI = 4

DI = 5

DE = 5

FE = 6

Set of edges: {A} {B} {C} {D} {E} {F} {G} {H} {I}

= {A} {B, I} {C} {D} {E} {F} {G} {H}          // edge BI is taken

= {A} {B, I} {C, D} {E} {F} {G} {H}          // edge CD is taken

= {A} {B, I} {C, D} {E} {F} {G, H}            // edge GH is taken

= {A} {B, I, C, D} {E} {F} {G, H}             // edge BC is taken

= {A} {B, I, C, D, G, H} {E} {F}                 // edge HI is taken

= {A, B, I, C, D, G, H} {E} {F}                 // edge HA is taken

= {A, B, I, C, D, G, H, F} {E}                  // edge GF is taken

= {A, B, I, C, D, G, H, F, E}                  // edge EI is taken

Now, all the vertices are covered, no need to consider remaining edges.

Spanning tree is: 

weight of this spanning tree = 2 + 1 + 3 + 2 + 4 + 1 + 2 + 1 = 16

Question 80

Dirty bit is used to show the

  1. AOption (a)

    Page with low frequency occurrence

  2. BOption (b)

    Wrong page

  3. COption (c)

    Page with corrupted data

  4. DOption (d)

    Page that is modified after being loaded into cache memory

View answer & explanation

Correct answer

Answer: (d)D.

Page that is modified after being loaded into cache memory

Why this answer is correct

Concept:

Dirty bit: Dirty bit is associated with a block of cache memory and it is used to show the page that is modified after being loaded into cache memory.

Explanation:

During write back police in cache, dirty bit concept is used.

Write back means updates are written only to the cache. When line is modified it’s dirty bit is set and when the line is selected for replacement, the line needs to be written to main memory only if it’s dirty bit is set.

In write back, we first write the cache copy to update the memory. Number of write backs can be reduced if we write only when cache data is different from memory. It is done by dirty bit or modifying bit. It writes back to the cache only when dirty bit is set to 1. Thus, write back cache requires two bits one is valid bit and another is dirty bit.

Diagram:

Question 81

A legacy software system has 940 modules. The latest release requires that 90 of these modules be changed. In addition, 40 new modules were added, and 12 old modules were removed. Compute the software maturity index for the system.

  1. AOption (a)

    0.725

  2. BOption (b)

    0.727

  3. COption (c)

    0.849

  4. DOption (d)

    0.524

View answer & explanation

Correct answer

Answer: (c)C.

0.849

Why this answer is correct

Concept:

Software maturity index: It is used to determine the readiness for release of a software system. It is useful when changes, like addition or deletion of modules in the software system taken place.

Formula:

Software maturity index (SMI) = [Mt – (Fc + Fa + Fd)]/Mt

Where, Mt = number of modules in current release of software

Fc = number of modules that are changed

Fd  = number of modules that are deleted

Fa = number of modules that are added.

Calculation:

Given Mt = 940

Fc = 90

Fa = 40

Fd = 12

SMI = [940 – (90 + 40 + 12)]/ 940

SMI = [940- 142]/ 940

SMI = 798/ 940

SMI = 0.8489 (approx.. 0. 849)

Question 82

The relation​ ​ ≤ and < on a boolean algebra are defined as:

x ≤ y and only if x ∨ y = y

x < y means x ≤ y but x ≠ y

x ≥ y means y ≤ x and

x > y means y <x

Consider the above definitions, which of the following is not true in the boolean algebra?

(i) If x ≤ y and y ≤ z, then x ≤ z

(ii) If x ≤ y and y ≤ x, then x=y

(iii) If x < y and y < z, then x ≤ y

(iv) If x < y and y < z, then x < y

  1. AOption (a)

    (iv) only

  2. BOption (b)

    (iii) only

  3. COption (c)

    (i) and (ii) only

  4. DOption (d)

    (ii) and (iii) only

View answer & explanation

Correct answer

Answer: (b)B.

(iii) only

Why this answer is correct

Consider all the options one by one:

  1. If x ≤ y and y ≤ z, then x ≤ z

This is true by transitive property. As x ≤ y and y ≤ z, then x should be less than or equal to z.

2)  If x ≤ y and y ≤ x, then x=y

 As x<=y, it means x ∨ y = y         //given in question

Y<=x, means x ∨ y = x

Here, x ∨ y = y = x

So, this is true.

  1. If x < y and y < z, then x ≤ y

In this, it says that x< y which means

  1. x< =y where,
  2. x should not be equal to y.
<br>

But in this only first condition is given, second is not present. So, it is false.

  1. If x < y and y < z, then x < y

This statement is true. As x< y, then x < y which is same in both the cases.

Question 83

In a ternary tree, the number of internal nodes of degree 1,2 and 3 is 4,3 and 3 respectively. The number of leaf nodes in the ternary tree is

  1. AOption (a)

    11

  2. BOption (b)

    12

  3. COption (c)

    10

  4. DOption (d)

    9

View answer & explanation

Correct answer

Answer: (c)C.

10

Why this answer is correct

Data:

Number of internal nodes of degree 1 = 4

Number of internal nodes of degree 2 = 3

Number of internal nodes of degree 3 =3

Formula:

Number of leaf nodes = sum of degree of all internal nodes – total internal nodes + 1

Calculation:

Total number of internal nodes = 4+ 3 + 3 = 10

Sum of degree of all internal nodes = (4 × 1) + (3 × 2) + (3 × 3) = 4 + 6 + 9 = 19

Number of leaf nodes = sum of degree of all internal nodes – total internal nodes + 1

= 19 – 10 + 1 = 10

Alternate Method:

In the question only out-degree is given for a node:

Since it is a tree every node will have 1 in-degree (except root node and the root node is also an internal node)

Four nodes with out-degree 1 and one root is definitely a root

The root will have 0 in-degree and 1 out-degree ∴ total degree of the root node is 1

other 3 nodes will have 1 in-degree each and 1 out-dree

Similarly, other nodes degree will be increased by 1

and  each leaf node will have 1 in-degree

By handshaking lemma:

Total number of node (n) = internal node(10) + leaf node(L)

2(n - 1) = (1× 1 + 3 × 2) + 3× 3 + 3× 4 + L× 1

2((10 + L) - 1) = 28 + L

20 + 2L - 2 = 28 + L

L = 10

Question 84

A survey has been conducted on methods of commuter travel. Each respondent was asked to check Bus, Train or Automobile as a major method of travelling to work. More than one answer was permitted. The results reported were as follows: Bus 30 people; Train 35 people; Automobile 100 people; Bus and Train 15 people; Bus and Automobile 15 people; Train and Automobile 20 people; and all the three methods 5 people. How many people complete the survey form?

  1. AOption (a)

    160

  2. BOption (b)

    120

  3. COption (c)

    165

  4. DOption (d)

    115

View answer & explanation

Correct answer

Answer: (b)B.

120

Why this answer is correct

Let B = people travelled by bus

T = people travelled by train

A = people travelled by automobile

B = 30

T = 35

A = 100

People travelled by both bus and train (B ꓵ T) = 15

People travelled by both bus and automobile (B ꓵ A) = 15

People travelled by both bus and automobile (T ꓵ A) = 20

People travelled by all three (B ꓵ T ꓵ A) = 5

Total people who complete the survey form are denoted as: B ꓴ T ꓴ A

(B ꓴ T ꓴ A) = B + T + A - Bꓵ A - B ꓵ T - T ꓵ A + B ꓵ T ꓵ A

                    = 30 + 35 + 100 – 15 – 15 – 20 + 5

                    = 165 – 50 + 5 = 165 – 45

                    = 120

Total people who complete the survey form = 120

Question 85

Consider the following two C++ programs P​1​ and P​2​ and two statements S​1​ and S​2​ about the programs:

P1P2
void f(int a, int*b, int &c) {     a = 1; *b =2; c = 3; } int main () { int i = 0; f(i, &i, i): cout ≪ i; }double a = 1, b =2; double &f(double &d) {       d = 4; return b; } int main () { f(a) = 5; cout ≪ a ≪ “:” ≪b; }

 

S1: P1 prints out 3

S2: P2 prints out 4:2

What can you say about the statement S1 and S2?

  1. AOption (a)

    Neither S1​ nor S2​ is true

  2. BOption (b)

    Only S​1​ is true

  3. COption (c)

    Only S2​ is true

  4. DOption (d)

    Both S1​ and S​2​ are true

View answer & explanation

Correct answer

Answer: (b)B.

Only S​1​ is true

Why this answer is correct

Code P1:

In function f, there are three parameters, one is integer, second is pointer , third is reference variable. When there is call to function f from main in which initially value of i = 0

Int main ()

{int i= 0; f(i, &i, i); cout<< i;}           //it calls the function f

void f (int a, int *b, int &c)

{

a =1;      //it changes the value of i to 1, but it is call by value, change will not reflect back to main

*b = 2;      // it changes the value of i to 2 and change will reflect to main function

c = 3;         // it changes the value of i again and final value becomes 3.

}

So, Code p1 prints out 3.

Code P2:

In this, f(a) calls the function f which is:

double &f(double &d)

{

d =4;          // it will update the value of a to 4 and returns reference to double b.

return b;             // here it returns the value of b as 5.

}

So, in main

int main ()

{

f(a) = 5;            // a becomes 4

cout<< a<< “:”<< b;        // it prints 4: 5

}

Question 86

The grammar S → SS | (S)| ϵ is not suitable for predictive parsing because the grammar is:

  1. AOption (a)

    An Operator Grammar

  2. BOption (b)

    Right Recursive

  3. COption (c)

    Left  Recursive

  4. DOption (d)

    Ambiguous

View answer & explanation

Correct answer

Answer: (d)D.

Ambiguous

Why this answer is correct

Rules for a predictive parser: it should be free from ambiguity, left recursion, left factoring.

Given grammar: S → SS | (S)| ϵ

This grammar is ambiguous, here smallest string possible is ϵ. For this string, more than one parse tree is possible.

S → ϵ

S → SS →  ϵS → ϵ.ϵ →ϵ

Also, given grammar is left recursive. So, grammar is not suitable for predictive parsing. But first step is to remove ambiguity. So, correct answer here is ambiguity.

Question 87

A full joint distribution for the Toothache, Cavity and Catch is given in the table below:

ToothacheﬧToothache
CatchﬧCatchCatchﬧCatch
Cavity0.1080.0120.0720.008
Cavity0.0160.0640.1440.576

 

Which is the probability of Cavity, given evidence of Toothache?

  1. AOption (a)

    < 0.2, 0.8 >

  2. BOption (b)

    < 0.6, 0.8 >

  3. COption (c)

    < 0.4, 0.8 >

  4. DOption (d)

    < 0.6, 0.4 >

View answer & explanation

Correct answer

Answer: (d)D.

< 0.6, 0.4 >

Why this answer is correct

Concept:

Probability of an event A given that an event B has already occurred is denoted by :

P(AB)= P(A∩B)P(B)P\left( \frac{A}{B} \right)=~\frac{P\left( A\cap B \right)}{P\left( B \right)}

Explanation:

Probability of cavity given evidence of toothache is denoted here as:

Case1:

\(P\left( \frac{Cavity}{Toothache} \right)=\frac{P\left( cavity\cap Toothache \right)}{P\left( Toothache \right)}\)

P(Toothache) = 0.108 + 0.012 + 0.016 + 0.064 = 0.2

P(cavity ꓵ Toothache) = 0.108 + 0.012 = 0.12

<br>

P(CavityToothache)= 0.120.2P\left( \frac{Cavity}{Toothache} \right)=~\frac{0.12}{0.2} = 0.6

Case2:

\(P\left( \frac{\neg Cavity}{Toothache} \right)=\frac{P\left( \neg cavity\cap Toothache \right)}{P\left( Toothache \right)}\)

P(¬cavity ꓵ Toothache) = 0.016 + 0.064 = 0.08

P(¬CavityToothache)= 0.080.2=0.4P\left( \frac{\neg Cavity}{Toothache} \right)=~\frac{0.08}{0.2}=0.4

Question 88

Consider the following sequence of two transactions on a bank account(A) with initial balance 20,000 that transfers 5,000 to another account (B) and then apply 10% interest.

(i) T1 start

(ii) T1 A old = 20000 new 15,000

(iii) T1 B old = 12000 new = 17000

(iv) T1 commit

(v) T2 start

(vi) T2 A old = 15000 new = 16500

(vii) T2 commit

Suppose the database system crashes out just before log record (vii) is written. When the system is restricted, which one statement is true of the recovery process?

  1. AOption (a)

    We can apply redo and undo operation in arbitrary order because they are idempotent.

  2. BOption (b)

    We must redo log record (vi) to set A to 16,500.

  3. COption (c)

    We must undo log record (vi) to set A to 16,500 and then redo log record (ii) and (iii).

  4. DOption (d)

    We need not redo records (ii) and (iii) because transaction T1 has committed.

View answer & explanation

Correct answer

Answer: (c)C.

We must undo log record (vi) to set A to 16,500 and then redo log record (ii) and (iii).

Why this answer is correct

Concept:

Whenever a transaction is submitted to a DBMS for execution, the system is responsible for making sure that either all the operations are completed successfully and their effect is recorded permanently in the database or the transaction has no effect on the database or other transactions whatever happened.

Explanation:

To be able to recover from failures that affect transactions, system maintains a log to keep track of all transactions so that to recover the data. In log-based recovery mechanism, redo operations is performed for those transactions that contains both start and commit log record. Undo operation is performed for the transactions in which system crash happens before their commit operation.

As, here system crashes out just before log record (vii) is written. Before this, log record (vi) has not been committed.  So, there is need to undo record (vi) and redo log record (ii) and (iii).

Question 89

Which of the following statement/s is/are true?

(i) windows XP supports both peer-peer and client-server networks.

(ii) Windows XP implements Transport protocols as drivers that can be loaded and uploaded from the system dynamically.

  1. AOption (a)

    Both (i) and (ii)

  2. BOption (b)

    Neither (i) nor (ii)

  3. COption (c)

    (ii) only

  4. DOption (d)

    (i) only

View answer & explanation

Correct answer

Answer: (a)A.

Both (i) and (ii)

Why this answer is correct

(i) windows XP supports both peer-peer and client-server networks.

This statement is true. Windows XP supports both peer to peer and client- server networks. Key goals of the windows XP system are its portability, security, multiprocessor support, extensibility etc. It uses a micro- kernel architecture. It is a layered system of modules. There are two modes in this system: one is protected mode, and another is user mode.

(ii) Windows XP implements Transport protocols as drivers that can be loaded and uploaded from the system dynamically.

Windows XP allows the setup of a firewall protected network. Peer to peer networking feature of windows XP allow to easily develop a functional network without a server class machine. It implements transport protocols as drivers that can be loaded and uploaded from the system dynamically.

Question 90

An attribute A of data type varchar(20) has the value ‘xyz’ and attribute B of data type char(20) has the value “Imnop” , then the attribute A has ________ spaces and attribute B has ________ spaces.

  1. AOption (a)

    20, 20

  2. BOption (b)

    3, 20

  3. COption (c)

    3, 5

  4. DOption (d)

    20, 5

View answer & explanation

Correct answer

Answer: (b)B.

3, 20

Why this answer is correct

Concept:

Char and varchar types are similar but differ in their storing and retrieval way. They also have different maximum length.

Explanation:

Char: When char is declared with a length than its length is fixed with that is declared during the creation of the table. Some points about char:

  • It has fixed length,
  • It loads empty spaces.
  • Length ranges from 0 to 255
  • When char values are stored, they are right padded with spaces to the specified length.

Here, char(20) is given for value “lmnop”. Length is fixed in char. So, attribute B has 20 spaces.

Varchar: Values in varchar columns are of variable length. Some points about varchar are as follows:

 

  • Length can be specified from 0 to 65535.
  • The effective maximum length is subject to maximum row size
  • Varchar values are stored as 1 byte or 2 byte length prefix plus data.
  • It doesn’t use the entire declared length.

Here, varchar(20) has the value “xyz” for attribute A. So, attribute A takes 3 spaces.

Question 91

The clustering index is defined on the fields which are of type

  1. AOption (a)

    key and ordering

  2. BOption (b)

    key and non-ordering

  3. COption (c)

    non-key and ordering

  4. DOption (d)

    non-key and non-ordering

View answer & explanation

Correct answer

Answer: (c)C.

non-key and ordering

Why this answer is correct

Concept:

Indexing is a data structure technique to efficiently retrieve records from database files based on some attributes on which the indexing has been done. It is used to optimize the performance of database.

Explanation:

The index structure typically provides secondary access path i.e. alternate way of accessing the records without affecting the physical placement of records on disk.

There are several types of ordered indexes. A primary index is specified on the ordering key field of an ordered file of records. If ordering field is non key then it is known as clustering index. Non key and ordered means if numerous records in the file can have the same value for ordering field. Clustering index is also known as non-dense index.

Clustering index is an ordered file with two fields:

  • First field is of same type as clustering of data file
  • Second field is a block pointer.

Question 92

A binary search tree is constructed by inserting the following numbers in order:

60, 25, 72, 15, 30, 68, 101, 13, 18, 47, 70, 34

The number of nodes is the left subtree is

  1. AOption (a)

    7

  2. BOption (b)

    6

  3. COption (c)

    3

  4. DOption (d)

    5

View answer & explanation

Correct answer

Answer: (a)A.

7

Why this answer is correct

Binary Search Tree (BST):

Nodes to the lest of BST are 13 15 18 25 30 34 47

Therefore The number of nodes in the left subtree is 7

Tips and Tricks:

Sorted the nodes in BST: 13 15 18 25 30 34 47 60 68 70 72 101

Count the nodes to the left of the root node (60).

Question 93

What does the following java function perform? (Assume int occupies four bytes of storage)

Public static int f(int a)

{

//Pre-conditions: a>0 and no overflow/underflow occurs

int b = 0;

for(int i=0; i<32; i++)

{

b=b <<1;

b= b | (a & 1);

a = a >>> 1; // This is a logical shift

}

return b;

}

  1. AOption (a)

    Return the int that represents the number of 0’s in the binary representation of integer a.

  2. BOption (b)

    Return the int that represents the number of 1’s in the binary representation of integer a.

  3. COption (c)

    Return the int that has the reversed binary representation of integer a.

  4. DOption (d)

    Return the int that has the binary representation of integer a.

View answer & explanation

Correct answer

Answer: (c)C.

Return the int that has the reversed binary representation of integer a.

Why this answer is correct

Initially value of b = 0

Consider a = 5

Iteration 1:

for(int i=0; i<32; i++)                    //condition is true

b = b<<1;                                       // b becomes 0 (0 × 2 = 0)

b= b | (a & 1);                              // 0 | (5 & 1) ; b becomes 1

a = a >>> 1;                            // as this is a logical shift; so a becomes 2

Iteration 2 :

for(int i=0; i<32; i++)                    // i is 1, condition is true

b = b<<1;                                       // b becomes 2

b= b | (a & 1);                              // 2|(2 & 1) ; b becomes 2

a = a >>> 1;                            // as this is a logical shift; so a becomes 1

Iteration 3:

for(int i=0; i<32; i++)                    // i is 2, condition is true

b = b<<1;                                       // b becomes 4

b= b | (a & 1);                              // 4|(1 & 1) ; b becomes 5

a = a >>> 1;                            // as this is a logical shift; so a becomes 0

Iteration 4:

for(int i=0; i<32; i++)                    // i is 3, condition is true

b = b<<1;                                       // b becomes 10

b= b | (a & 1);                              // 10|(0 & 1) ; b becomes 1o

a = a >>> 1;                            // as this is a logical shift; so a becomes 0

After this, value of b will multiply by 2 on every iteration

when i = 4, b = 20

when i = 5, b = 40

when i = 6, b = 80 = 23 × 10

when i = 7, b = 160 = 24 × 10

….

when i = 29, b = 160 = 226 × 10

when i = 30, b =   227 × 10

but Size of int is 4 byte in java: Range - 231 to 231 – 1

when i = 30, b =   227 × 10 ≡ -1610612736

when i = 31, b =   228 × 10 ≡ -1610612736

a = 5 = (0000 0000 …. 0101)2

reverse of a = 1010 0000 0000 …. 0000)2 = -231 + 229 = -1610612736

Therefore, return the int that has the reversed binary representation of integer a.

Question 94

Consider the following postfix expression with single digit operands:

6 2 3 * / 4 2 * + 6 8 * -

The top two elements of the stack after second * is evaluated, are:

  1. AOption (a)

    6, 3

  2. BOption (b)

    8, 1

  3. COption (c)

    8, 2

  4. DOption (d)

    6, 2

View answer & explanation

Correct answer

Answer: (b)B.

8, 1

Why this answer is correct

Postfix expression: 6 2 3 * / 4 2 * + 6 8 * -

Question 95

Consider the singly linked list. What is the worst-case time complexity of the best-known algorithm to delete the node a, pointer to this node is q, from the list?

  1. AOption (a)

    O(1)

  2. BOption (b)

    O(lg n)

  3. COption (c)

    O(n)

  4. DOption (d)

    O(n lg n)

View answer & explanation

Correct answer

Answer: (c)C.

O(n)

Why this answer is correct

Consider a singly linked list:

In this case, node a is at the end of the list. Pointer q is given to this node. In this case, we need to traverse the complete list to delete that node and then rearrange the remaining nodes.

So, in worst case , when there are n elements in the list and element a is at the end. Then it takes O(n) time to delete that node in the worst case.

Question 96

Which of the following statement/s is/are true?

(i) Facebook has the world’s largest Hadoop cluster.

(ii) Hadoop 2.0 allows live stream processing of real time data

  1. AOption (a)

    Neither (i) nor (ii)

  2. BOption (b)

    Both (i) and (ii)

  3. COption (c)

    (i) only

  4. DOption (d)

    (ii) only

View answer & explanation

Correct answer

Answer: (b)B.

Both (i) and (ii)

Why this answer is correct

(i) Facebook has the world’s largest Hadoop cluster.

This statement is correct. Hadoop clusters helps in organizing and analyse the data in a computational environment. It boosts the speed for data analysis. These clusters helps in increasing the throughput performance. They also resistant to any failure and data loss as data backup is maintained on the clusters to support redundancy. As per the research study 2013, Facebook has become the world’s largest Hadoop cluster and storing more than hundreds of millions of gigabytes. Hadoop provides a common infrastructure for Facebook with efficiency and reliability. Hadoop is empowering this social networking platform in each possible way such as searching, log processing, recommendation system, to video and image analysis.

(ii) Hadoop 2.0 allows live stream processing of real time data

Given statement is correct. Hadoop 2.0 has many advantages over previous version. These are:

  • Hadoop 2.0 allows live stream processing of real time data
  • Its ability to process Terabytes and petabytes of data available in HDFS using MPI.
  • It enables multi-tenancy support in Hadoop.
  • It provides horizontal scalability of namenode.

Question 97

The host is connected to a department network which is a part of a university network. The university network, in turn, is part of the internet. The largest network, in which the Ethernet address of the host is unique, is

  1. AOption (a)

    The university network

  2. BOption (b)

    The internet

  3. COption (c)

    The subnet to which the host belongs

  4. DOption (d)

    The department network

View answer & explanation

Correct answer

Answer: (b)B.

The internet

Why this answer is correct

Concept:

Ethernet standard is IEEE 802.3. It uses CSMA/CD (carrier sense multiple access with collision detection) access method with speed up to 100 Gbps. Ethernet address is also known as MAC address.

Explanation:

Each device on a network has a unique MAC address. Ethernet address length is 48 bits and denoted by 12 hexadecimal digits.

This MAC address is present on NIC (network interface card). When there is movement from one device to another device, MAC address remains same.

In this question, host is connected to department network which is a part of university network. The university network in turn is part of internet. So, indirectly largest network is the internet in which the Ethernet address of host is unique.

Representation of MAC address:

Question 98

let r = a(a + b), s = aab and t = a*b be three regular expressions. Consider the following:

(i) L(s) ⊆ L(r) and L(s) ⊆ L(t)

(ii). L(r) ⊆ L(s) and L(s) ⊆ L(t)

  1. AOption (a)

    Only (i) is correct

  2. BOption (b)

    Both (i) and (ii) are correct

  3. COption (c)

    Only (ii) is correct

  4. DOption (d)

    Neither (i) nor (ii) is correct

View answer & explanation

Correct answer

Answer: (a)A.

Only (i) is correct

Why this answer is correct

Three regular expressions:

  1. r = a(a + b)*

Language represented by this regular expression:

L(r) = {a, aa, ab, aab, abb, aba, aaa,  aaab, aabab, …….}

  1. s = aa*b

Language represented by this regular expression:

L(s) = {ab, aab, aaab, aaaab,………..}

  1. t = a*b

Language represented by this regular expression :

L(t) = {b, ab, aab, aaab, aaaab, ……..}

Now, consider both the options one by one :

(i) L(s) ⊆ L(r) and L(s) ⊆ L(t)

It is clearly shown here that all the string of L(s) are also present in L(r). So L(s) is subset of L(r). Similarly, all strings of L(s) are also present in L(t). So, L(s) is subset of L(t).

(ii). L(r) ⊆ L(s) and L(s) ⊆ L(t)

This statement cannot be true. From above languages, it is clear that first statement is true, and this is the opposite of first statement.

Question 99

An agent can improve its performance by

  1. AOption (a)

    Learning

  2. BOption (b)

    Responding

  3. COption (c)

    Observing

  4. DOption (d)

    Perceiving

View answer & explanation

Correct answer

Answer: (a)A.

Learning

Why this answer is correct

Concept:

Agent: An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators. Example: human agents, robotic agents etc.

Agent is also equal to architecture and program combination.

Explanation:

Factors that are considered in agents are its performance measure, environment, actuators, sensors.

  • Performance: safe, fast, legal, maximize profits.
  • Environment: Roads, pedestrians, customers
  • Actuators: steering wheel, accelerator, brake.
  • Sensors: Cameras, speedometer, GPS, keyboard.

Environment types: fully observable, deterministic, static, dynamic, single agent, semi dynamic.

Agents observes through sensor and directs activity towards achieving goals. Agents improves its performance by learning to achieve its goals. A reflex machine is an example of an intelligent agent. AI agent must have ability to perceive the environment.

Question 100

The second smallest of n elements can be found with _______ comparisons in worst case.

  1. AOption (a)

    n + ceil(lg n) -2

  2. BOption (b)

    n-1

  3. COption (c)

    lg n

  4. DOption (d)

    3n/1

View answer & explanation

Correct answer

Answer: (a)A.

n + ceil(lg n) -2

Why this answer is correct

Second smallest element of n elements can be found with n+ ceil(lg n) – 2  comparisons in worst case.

Explanation:

If we have n elements, n-1 comparisons are required to find the minimum element.

During this procedure, each element is compared at most log n times. Because every time, we compare the elements, at second iteration list, search will proceed in n/2 elements. Then in next iteration, search goes on for n/4 elements. At the end, there is only one element left. So, at most log n times each element is compared.

At the end, there are n + logn – 2 comparisons to find the second minimum element.

Example:

If we have 1024 elements, then number of comparisons to find second minimum element in that:

1024 + ceil(log2 1024) – 2 = 1024 + 10 – 2 = 1024 + 8 = 1032

100 questions in the full paper