Official Paper

GATE CS 2011 Official Paper (Previous Year Paper)

65 questions · 180 minutes · with answers · free

General Aptitude (10 questions)

1

Which of the following options is the closest in the meaning to the word below:

Inexplicable

  1. ((a))

    Incomprehensible

  2. ((b))

    Indelible

  3. ((c))

    Inextricable

  4. ((d))

    Infallible

Show Answer
Answer: ((a))

Incomprehensible

The correct answer is option 1 i.e. Incomprehensible.

Explanation-

Inexplicable means incapable of being explained, interpreted or accounted for. 

  • Incomprehensible: impossible to comprehend: UNINTELLIGIBLE.
  • Indelible: that cannot be removed, washed away, or erased.
  • Inextricable: forming a maze or tangle from which it is impossible to get free
  • Infallible: incapable of error: UNERRING

Inexplicable means not explicable; that cannot be explained, understood, or accounted for. So the best synonym here is incomprehensible.

2

If Log (P) = (1/2) Log (Q) = (1/3) Log (R), then which of the following options is TRUE?

  1. ((a))

    P= Q3R2

  2. ((b))

    Q= PR

  3. ((c))

    Q= R3P

  4. ((d))

    R = P2Q2

Show Answer
Answer: ((b))

Q= PR

Explanation:

Let Log (P) = (1/2) Log (Q) = (1/3) Log (R) = l

∴ P = 10k, Q = 102k, R = 103k

Now,

Option 1:

P2=Q3R2

(10k)2 = (102k)3 (103k)2 

102k ≠ 1012k

Option 2:

Q2 = PR

104k = (103k)(10k)

104k = 104k

∴Q2 = PR follows the given relation.

Option 3:

Q2 = R3P ⇒ 102k ≠ 107k

Option 4:

R=P2Q2 ⇒ 103k ≠ 106k

∴ Only option(2) is correct.

3

Choose the most appropriate word (s) from the options given below to complete the following sentence.

I contemplated________Singapore for my vacation but decided against it.

  1. ((a))

    to visit

  2. ((b))

    having to visit

  3. ((c))

    visiting

  4. ((d))

    for a visit

Show Answer
Answer: ((c))

visiting

The correct answer is Option 3 i.e visiting 

Explanation:

Reading the given sentence we find that.

  • The word contemplated is a transitive verb.
  • A transitive verb always needs to transfer it's action on to something which is an object.
  • Hence, here after the transitive verb contemplated we need a noun that will be the object.
  • Out of the given options visiting is a gerund. And therefore it grammatically follows the verb contemplated.

Hence the correct answer is Option 3 i.e visiting.

Important Points

  • gerund is an -ing form of verb which acts as a noun.
  • In the above case, we need a noun after the verb contemplated.
  • And the gerund visiting is the appropriate option as it is a verb acting as a noun.
  • Therefore the action of the verb contemplated is transferred to the gerund visiting.

Thus the correct sentence will be: "I contemplated visiting Singapore for my vacation bu decided against it."

4

Choose the most appropriate word from the options given below to complete the following sentence.

If you are trying to make a strong impression on your audience, you cannot do so by being understated, tentative or_____________.

  1. ((a))

    Hyperbolic

  2. ((b))

    Restrained

  3. ((c))

    Argumentative

  4. ((d))

    Indifferent

Show Answer
Answer: ((b))

Restrained

The correct answer is Option 2 i.e Restrained

Explanation:

Reading the above statement we find that:

  • The tone of the sentence clearly indicates a word similar to understated and tentative.
  • The word should also be an antonym of strong.

Let's look at the meaning of the marked option:

  • Restrained: Not excessively showy or ornate; understated and timid.

Hence from the above meaning, we find that restrained is similar in meaning to understated and tentative, and fits perfectly in the give sentence.

Thus, the correct answer is option 2 Restrained.

Additional Information 

Let's look at the meaning of the other given options. 

  • Hyperbolic: Delibrately; or exaggerated.
  • Argumentative: Given to arguing.
  • Indifferent: Having no particular interest; unconcerned.
5

Choose the word from the options given below that is most nearly opposite in meaning to the given word: Amalgamate

  1. ((a))

    Merge

  2. ((b))

    Split

  3. ((c))

    Collect

  4. ((d))

    Separate

Show Answer
Answer: ((b))

Split

The correct answer is option 2 i.e. Split.

Explanation-

Amalgamate means to unite in or as if in an amalgam, let's have a look at all the given options. 

  • Merge: to cause to combine, unite, or coalesce.
  • Split: to divide lengthwise usually along a grain or seam or by layers
  • Collect: to bring together into one body or place
  • Separate:  to set or keep apart: DISCONNECT, SEVER

Amalgamate means to combine or unite to form one organization or structure. So the best option here is split. Separate on the other hand, although a close synonym, it is too general to be the best antonym in the given question while Merge is the synonym; Collect is not related.

6

Based on the given passage which topic would not be included in a unit on bereavement?

Few school curricula include a unit on how to deal with bereavement and grief, and yet all students at some point in their lives suffer from losses through death and parting.

  1. ((a))

    how to write a letter of condolence

  2. ((b))

    what emotional stages are passed through in the healing process

  3. ((c))

    what the leading causes of death are

  4. ((d))

    how to give support to a grieving friend

Show Answer
Answer: ((c))

what the leading causes of death are

The correct answer is Option 3 i.e what the leading causes of death are

Explanation:

Reading the above statement we find that.

  • The given sentence starts by stating how to deal with bereavement and grief after a tragedy occurs and not about precautions.
  • Therefore, irrespective of the causes of death, a school student rarely gets into details of causes
  • Hence it is very clear that the leading causes of death are not included in a unit on bereavement.

Hence, the correct answer is option 3 i.e what the leading causes of death are.

7

P, Q, R, and S are four types of dangerous microbes recently found in a human habitat. The area of each circle with its diameter printed in brackets represents the growth of a single microbe surviving human immunity system within 24 hours of entering the body. The danger to human beings varies proportionately with the toxicity, potency, and growth attributed to a microbe shown in the figure below.

 

A pharmaceutical company is contemplating the development of a vaccine against the most dangerous microbe. Which microbe should the company target in its first attempt?

  1. ((a))

    P

  2. ((b))

    Q

  3. ((c))

    R

  4. ((d))

    S

Show Answer
Answer: ((d))

S

Concept:

According to the given information:

Most dangerous microbe ∝ probability that microbe will overcome human immune system.

Most dangerous microbe ∝ area (growth of microbe)

Most dangerous microbe ∝ (quantity required)-1

So,the;most;dangerous;microbe;;Probability;×;AreaQuantity;requiredSo, the;most;dangerous;microbe;\propto;\frac{Probability;\times;Area}{Quantity;required}

So,the;most;dangerous;microbe;=;K;×;Probability;×;AreaQuantity;requiredSo, the;most;dangerous;microbe;=;\frac{K;\times;Probability;\times;Area}{Quantity;required}

So,the;most;dangerous;microbe;=;K;×;Probability;×;πd24;×;Quantity;requiredSo, the;most;dangerous;microbe;=;\frac{K;\times;Probability;\times;\pi{d^2}}{4;\times;Quantity;required}

Calculation:

Given:

For microbe P:

Probability (P) = 0.4, Diameter = 50 mm and Quantity required = 800 milligram of microbe/mass of body in kg.

The;most;dangerous;microbe;=πK4×0.4×502800πK4×54=1.25πK4The;most;dangerous;microbe;=\frac{\pi{K}}{4}\times\frac{0.4\times50^2}{800}\Rightarrow\frac{\pi{K}}{4}\times\frac{5}{4}=1.25\frac{\pi{K}}{4}

For microbe Q:

Probability (Q) = 0.5, Diameter = 40 mm and Quantity required = 600 milligram of microbe/mass of body in kg.

The;most;dangerous;microbe;=πK4×0.5×402600πK4×43=1.33πK4The;most;dangerous;microbe;=\frac{\pi{K}}{4}\times\frac{0.5\times40^2}{600}\Rightarrow\frac{\pi{K}}{4}\times\frac{4}{3}=1.33\frac{\pi{K}}{4}

For microbe R:

Probability (R) = 0.4, Diameter = 30 mm and Quantity required = 300 milligram of microbe/mass of body in kg.

The;most;dangerous;microbe;=πK4×0.4×302300πK4×65=1.2πK4The;most;dangerous;microbe;=\frac{\pi{K}}{4}\times\frac{0.4\times30^2}{300}\Rightarrow\frac{\pi{K}}{4}\times\frac{6}{5}=1.2\frac{\pi{K}}{4}

For microbe S:

Probability (S) = 0.8, Diameter = 20 mm and Quantity required = 200 milligram of microbe/mass of body in kg.

The;most;dangerous;microbe;=πK4×0.8×202200πK4×85=1.6πK4The;most;dangerous;microbe;=\frac{\pi{K}}{4}\times\frac{0.8\times20^2}{200}\Rightarrow\frac{\pi{K}}{4}\times\frac{8}{5}=1.6\frac{\pi{K}}{4}

Microbe S > Microbe Q > Microbe P > Microbe R.

∴ toxicity is more for microbe S and the company should target it in its first attempt.

8

The variable cost (V) of manufacturing a product varies according to the equation V= 4q, where q is the quantity produced. The fixed cost (F) of production of same product reduces with q according to the equation F = 100/q. How many units should be produced to minimize the total cost (V+F)?

  1. ((a))

    5

  2. ((b))

    4

  3. ((c))

    7

  4. ((d))

    6

Show Answer
Answer: ((a))

5

Concept:

Total cost = Fixed cost + Variable cost

To find maxima and minima of a function y = f(x), follow these steps.

Step 1

Find;dydx,;and;putdydx=0.Find;\frac{{dy}}{{dx}},;and;put\frac{{dy}}{{dx}} = 0.

Find the value of x and this value is said to be the stationary point, this is a necessary condition to find the extremum value of a function.

Step 2

Find;d2ydx2;Find;\frac{{{d^2}y}}{{d{x^2}}};

Check the value at the stationary point obtained in Step 1.

A function f(x) has a maxima at x = a if f’(a) = 0 and f”(a) < 0

A function f(x) has a minima at x = a if f’(a) = 0 and f”(a) > 0

A function f(x) has no maxima and minima at x = a if f’(a) = 0 and f”(a) = 0.

Calculation:

Given:

F = 100/q, V = 4q

Total cost (TC) = Fixed cost + Variable cost

;TC=4q;+;100q∴;TC=4q;+;\frac{100}{q}

Step 1:

d(TC)dq=0\frac{{d(TC)}}{{dq}} = 0

d(TC)dq=4;;100q2\frac{d(TC)}{dq}=4;-;\frac{100}{q^2}

∴ q = ± 5

d2(TC)dq2=+ve;for;minima\frac{{d^2(TC)}}{{dq^2}} =+ve;for;minima

d2(TC)dq2=ve;for;maxima\frac{{d^2(TC)}}{{dq^2}} =-ve;for;maxima

d2(TC)dq2=200q3\frac{d^2(TC)}{dq^2}=\frac{200}{q^3}

At q = 5

d2(TC)dq2=200531.6;;(+ve;,;;minima)\frac{d^2(TC)}{dq^2}=\frac{200}{5^3}\Rightarrow1.6;;(+ve;,;∴;minima)

At q = -5

d2(TC)dq2=200531.6;;(ve;,;;maxima)\frac{d^2(TC)}{dq^2}=\frac{200}{5^3}\Rightarrow-1.6;;(-ve;,;∴;maxima)

∴ at q = 5, Total cost (TC) will be minimum.

9

A transporter receives the same number of orders each day. Currently, he has some pending orders (backlog) to be shipped. If he uses 7 trucks, then at the end of the 4th day he can clear all the orders. Alternatively, if he uses only 3 trucks, then all the orders are cleared at the end of the 10th day. What is the minimum number of trucks required so that there will be no pending order at the end of the 5th day?

  1. ((a))

    4

  2. ((b))

    5

  3. ((c))

    6

  4. ((d))

    7

Show Answer
Answer: ((c))

6

Concept:

The transporter receives the same number of order each day and he currently has pending orders.

Let 'x' be the number of daily orders and 'y' be the number of pending orders.

Calculation:

Given:

Condition I:

Use of 7 trucks each day finishes all orders in 4 days.

∴ total numbers of trucks used = 7 + 7 + 7 + 7 ⇒ 28.

Total orders received in 4 days = 4x.

Pending orders = y.

∴ 4x + y = 28      eq(1).

Condition II:

Use of 3 trucks each day finishes all orders in 10 days.

∴ total numbers of trucks used = 3 × 10 ⇒ 30.

Total orders received in 10 days = 10x.

Pending orders = y.

∴ 10x + y = 30      eq(2).

Solving eq (1) and eq (2).

x = 0.33 ⇒ Daily orders

y = 26.66 ⇒ Pending orders.

Condition III:

Use of 'n' trucks each day finishes all orders in 5 days.

∴ total numbers of trucks used = 5 × n ⇒ 5n.

Total orders received in 5 days = 5x.

Pending orders = y.

∴ 5x + y = 5n   

∴ (5 × 0.33)  + (26.66) = 5n

∴ n = 5.66 ≈ 6

∴ minimum 6 number of trucks required so that there will be no pending order at the end of the 5th day.

10

A container originally contains 10 litres of pure spirit. From this container 1 litre of spirit is replaced with 1 litre of water. Subsequently, 1 litre of the mixture is again replaced with 1 litre of water and this process is repeated one more time. How much spirit is now left in the container?

  1. ((a))

    7.58 litres

  2. ((b))

    7.84 litres

  3. ((c))

    7 litres

  4. ((d))

    7.29 litres

Show Answer
Answer: ((d))

7.29 litres

Concept:

Volume;of;liquid;left=x(x1x)n{\bf{Volume}};{\bf{of}};{\bf{liquid}};{\bf{left}} = {\bf{x}}{\left( {\frac{{{\bf{x}} - 1}}{{\bf{x}}}} \right)^{\bf{n}}}

where x = Original amount of liquid, n = Number of times replaced.

Calculation:

Given:

x = 10 litre, n = 3

Now, we know that

Volume;of;spirit;left=x(x1x)n{\bf{Volume}};{\bf{of}};{\bf{spirit}};{\bf{left}} = {\bf{x}}{\left( {\frac{{{\bf{x}} - 1}}{{\bf{x}}}} \right)^{\bf{n}}}

∴  Volume of spirit left = 10(10110)3=729100=7.2910{\left( {\frac{{10 - 1}}{{10}}} \right)^3} = \frac{{729}}{{100}} = 7.29  litres

Computer Science and Information Technology (55 questions)

11

In a compiler, keywords of a language are recognized during

  1. ((a))

    parsing of the program

  2. ((b))

    the code generation

  3. ((c))

    the lexical analysis of the program

  4. ((d))

    dataflow analysis

Show Answer
Answer: ((c))

the lexical analysis of the program

The correct answer is option 3.

Concept

Any identifier is also a token so it is recognized by lexical Analyzer and hence it is recognized in the lexical analysis of the program

Phases in a compiler:

12

A layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT

  1. ((a))

    block entire HTTP traffic during 9:00 PM and 5:00 AM

  2. ((b))

    block all ICMP traffic

  3. ((c))

    stop incoming traffic from a specific IP address but allow outgoing traffic to the same IP address

  4. ((d))

    block TCP traffic from a specific user on a multi-user system during 9:00 PM and 5:00 AM

Show Answer
Answer: ((d))

block TCP traffic from a specific user on a multi-user system during 9:00 PM and 5:00 AM

The correct answer is option 4:

Key Points

Since it is Layer-4 Firewall so it includes the layers → Physical Layer, Data Link Layer, Network Layer as well as Transport Layer

Allow →  Transport Layer or those layers who comes below transport Layer

Not Allow → Application Layer

Option 1:  Transport Layer specific

It is possible to block entire traffic by blocking all the traffic on port number 80. so, here don't need to check anything that it is application layer specific or not. we only need to block port number 80 for the required time interval.

Option 2:  Network Layer specific

ICMP is a network layer protocol that comes below the transport layer

Option 3:  Network Layer specific

IP addresses are used in the network layer, which below the transport layer.

Option 4:  Application Layer specific

In this option given that it is a multi-user system, so many users use the same port for communication because of this we can't block any specific port number. if we block a specific port number, all the users also blocked who is using that port number for communication. while we want to block a specific user, so how to do this. We need application layer-specific information of the user like user_id type of things that can't be checked as it is a 4-layer firewall. so it is not possible to allow other users and block some specific at the same time using a 4-layer firewall.

13

If two fair coins are flipped and at least one of the outcomes is known to be a head, what is the probability that both outcomes are heads?

  1. ((a))

    1/3

  2. ((b))

    1/4

  3. ((c))

    1/2

  4. ((d))

    2/3

Show Answer
Answer: ((a))

1/3

Sample space = {HH, HT, TH}

Required probability = 1/3

14

Consider different activities related to email.

m1: Send an email from a mail client to a mail server

m2: Download an email from mailbox server to a mail client

m3: Checking email in a web browser

Which is the application level protocol used in each activity?

  1. ((a))

    m1 : HTTP m2 : SMTP m3 : POP

  2. ((b))

    m1 : SMTP m2 : FTP m3 : HTTP 

  3. ((c))

    m1 : SMTP  m2 : POP m3 : HTTP

  4. ((d))

    m1 : POP m2 : SMTP m3 : IMAP

Show Answer
Answer: ((c))

m1 : SMTP  m2 : POP m3 : HTTP

The correct answer is option 3

SMTP:

  • SMTP stands for Simple Mail Transfer Protocol and it is an application layer protocol.
  • SMTP is used to send an email from a mail client to a mail server.
  • SMTP uses port 25.

POP:

  • POP stands for Post Office Protocol and it is also an application layer protocol.
  • POP allows an email client to download an email from an email server.

HTTP:

The Hypertext Transfer Protocol (HTTP) is an Application Layer protocol and is used to check email in a web browser.

So, m1 : SMTP  m2 : POP m3 : HTTP

15

A company needs to develop a strategy for software product development for which it has a choice of two programming languages L1 and L2. The number of lines of code (LOC) developed using L2 is estimated to be twice the LOC developed with L1. The product will have to be maintained for five years. Various parameters for the company are given in the table below. 

ParameterLanguage L1Language L2
Man years needed for developmentLOC/10000LOC/10000
Development cost per man yearRs. 10,00,000Rs. 7,50,000
Maintenance time5 years5 years
Cost of maintenance per yearRs. 1,00,000Rs. 50,000
<br>

Total cost of the project includes cost of development and maintenance. What is the LOC for L1 for which the cost of the project using L1 is equal to the cost of the project using L2?

  1. ((a))

    10,000

  2. ((b))

    5,000

  3. ((c))

    7,500

  4. ((d))

    75,000

Show Answer
Answer: ((b))

5,000

Data

LOC = lines of code 

Let L1  = x and L2 = 2x

Calculation:

Total cost of the project:

x10000×1000000+5×100000=2x10000×750000+5×50000\frac{x}{10000} \times 1000000 + 5\times 100000 = \frac{2x}{10000}\times750000 + 5 \times 50000

100x + 500000 = 150x + 250000

∴ 50x = 500000 – 250000

∴ x = 25000050=5000\frac{250000}{50} = 5000

∴ L1 = x = 5000

16

Let the time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2. Which of the following is TRUE?

  1. ((a))

    t1 > t2

  2. ((b))

    t1 = t2

  3. ((c))

    t1 < t2

  4. ((d))

    Nothing can be said about the relation between t1 and t2

Show Answer
Answer: ((c))

t1 < t2

The correct answer is t1 < t2

Key Point

Switching between user and kernel modes t1 is generally faster than switching between two processes t2 because:

  • A mode switch (between user and kernel modes) occurs within the same process context, so it does not involve changing the process's memory or CPU registers.
  • A process switch, on the other hand, requires a context switch, which includes saving and loading the state (CPU registers, memory mappings, etc.) of the processes involved. This is a more time-consuming operation than just switching modes within a single process.

Thus, typically, t1 < t2

17

A company needs to develop digital signal processing software for one of its newest inventions. The software is expected to have 40000 lines of code. The company needs to determine the effort in person-months needed to develop this software using the basic COCOMO model. The multiplicative factor for this model is given as 2.8 for the software development on embedded systems, while the exponentiation factor is given as 1.20. What is the estimated effort in person-months?

  1. ((a))

    234.25

  2. ((b))

    932.50

  3. ((c))

    287.80

  4. ((d))

    122.40

Show Answer
Answer: ((a))

234.25

Effort (person per month) = α.(kDSI)n

kDSI = Kilo LOC

= 2.8*(40)1.2

= 2.8*83.6511

= 234.22 (person per month)

18

Which of the following pairs have DIFFERENT expressive power?

  1. ((a))

    Deterministic finite automata (DFA) and Non-deterministic finite automata (NFA)

  2. ((b))

    Deterministic push down automata (DPDA) and Non-deterministic push down automata (NPDA)

  3. ((c))

    Deterministic single-tape Turing machine and Non-deterministic single-tape Turing machine

  4. ((d))

    Single-tape Turing machine and multi-tape Turing machine

Show Answer
Answer: ((b))

Deterministic push down automata (DPDA) and Non-deterministic push down automata (NPDA)

The correct answer is option 2

Option 1: SAME expressive power

NFA and DFA have the same expressive power.

Option 2: DIFFERENT expressive power

Some languages are accepted by NPDA but not by deterministic PDA. Therefore expressive power of DPDA < expressive power of NPDA.

So, deterministic pushdown automata (DPDA) and non-deterministic pushdown automata (NPDA) have DIFFERENT expressive power

Option 3: SAME expressive power

Deterministic single-tape Turing machine and Non-deterministic single-tape Turing machine have the same expressive power

Option 4: SAME expressive power

Multi-tape Turing machines has same power as single tape Turing machines.

19

HTML (Hyper Text Markup Language) has language elements which permit certain actions other than describing the structure of the web document. Which one of the following actions is NOT supported by pure HTML (without any server or client side scripting) pages?

  1. ((a))

    Embed web objects from different sites into the same page

  2. ((b))

    Refresh the page automatically after a specified interval

  3. ((c))

    Automatically redirect to another page upon download

  4. ((d))

    Display the client time as part of the page

Show Answer
Answer: ((c))

Automatically redirect to another page upon download

option 2: supported by pure HTML

Refresh the document every 30 seconds

<head><br>

  <meta http-equiv="refresh" content="30">

</head>

option 3:  NOT supported by pure HTML

Display the client time as part of the page → without Java script it is impossible

20

Which one of the following is NOT desired in a good Software Requirement Specifications (SRS) document?

  1. ((a))

    Functional Requirements

  2. ((b))

    Non-Functional Requirements

  3. ((c))

    Goals of Implementation

  4. ((d))

    Algorithms for Software Implementation

Show Answer
Answer: ((d))

Algorithms for Software Implementation

The correct answer is option 4.

Key Points The software requirements specification document is a detailed explanation of the behavior of a system to be developed, and it may include a set of use cases that describe user interactions with the software. There are also non-functional requirements in it. Non-functional requirements impose design constraints.

The following aspects of a system should be documented in an SRS document: Implementation Goals, Functional and Non-Functional Requirements. An algorithm for Software Implementation is required in the later stages of the software development process.

Hence the correct answer is Algorithms for Software Implementation.

21

A computer handles several interrupt sources of which the following are relevant for this question.

Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too high)

Interrupt from Mouse (raises interrupt if the mouse is moved or a button is pressed)

Interrupt from Keyboard (raises interrupt when a key is pressed or released)

​Interrupt from Hard Disk (raises interrupt when a disk read is completed)

​Which one of these will be handled at the HIGHEST priority?

  1. ((a))

    Interrupt from Hard Disk

  2. ((b))

    Interrupt from Mouse

  3. ((c))

    Interrupt from Keyboard

  4. ((d))

    Interrupt from CPU temperature sensor

Show Answer
Answer: ((d))

Interrupt from CPU temperature sensor

The correct answer is option 4

Key Points

  • Higher priority interrupt levels are assigned to requests which if delayed or interrupted could have serious consequences. Devices with high-speed transfer such as magnetic disks are given high priority and slow devices such as keyboards are given low priority.
  • Since mouse pointer movements are more frequent than keyboard ticks. So it's obvious that its data transfer rate is higher than the keyboard.
  • Interrupt from the CPU temperature sensor would have serious consequences if we ignored it and overheat can damage CPU circuitry.

Shortcut Trick

Priority with respect to interrupt

CPU temperature sensor > Hard Disk > Mouse > Keyboard.

22

Consider a relational table with a single record for each registered student with the following attributes.

1. Registration_Num: Unique registration number of each registered student 2. UID: Unique identity number, unique at the national level for each citizen 3. Bank Account_Num: Unique account number at the bank. A student can have multiple accounts or joint accounts. This attribute stores the primary account number. 4. Name: Name of the student 5. Hostel_Room: Room number of the hostel

Which of the following options is INCORRECT?

  1. ((a))

    Bank Account_Num is a candidate key

  2. ((b))

    Registration_Num can be a primary key

  3. ((c))

    UID is a candidate key if all students are from the same country

  4. ((d))

    If S is a superkey such that S∩UID is NULL then S∪UID is also a superkey

Show Answer
Answer: ((a))

Bank Account_Num is a candidate key

Key PointsOption 1: Bank Account_Num is a candidate key

False, If two students hold a joint account then BankAccount_Num is not a candidate key and will not uniquely determine other attributes.

Option 2: Registration_Num can be a primary key

True, A Unique registration number of each registered student is a candidate key and uniquely determines other attributes.

Option 3: UID is a candidate key if all students are from the same country

True, Unique identity number, unique at the national level for each citizen is a candidate key and uniquely determines other attributes.

Option 4: If S is a superkey such that S∩UID is NULL then S∪ UID is also a superkey

True, Let's consider super key is  Registration_Num  and Registration_Num ∩UID is NULL then  Registration_Num ∪ UID is also a superkey.

Hence the correct answer is Bank Account_Num is a candidate key.

23

Which one of the following circuits is NOT equivalent to a 2-input XNOR (exclusive NOR) gate?

  1. ((a))

  2. ((b))

  3. ((c))

  4. ((d))

Show Answer
Answer: ((d))

The correct answer is option 4

Formula:

A ⊕ B = A.B̅   + A̅ .B 

A ⊙ B = A̅ .B̅   + A.B 

EXPLANATION

Let's take 2-input variable A and B

Option 1: It is XNOR

AB=A.B+A.B\overline{A\oplus B} = \overline{A.\overline{B} + \overline{A}.B}

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

= A̅ .B̅   + A.B 

= A ⊙ B

Option 2: It is XNOR

AB=.AB+A.B\overline{\overline{A}\oplus \overline{B}} = \overline{.\overline{A}{B} + A.\overline{B}}

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

= A.B + A̅ .B̅ 

= A ⊙ B

Option 3: It is XNOR

AB=A.B+A.B{\overline{A}\oplus {B}} = {\overline{A}.\overline{B} +{A}.B}

= A ⊙ B

Option 4: It is NOT XNOR

Make changes in the above diagram

It is XOR

24

The simplified SOP (Sum of Product) form of the Boolean expression

(P + Q̅ + R̅)⋅(P + Q̅ + R)⋅(P + Q + R̅) is

  1. ((a))

    (P̅.Q + R̅)

  2. ((b))

    (P + Q̅.R̅)

  3. ((c))

    (P̅.Q + R)

  4. ((d))

    (P.Q + R)

Show Answer
Answer: ((b))

(P + Q̅.R̅)

The correct answer is option 2

Some laws of Boolean Algebra:

Distributive Law:

  • P +QR = (P + Q).(P + R)
  • P(Q + R) = PQ + PR

Inverse Law:

  • PP̅ =0
  • P + P̅ =1
<br>

EXPLANATION:

F = (P + Q̅ + R̅)⋅(P + Q̅ + R)⋅(P + Q + R̅)

F= ((P + Q̅) + R̅.R)(P + Q + R̅)

F = (P + Q̅)(P + Q + R̅)

F = P + Q̅.(Q + R̅)

F = P + Q̅R̅

25

The minimum number of D flip-flops needed to design a mod-258 counter is

  1. ((a))

    9

  2. ((b))

    8

  3. ((c))

    512

  4. ((d))

    258

Show Answer
Answer: ((a))

9

The correct answer is option 1

Concept:

Binary modulo N counter can count up to 0 to N – 1

Therefore, binary modulo 258 counters will count from 0 to 257 (order may vary)

Formula:

Minimum number of flip flop needed = ⌈log2 N⌉

Calculation:

An n-bit binary counter consists of n flip-flops and can count in binary from 0 to 2n – 1

Mod 258 counter has 258 states. We need to find the number of bits to represent max 257

log2n=log2258=9\lceil{log_2n}\rceil = \lceil{log_2258}\rceil =9 bits required

So the minimum number of D flip-flops needed is 9.

26

A thread is usually defined as a “light weight process” because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?

  1. ((a))

    On per-thread basis, the OS maintains only CPU register state

  2. ((b))

    The OS does not maintain a separate stack for each thread

  3. ((c))

    On per-thread basis, the OS does not maintain virtual memory state

  4. ((d))

    On per-thread basis, the OS maintains only scheduling and accounting information

Show Answer
Answer: ((c))

On per-thread basis, the OS does not maintain virtual memory state

The correct answer is option 3

Concept:

Multiple threads of the same process share other resources of the process except for register, stack, and stack pointer. In particular, a process is generally considered to consist of a set of threads sharing an address space, heap, static data, code segments, and file descriptors.

Thread of the same process doesn't share program counter (register), stack,  registers

Option 1:  FALSE

On a per-thread basis, the OS maintains only the CPU register state → Incorrect statement

Because in the above figure not only CPU register maintained by OS but also maintained code, data, files, stack.

Option 2:  FALSE

The OS does not maintain a separate stack for each thread → Incorrect statement

Because OS maintained a separate stack for each thread as shown in the above figure

Option 3:  TRUE

On a per-thread basis, the OS does not maintain a virtual memory state →  Correct statement

Because OS does not maintain a virtual memory state for an individual thread 

So, it is a true statement.

Option 4:  FALSE

On a per-thread basis, the OS maintains only scheduling and accounting information → Incorrect statement

Because OS maintains not only scheduling and accounting information but also maintained code, data, files, stack.

27

K4 and Q3 are graphs with the following structures.

Which one of the following statements is TRUE in relation to these graphs?

  1. ((a))

    K4 is planar while Q3 is not

  2. ((b))

    Both K4 and Q3 are planar

  3. ((c))

    Q3 is planar while K3 is not

  4. ((d))

    Neither K4 nor Q3 is planar

Show Answer
Answer: ((b))

Both K4 and Q3 are planar

The correct answer is option 2

Concept:

A planar graph is a graph in which no two edges cross each other. A vertex coloring of a graph is an assignment of colors to the vertices of a graph such that adjacent vertices have different colors.

Explanation:

So, both K4 and Q3 are planar.

28

If the difference between the expectation of the square of a random variable (E[X2]) and the square of the expectation of the random variable (E[X])2 is denoted by R, then

  1. ((a))

    R = 0

  2. ((b))

    R < 0

  3. ((c))

    R ≥ 0

  4. ((d))

    R > 0

Show Answer
Answer: ((c))

R ≥ 0

Concept:

Random variables:

Random variable assigns a real number to each possible outcome.

Let X be a discreet random variable,then

The variance of X = R =E[X2]- (E[X])2

Explanation:

  • The difference between the expectation of the square of a random variable (E[X2]) and the square of the expectation of the random variable (E[X])2 is called the variance of a random variable
  • Variance measure how far a set of numbers is spread out
  • A variance of zero(R=0) indicates that all the values are identical
  • A variance of X = R =E[X2]- (E[X])2 This quantity is always non-negative as it is an expectation of a non-negative quantity
  • A non-zero variance is always positive means R > 0

So, R ≥ 0 is the answer.

29

The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?

  1. ((a))

    Finite state automata

  2. ((b))

    Deterministic pushdown automata

  3. ((c))

    Non-deterministic pushdown automata

  4. ((d))

    Turing machine

Show Answer
Answer: ((a))

Finite state automata

The correct answer is option 1

Finite Automata(FA):

  • The first phase of the compiler is called lexical analysis or scanning. The lexical analyzer reads the stream of characters making up the source program and groups the characters into a meaningful sequence called lexemes.
  • For each lexeme, the lexical analyzer produces tokens as output for the parser and tokens are expressed in regular expressions

So, a simple Finite Automata is sufficient for it

Phases in a compiler:

Additional Information

Compiler PhaseMachine Model Required
Lexical Analysis PhaseFinite Automata
Syntax Analysis PhasePush Down Automata
Semantic Analysis PhaseTuring Machine(TM)
30

Let the page fault service time be 10 ms in a computer with average memory access time being 20 ns. If one page fault is generated for every 106 memory accesses, what is the effective access time for the memory?

  1. ((a))

    21 ns

  2. ((b))

    30 ns

  3. ((c))

    23 ns

  4. ((d))

    35 ns

Show Answer
Answer: ((b))

30 ns

The correct answer is option 2

Data:

page fault service time = S = 10 ms = 107 ns

page fault rate = p = 1106\frac{1}{10^{6}}

memory access time = m = 20 ns

Formula:

Effective Memory access time (EMAT) = p × (S + m) + (1 - p) × m

∴ EMAT = p×S + m 

Calculation: 

EMAT = 1106\frac{1}{10^{6}}× 107 + 20 = 10 + 20

EMAT = 30 ns

31

Consider a hypothetical processor with an instruction of type LW R1, 20 (R2), which during execution reads a 32-bit word from memory and stores it in a 32-bit register R1. The effective address of the memory location is obtained by the addition of a constant 20 and the contents of register R2. Which of the following best reflects the addressing mode implemented by this instruction for the operand in memory?

  1. ((a))

    Immediate Addressing

  2. ((b))

    Register Addressing

  3. ((c))

    Register Indirect Scaled Addressing

  4. ((d))

    Base Indexed Addressing

Show Answer
Answer: ((d))

Base Indexed Addressing

Concept

Index addressing mode/ Base indexed addressing/ Base register indexed addressing:

Addresses have two parts: the number of an index register and a constant. The address of the operand is the sum of the constant and the contents of the index register. It contains indexed (direct) addressing, indexed immediate addressing, and indexed indirect addressing.

Explanation:

Base indexed addressing, as content in the R2 used as an indexed and base address will be 20

Example:

Let us have an array of addresses (in memory) where the data is present and we want to access the data that is present at address 25

Data79325......11
Address2021232425........50

LW R1, 20 (R2),

We have an indexed register R2 in which the index value 5 is present and then this indexed value is added to the base address 20 to get the desired location where the data is present and then transfer to R1

Effective address(EA) =Base address + Indexed register(R)

Effective address(EA) =20 +5 =25

Now, we get the data 5 at address 25, then it is loaded to the R1

Additional Information

Immediate Addressing:

Immediate addressing provides the operand value in the instruction itself for example adding a constant 5 to the accumulator value.

Register indirect addressing mode:

In register indirect addressing mode, the data to be operated is available inside a memory location and that memory location is indirectly specified by a register pair.

Register addressing mode:

In register addressing mode, the data to be operated is available inside the register(s) and register(s) is(are) operands. Therefore, the operation is performed within various registers of the microprocessor

32

What does the following fragment of C program print?

char c[ ]= "GATE2011";

char *p = c;

printf("%s", p + p [3]  - p [1]);

  1. ((a))

    GATE2011

  2. ((b))

    E2011

  3. ((c))

    2011

  4. ((d))

    011

Show Answer
Answer: ((c))

2011

The correct answer is option 3

EXPLANATION:

Assumed Address100101102103104105106107108
characterGATE2011\0

Let ASCII value of A be x and therefore the ASCII value of E will be x + 4

*char p = c;  //p is a pointer of type char that points to the starting address of character array

printf("%s", p + p [3] - p [1]);  // This will print the string from where updated pointer p points to the address( which is 104).

p = p + p [3] - p [1]

p = 100 + 'E' - 'A' = 100 + (x+4) - (x) = 104 = starting address

printf("%s", p); 

Therefore output is 2011

33

A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?

  1. ((a))

  2. ((b))

  3. ((c))

  4. ((d))

Show Answer
Answer: ((b))

The correct answer is option 2

CONCEPT:

A max-heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node.

Explanation:

Option 1: not a max heap

Since there is no right child for element 8. Hence it is not a complete binary tree. Therefore it is not a max heap

Option 2: max heap

Follow max heap properties

Option 3: not a max heap

Reason:

In a max heap, the keys of parent nodes are always greater than or equal to those of the children

but in this option, the child node 8 is greater than parent node 5.

Option 4: not a max heap

Reason:

In a max heap, the keys of parent nodes are always greater than or equal to those of the children

but in this option child node, 10 is greater than parent node 8.

34

Let P be a regular language and Q be a context-free language such that Q ⊆ P. (For example, let P be the language represented by the regular expression pqand Q be |pnqn | n ϵ N}). Then which of the following is ALWAYS regular?

  1. ((a))

    P ∩ Q

  2. ((b))

    P - Q

  3. ((c))

    σ* - P

  4. ((d))

    σ* - Q

Show Answer
Answer: ((c))

σ* - P

Key Points

Option 1: P ∩ Q 

Regular ∩ context-free is context-free and not regular. (pnqn  ∩ pq )=pnqn is context-free.

Option 2: P-Q

Regular-context-free

Regular∩ not context-free is not even context-free and not regular.

Option 3: Σ* − P

Σ* − P is an equivalent complement of P, hence regular. 

Option 4: Σ − Q*

Σ* − Q is an equivalent complement of Q and  It is not even context-free and not regular. 

Hence the correct answer is Σ* − P.

Additional Information 

35

An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0 : n - 1] is given below.

Let Li denote the length of the longest monotonically increasing sequence starting at index i in the array.

Initialize Ln-1 = 1

For all i such that 0 ≤ i ≤ n - 2

\(L_i=\left{\begin{matrix}1+L_{i+1}&\rm if\ A[i]<A[i+1]\\ 1&\rm otherwise\end{matrix}\right.\)

Finally the length of the longest monotonically increasing sequence is Max (L0, L1, ... Ln-1).

Which of the following statements is TRUE?

  1. ((a))

    The algorithm uses dynamic programming paradigm

  2. ((b))

    The algorithm has a linear complexity and uses branch and bound paradigm

  3. ((c))

    The algorithm has a non-linear polynomial complexity and uses branch and bound paradigm

  4. ((d))

    The algorithm uses divide and conquer paradigm.

Show Answer
Answer: ((a))

The algorithm uses dynamic programming paradigm

The correct answer is Option 1.

Key Points

  • The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order. For example ,a[] = {3, 10, 2, 1, 20} Output: Length of LIS = 3 The longest increasing subsequence is 3, 10, 20.
  • We can see that there are many subproblems in the above recursive solution which are solved again and again. So this problem has Overlapping Substructure property and re-computation of same subproblems can be avoided by either using memorization or tabulation.
  • If we closely observe the problem then we can convert this problem to longest Common Subsequence Problem. Firstly we will create another array of unique elements of original array and sort it. Now the longest increasing subsequence of our array must be present as a subsequence in our sorted array. That’s why our problem is now reduced to finding the common subsequence between the two arrays.

Hence the correct answer is The algorithm uses dynamic programming paradigm.

36

Consider the languages L1, L2 and L3 as given below.

L1 = {0p1q | p, q ∈ N},

L2 = {0p1q | p, q ∈ N and p = q} and

L3 = {0p1q0r | p, q, r ∈ N and p = q = r}. Which of the following statements is NOT TRUE?

  1. ((a))

    Push Down Automata (PDA) can be used to recognize L1 and L2

  2. ((b))

    L1 is a regular language

  3. ((c))

    All the three languages are context free

  4. ((d))

    Turing machines can be used to recognize all the languages

Show Answer
Answer: ((c))

All the three languages are context free

The correct answer is option 3.

Key Points

Statement I: L1 = {0p1q | p, q ∈ N},

Regular expression: 0+1+

Here, any number of 0's followed by any number of 1's. L1 requires no stack. Hence L1 is regular.

Every regular language is a context-free language.

Statement II: L2 = {0p1q | p, q ∈ N and p = q}

Context-Free Language: L2 =  {0p1p | p ∈ N}

Here, the number of 0's is equal to the number of 1's. L2 requires only one stack. Hence L2 is context-free language.

Statement III: L3 = {0p1q0r | p, q, r ∈ N and p = q = r}.

context Sensitive language: L3 = {0p1p0p | p  ∈ N}.

Here, the number of 0's followed by the equal number of 1's followed by equal to number 0's. It depends on three symbols. L3 requires two stacks. Hence L3 is a context-sensitive language.

It is not a context-free language

Additional Information

 

37

Consider two binary operators ‘↑’ and ‘↓’ with the precedence of operator ↓ being lower than that of the operator ↑. Operator ↑ is right associative while operator ↓ is left associative. Which one of the following represents the parse tree for expression (7↓3↑4↑3↓2)?

  1. ((a))

  2. ((b))

  3. ((c))

  4. ((d))

Show Answer
Answer: ((b))

The correct answer is Option 2.

Key Points

OperatorPrecedenceAssociative
HighRight associative
.↓LowLeft associative

 

Option 1: FALSE

7↓3↑4↑3↓2

= (7↓(3↑(4↑(3↓2))))     // order of execution

Since ↓ has higher precedence and therefore it is not correct

Option 2: TRUE

7↓3↑4↑3↓2

=7↓(3↑(4↑3))↓2

=(7↓(3↑(4↑3)))↓2     // order of execution

Since ↓ has left-associative and ↑ has  right-associative

Also ↑ has higher precedence and ↑ has lower precedence. 

Therefore it is correct.

Option 3: FALSE

7↓3↑4↑3↓2

7↓(((3↑4)↑3)↓2)     // order of execution

Since ↑ is left associative and therefore it is not correct

Option 4: FALSE 

7↓3↑4↑3↓2

(((7↓3)↑4)↑3)↓2)     // order of execution

Since ↑ is left-associative and therefore it is not correct

38

On a non-pipelined sequential processor, a program segment, which is a part of the interrupt service routine, is given to transfer 500 bytes from an I/O device to memory.

Initialize the address register

Initialize the count to 500

LOOP: Load a byte from device

Store in memory at address given by address register

Increment the address register

Decrement the count

If count ! = 0 go to LOOP

Assume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two clock cycles to execute.

The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory.

What is the approximate speedup when the DMA controller based design is used in place of the interrupt-driven program based input-output?

  1. ((a))

    3.4

  2. ((b))

    4.4

  3. ((c))

    5.1

  4. ((d))

    6.7

Show Answer
Answer: ((a))

3.4

The correct answer is option 1.

Calculation:

Non-pipelined system require ,

(2+2+1+1+1)×500 cycles+1+1=3502 cycles(2+2+1+1+1) \times 500 \space cycles +1+1=3502 \space cycles

DMA clock need = 20+2×50020+2 \times 500

                           = 1020 cycles

Speed up  = 350210203502 \over 1020

Speed up  = 3.43

Hence the correct answer is 3.4.

39

We are given a set of n distinct elements and an unlabeled binary tree with n nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree?

  1. ((a))

    0

  2. ((b))

    1

  3. ((c))

    n!

  4. ((d))

    1n+12nCn\dfrac{1}{n+1}\cdot^{2n}C_n

Show Answer
Answer: ((b))

1

The correct answer is 1.

Key Points

Only one way for a given particular unlabeled binary tree is possible.

Example:

If a given particular unlabeled binary tree is, For keys 1,2,3,4,5,6 the only one arrangement is possible.

Hence the correct answer is 1.

Additional Information

The number of distinct binary search trees possible for n nodes is similar to counting the no. of distinct binary trees possible for n nodes assuming nodes are unlabeled. Hence, this value will also be  2nCn(n+1){^{2n}C_n } \over (n+1)

40

Which one of the following options is CORRECT given three positive integers x, y and z, and a predicate

P(x)= - (x = 1) ∧ ∀ y(∃z(x=y*z) ⇒ (y = x) ∨ (y = 1))

  1. ((a))

    P(x) being true means that x is a prime number

  2. ((b))

    P(x) being true means that x is a number other than 1

  3. ((c))

    P(x) is always true irrespective of the value of x

  4. ((d))

    P(x) being true means that x has exactly two factors other than 1 and x

Show Answer
Answer: ((a))

P(x) being true means that x is a prime number

The correct answer is option 1.

Key Points

Precedence of logical operators
operatorsprecedence
-           NOT1
∧           AND2
∨           OR3
⇒          conditional4
⇔          bi-conditional5
<br>

The given predicate is, 

P(x)= -(x = 1) ∧ ∀ y(∃z(x=y*z) ⇒ (y = x) ∨ (y = 1))

If x is a prime number then (x ≠ 1 and the only divisors of x are x and 1)

∴P(x) is true means x is a prime number.

Hence the correct answer is P(x) being true means that x is a prime number.

41

Given i = √-1, what will be the evaluation of the definite integral 0π/2cosx+isinxcosxisinxdx\displaystyle\int^{\pi/2}_0{\dfrac{\cos x+i\sin x}{\cos x-i \sin x}}dx ?

  1. ((a))

    0

  2. ((b))

    2

  3. ((c))

    -i

  4. ((d))

    i

Show Answer
Answer: ((d))

i

The correct answer is option 4.

Calculation:

0π/2cosx+isinxcosxisinxdx\displaystyle\int^{\pi/2}_0{\dfrac{\cos x+i\sin x}{\cos x-i \sin x}}dx

According to Euler’s formula, eiθ=cosθ+isinθ eiθ=cosθisinθe^{iθ} = cos θ + i sin θ \ e^{-iθ} = cos θ - i sin θ

Therefore

eix=cosx+isinx eiθ=cosθisinθ I=0πeixeixdx I=0π2ei2xdxe^{ix} = cos x+ isinx \ e^{-iθ} = cos θ - i sin θ \ I=\int_{0}^π{ e^{ix} \over e^{-ix} } dx \ I =\int_{0}^{π \over 2}{ e^{i2x} } dx

\( \ I = [{ e^{i2x} \over 2i}]{0}^{π \over 2} \ I= {1 \over 2i}[cos2x+isin2x ]{0}^{π \over 2} \ I= {1 \over 2i} \times (-2) \I={ -1 \over i } \I=i \space \space \space \space \space \space \space \space (∵ {1 \over i} =-i) \)

Hence the correct answer is i.

42

Consider a database table T containing two columns X and Y each of type integers. After the creation of the table, one record (X= 1, Y=1) is inserted in the table.

Let MX and MY denote the respective maximum values of X and Y among all records in the table at any point in time. Using M X and MY, new records are inserted in the table 128 times with X and Y values being MX + 1, 2*MY + 1 respectively. It may be noted that each time after the insertion, values of MX and MY change.

What will be the output of the following SQL query after the steps mentioned above are carried out?

SELECT Y FROM T WHERE X=7;

  1. ((a))

    127

  2. ((b))

    255

  3. ((c))

    129

  4. ((d))

    257

Show Answer
Answer: ((a))

127

XY
11
23
37
415
531
663
7127
43

Consider a finite sequence of random values X = [x1, x2, .... xn]. Let μx, be the mean and σx, be the standard deviation of X. Let another finite sequence Y of equal length be derived from this as yi = a* xi + b, where a and b are positive constants. Let μy, be the mean and σy be the standard deviation of this sequence. Which one of the following statements is INCORRECT?

  1. ((a))

    Index position of mode of X in X is the same as the index position of mode of Y in Y.

  2. ((b))

    Index position of median of X in X is the same as the index position of median of Y in Y.

  3. ((c))

    μy = aμx + b

  4. ((d))

    σy= aσx + b

Show Answer
Answer: ((d))

σy= aσx + b

The correct answer is option 4.

Key Points

Index position of mode and median are the same. So option 1 and option 2 is not the answer.

μy = aμx + b

Correct, Yi = a X+ b

          ΣYi=Σ(aXi+b) ΣYi=a(ΣXi)+nb (ΣYi)n=a(ΣXi)n+bΣY_i = Σ(aX-i+b) \ ΣY_i=a(ΣXi)+n b \ {(Σ Y_i) \over n }={a(ΣX_i) \over n}+b

          μy = aμx + b

σy= aσx + b

Incorrect: variance of the constant is zero.

           σy=1nΣ(μyYi)2 σy=1nΣ(μx+bYi)2 σy=1nΣ(aμx+baXib)2 σy=1nΣ(aμxaXi)2 σy=a1nΣ(μxXi)2 σy=aσxσ_y= \sqrt { {1 \over n} Σ(μ_y - Y_i)^2 } \ σ_y= \sqrt { {1 \over n} Σ(μ_x+b - Y_i)^2 } \ σ_y= \sqrt { {1 \over n} Σ(aμ_x+b -aX_i-b)^2 } \ σ_y= \sqrt { {1 \over n} Σ(aμ_x-aX_i)^2 } \ σ_y= a \sqrt { {1 \over n} Σ(μ_x-X_i)^2 } \ σ_y= a σ_x

           σy= a σx

Hence the correct answer is σy= aσx + b

44

A deck of 5 cards (each carrying a distinct number from 1 to 5) is shuffled thoroughly. Two cards are then removed one at a time from the deck. What is the probability that the two cards are selected with the number on the first card being one higher than the number on the second card?

  1. ((a))

    1/5

  2. ((b))

    4/25

  3. ((c))

    1/4

  4. ((d))

    2/5

Show Answer
Answer: ((a))

1/5

The correct answer is option 1.

EXPLANATION:

There are 5 cards (each carrying a distinct number from 1 to 5) in the deck. 

-1,21,31,41,5
2,1-2,32,42,5
3,13,2-3,43,5
4,14,24,3-4,5
5,15,25,35,4-

 

So arranging two cards among 5 cards, sample space will 5p3= 20 ways.

S → Total sample space.

n(S) = 20

E → Two cards are selected with the number on the first card being one higher than the number on the second card.

n(E)= {(2,1), (3,2), (4,3), (5,4) } = 4 ways

P(E)=n(E)n(S)=420=15\frac{n(E)}{n(S)}={4 \over 20 }= {1 \over 5}

Hence the correct answer is 151 \over 5.

45

Consider the following table of arrival time and burst time for three processes P0, Pl and P2.

ProcessArrival timeBurst Time
P00 ms9 ms
P11 ms4 ms
P22 ms9 ms
<br>

The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?

  1. ((a))

    5.0 ms

  2. ((b))

    4.33 ms

  3. ((c))

    6.33 ms

  4. ((d))

    7.33 ms

Show Answer
Answer: ((a))

5.0 ms

The correct answer is option 1.

Concept:

Shortest Remaining Time First is a preemptive shortest job first scheduling algorithm, in which the process with the smallest amount of burst time is executed in the CPU.

Formula:

TAT = CT - AT

WT = TAT - BT

Calculation:

GANTT CHART:

ProcessATBTCTTATWT
P00913134
P114540
P229222011
<br>

Average waiting time = (4+0+11)3=153=5{{(4+0+11)} \over 3}={15 \over 3 }=5

Hence the correct answer is5.

NOTE:

TAT = Turn Around Time

CT = Completion Time

WT = Waiting Time

BT = Burst Time

AT = Arrival Time

46

Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be accessed only through load and store instructions. The variables a, b, c, d and e are initially stored in memory. The binary operators used in this expression tree can be evaluated by the machine only when the operands are in registers. The instructions produce result only in a register. If no intermediate results can be stored in memory, what is the minimum number of registers needed to evaluate this expression?

  1. ((a))

    2

  2. ((b))

    9

  3. ((c))

    5

  4. ((d))

    3

Show Answer
Answer: ((d))

3

Answer: Option 4

Explanation:

Exp –    Load R1, a ; R1   ← M[a]

Load R2, b ; R2   ← M[b]

Sub R1, R2 ;  R1    ←  R1 - R2

Load R2, c  ; R2      ←  M[c]

Load R3, d  ; R3     ←  M[d]

Add R2, R3 ; R2   ←  R2 + R3

Load R3, e  ; R3      ←  M[e]

Sub R3, R2  ; R3   ←  R3 - R2

Add  R1, R3  ; R1   ←  R1 + R3

Total 3 Registers are required minimum.

47

Which of the given Options provides the increasing order of asymptotic complexity of functions f1, f2, f3, and f4?

f1(n) = 2n f2(n) = n3/2 f3(n) = n log2 n f4(n) = nlog2n

  1. ((a))

    f3, f2, f4, f1

  2. ((b))

    f3, f2, f1, f4

  3. ((c))

    f2, f3, f1, f4

  4. ((d))

    f2, f3, f4, f1

Show Answer
Answer: ((a))

f3, f2, f4, f1

The correct answer is option 1

Explanation:

Taking log base 2 on all the functions

FunctionTaking logTaking a large number n = 220
f1(n) = 2nf1(n) = n× log22 = nf1 = 220
f2(n) = n3/2f2(n) = 3/2 log2nf2 = (3/2) × log2220= (3/2)× 20 =30
f3(n) = n × log2 nf3(n) = log2 n +log2 log2 nf3 = log2220 +log2 log2 220 = 25
f4(n) = nlog2nf4(n) = log2 n × log2 nf4 =  log22 20× log2 220= 20 × 20=400

 Increasing order of asymptotic complexity of functions f1, f2, f3 and f4  is f3 < f2 <f4 <​ f1

48

Four matrices M1, M2, M3 and M4 of dimensions p × q, q × r, r × s and s × t respectively can be multiplied in several ways with different number of total scalar multiplications. For example when multiplied as ((M1 ×  M2) × (M3 × M4)), the total number of scalar multiplications is part rst+ prt. When multiplied as ((M1 ×  M2) × (M3 )× M4), the total number of scalar multiplications is pqr+ prs + pst .

If p = 10, g = 100, r = 20, s = 5, and t = 80, then the minimum number of scalar multiplications needed is

  1. ((a))

    248000

  2. ((b))

    44000

  3. ((c))

    19000

  4. ((d))

    25000

Show Answer
Answer: ((c))

19000

The correct answer is option 3

Concept:

If we multiply two matrices [A]l × m and [B]m × n

Then the number of scalar multiplications required = l × m × n

Data:

Given 4 matrix are given with their dimensions

MatrixM1M2M3M4
Dimensionp× qq× rr× ss× t
Dimension10×100100×2020×55×80

Calculation:

Total number of ways of multiplication =2nCnn+1\frac{^{2n}C_n}{n+1}

n = 4 - 1 = 3

Total number of ways of multiplication =2nCnn+1\frac{^{2n}C_n}{n+1} =5

There are 5 ways in which we can multiply these 4 matrices.

  1. (M1M2)(M3M4)
  2. M1 ((M2M3) M4)
  3. M1(M2(M3M4))
  4. ((M1M2)M3)M4
  5. (M1(M2M3))M4
(M10×100 × M100× 20 )(M20× 5 × M5× 80)10×100×20 +20× 5×80 +10×20×80 =44,000
M10×100 × ( (M100× 20 × M20× 5 )× M5× 80)10×100×80 +100×20×5 +100×5×80 =130,000
M10×100 × ( M100× 20 × (M20× 5 × M5× 80))10×100×80 +100×20×80 +20×5×80 = 248,000
( (M10×100 × M100× 20 )× M20× 5 )× M5× 8010×100×20 +10×20×5 +10×5×80 =25,000
( (M10×100 ×( M100× 20 × M20× 5 ))× M5× 8010×100×5 +100×20×5 +10×5×80 =19,000

The minimum number of scalar multiplication can find out using (M1(M2M3))M4

(M1(M2M3))M4 =19,000

Shortcut Trick

Frist find scaler multiplication of those which are common in some of the 5 ways of multiplication

then it will become easy to solve

(M1M2) is common in 1 and 4

(M2M3) is common in 2 and 5

(M3M4) is common in 1 and 3

49

Consider a relational table r with sufficient number of records, having attributes A1, A2,..., An and let 1 ≤ p ≤ n. Two queries Q1 and Q2 are given below.

Q1:πAi...Ap(σAp=c(r))Q1:\pi_{A_i...A_p}(\sigma_{A_p=c(r)}) where c is a constant

Q2:πAi...Ap(σc1Apc2(r))Q2:\pi_{A_i...A_p}(\sigma_{c_1\le A_p\le c_2}(r)) where c1 and c2 are constant

The database can be configured to do ordered indexing on Ap or hashing on Ap. Which of the following statements is TRUE?

  1. ((a))

    Ordered indexing will always outperform hashing for both queries

  2. ((b))

    Hashing will always outperform ordered indexing for both queries

  3. ((c))

    Hashing will outperform ordered indexing on Q1, but not on Q2

  4. ((d))

    Hashing will outperform ordered indexing on Q2, but not on Q1

Show Answer
Answer: ((c))

Hashing will outperform ordered indexing on Q1, but not on Q2

The correct answer is option 3.

Key Points

Query 1: Q1:πAi...Ap(σAp=c(r))Q1:\pi_{A_i...A_p}(\sigma_{A_p=c(r)})

Returns only a few tuples that satisfy the condition, therefore it requires Hashing. If the record is accessed for a particular value from the table, hashing will do better.

Query 2: Q2:πAi...Ap(σc1Apc2(r))Q2:\pi_{A_i...A_p}(\sigma_{c_1\le A_p\le c_2}(r))

Returns the range of tuples based on condition therefore it requires an ordered index. If records are accessed in a range of values, ordered indexing will perform better.

Hence the correct answer is Hashing will outperform ordered indexing on Q1, but not on Q2

Additional Information

Indexing:

Indexing is a data structure technique to efficiently retrieve records from database files based on some attributes on which the indexing has been done. Indexing in database systems is similar to the one we see in books. The ordering field is the field on which the records of the file are ordered. It can be different from the primary or candidate key of a file.

Hashing:

In a huge database structure, it is very inefficient to search all the index values and reach the desired data. Hashing technique is used to calculate the direct location of a data record on the disk without using an index structure.

50

Consider the matrix as given below.

[123047003]\begin{bmatrix}1&2&3\\ 0&4&7\\ 0&0&3\end{bmatrix}

Which one of the following options provides the CORRECT values of the eigenvalues of the matrix?

  1. ((a))

    1, 4, 3

  2. ((b))

    3, 7, 3

  3. ((c))

    7, 3, 2

  4. ((d))

    1, 2, 3

Show Answer
Answer: ((a))

1, 4, 3

The correct answer is option 1

Concept:

Eigenvalues of the upper triangles matrix or lower triangular matrix are just the diagonal elements of the matrix.

Calculation:

In the given matrix below,

P = [123047003]\begin{bmatrix}1&2&3\\ 0&4&7\\ 0&0&3\end{bmatrix}

Diagonal elements are 1, 4, and 3, so,1, 4, 3 are the eigenvalues

Alternate Method

On applying |P - λI| = 0 yields

\(\left| {\begin{array}{*{20}{c}} {1 - \lambda }&1&0\ 0&{4 - \lambda }&1\ 0&0&{3 - \lambda } \end{array}} \right| = 0 \Rightarrow \left( {1 - \lambda } \right)\left( {4 - \lambda } \right)\left( {3 - \lambda } \right) = 0\)

⇒ λ = 1, 4, 3 are the eigenvalues

Key Points

Please do remember all the properties of eigenvalues and eigenvectors. Don’t apply the formula. It will be time-consuming.

Properties of Eigenvalues:

  • The sum of Eigenvalues of a matrix A is equal to the trace of that matrix A
  • The product of Eigenvalues of a matrix A is equal to the determinant of that matrix A
  • If λ is an eigenvalue of a matrix A, then λn will be an eigenvalue of a matrix An.
  • If λ is an eigenvalue of a matrix A, then kλ will be an eigenvalue of a matrix kA where k is a scalar
51

Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with combinational circuit only. The pipeline registers are required between each stage and at the end of the last stage. Delays for the stages and for the pipeline registers are as given in the figure.

What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?

  1. ((a))

    4.0

  2. ((b))

    2.5

  3. ((c))

    1.1

  4. ((d))

    3.0

Show Answer
Answer: ((b))

2.5

The correct answer is option 2

Concept:

The segments are separated by registers Ri that holds the intermediate results between the stages.

Data:

Stage delay and corresponding register delay given

S1 = 5 ,

S2 = 6 ,

S3 = 11,

S4 = 8,

And corresponding register delay is 1 for each stage

Number of stage = 4

Explanation:

Time is taken to execute N instructions in non-pipelined implementation will be =(5+6+11+8)N = 30×N

Clock period for pipelined implementation =max(5,6,11,8) + 1 = 12 ns

Time is taken to execute N instructions in pipelined implementation will be = (4 + N-1)12 ≈ 12×N (N is very large)

Speedup = 30N12N=2.5{30N\over12N }=2.5

52

Definition of a language L with alphabet {a} is given as following.

L= {ank | k > 0, and n is a positive integer constant}

What is the minimum number of states needed in a DFA to recognize L?

  1. ((a))

    k + l

  2. ((b))

    n + l

  3. ((c))

    2n+1

  4. ((d))

    2k+1

Show Answer
Answer: ((b))

n + l

Let n =3 and k = 1,2,3,.....

L = a3ka^{3k}

Therefore, DFA will accept the language aaa,aaaaaa, aaaaaaaaa, ... i.e. (aaa)+(aaa)^+

 

So, (n+1) states

53

An 8 KB direct-mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The processor generates 32-bit addresses. The cache controller maintains the tag information for each cache block comprising of the following.

1 Valid bit

1 Modified bit

As many bits as the minimum needed to identify the memory block mapped in the cache.

What is the total size of memory needed at the cache controller to store meta-data (tags) for the cache?

  1. ((a))

    4864 bits

  2. ((b))

    6144 bits

  3. ((c))

    6656 bits

  4. ((d))

    5376 bits

Show Answer
Answer: ((d))

5376 bits

The correct answer is option 4

Data:

Main Memory size =232 Byte

Cache size = 8KB = 213 Byte

Block size = 2Byte

Valid = 1 bit

Modified = 1 bit

**Formula:**cachesizeblockscachesizeblocksizetotallinesl

number of bits = ⌈log2 n⌉ 

Number of lines in cache = cache;sizeblock;size\frac{cache;size}{block;size}totallineslinesinaset

MM = tag + index + block offset .....(in bits)

Total bits required to store meta-data of 1 line =  Valid bit +  Modified bit + tag bit

Calculation:

Number of cache lines =Cache sizeblock size=213B25B=28B{{Cache}\ {size} \over block\ size }=\frac{2^{13}B}{2^5B}= 2^8B

So, index bit = 8

MM = tag + index + block offset

32 = tag +8 + 5

tag =19 bits

TagindexBlock Offset
19bits8 bits5 bits

Total bits required to store meta-data of 1 line =  Valid bit +  Modified bit + tag bit

Total bits required to store meta-data of 1 line = 1  + 1 + 19 =21 bits

Cache memory has 256 lines

So, Total memory required =21 bits × 256 = 5376 bits

54

An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as 10 ms. Rotational speed of disk is 6000 rpm. If all 100 libraries are loaded from random locations on the disk, how long does it take to load all libraries? (The time to transfer data from the disk block once the head has been positioned at the start of the block may be neglected.)

  1. ((a))

    0.50 s

  2. ((b))

    1.50 s

  3. ((c))

    1.25 s

  4. ((d))

    1.00 s

Show Answer
Answer: ((b))

1.50 s

The correct answer is option 2

Data:

Seek time = 10 ms

Rotational speed = 6000 rpm

Transfer time has given negligible

total 100 files are loaded from the disk

Formula:

Disk access time = Seek time + Rotational latency + Transfer time

Calculation:

Rotational speed = 6000 rpm

6000 rotation → 60s

1 rotation → 606000s{60\over6000}s

1 rotation → 10 ms

Average rotational delay = 10 ÷ 2 = 5 ms

Disk access time = seek time + Rotational latency + transfer time(given negligible)

Disk access time = 10 ms + 5ms + 0 = 15 ms

Now, total time to transfer one library → 15 ms

So, the total time to transfer 100 libraries → 100 × 15ms =1.5s

55

A deterministic finite automaton (DFA) D with alphabet ∑ = {a,b} is given below.

<br>

Which of the following finite state machines is a valid minimal DFA which accepts the same language as D?

  1. ((a))

  2. ((b))

  3. ((c))

  4. ((d))

Show Answer
Answer: ((a))

The correct answer is option 1.

Key Points

Minimization of DFA :

Step 1:

We will divide Q (set of states) into two sets. One set will contain all final states and another set will contain non-final states.

P= {p,q,r}  P={s,t}

Step 2: 

Find Pk by partitioning the different sets of Pk-1. In each set of Pk-1, we will take all possible pair of states. If two states of a set are distinguishable, we will split the sets into different sets in Pk.

Here state p and q states go to only P1 and P0. But state r go to the only P0. Hence state ' r ' is a different set. 

P={p,q} P1 ={r} P2 ={s,t} 

Here state p and state q  are different p goes to only P0 and P2 and q goes to only P1 and P2. So both are different.

P0 ={p} P1 ={q}  P2 ={r} P3 ={s,t}

P0 ={p} P1 ={q}  P2 ={r} P3 ={s,t}

Step 3: 

Stop when Pk = Pk-1 (No change in the partition) 

Step 4: 

All states of one set are merged into one. No. of states in minimized DFA will be equal to no. of sets in Pk. 

minimized DFA is,

Alternate Method

Option 2 and Option 3:

Minimized DFA  accepts string ' b ' but the given deterministic finite automata didn't accept the string b Hence option 2 and option 3 are false.

Option 4:

Minimized DFA  accepts string 'bba' but the given deterministic finite automata didn't accept the string 'bba' Hence option 4 is false.

56

Database table by name Loan_Records is given below.

BorrowerBank ManagerLoan Amount
RameshSunderajan10000.00
SureshRamgopal5000.00
MaheshSunderajan7000.00
<br>

What is the output of the following SQL query?

SELECT count(*)

FROM(

(SELECT Borrower, Bank_Manager FROM Loan_Records) AS S

NATURAL JOIN

(SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T

);

  1. ((a))

    3

  2. ((b))

    9

  3. ((c))

    5

  4. ((d))

    6

Show Answer
Answer: ((c))

5

BorrowerBank _ Manager
RameshSunderajan
SureshRamgopal
MaheshSunderjan

 

Bank _ ManagerLoan _ Amount
Sunderajan10000.00
Ramgopal5000.00
Sunderjan7000.00

After executing the given query, the output would be

BorrowerBank_ManagerLoad_Amount
RameshSunderajan10000.00
RameshSunderajan7000.00
SureshRamgopal5000.00
MaheshSunderajan10000.00
MaheshSunderajan7000.00
57

The following is the comment written for a C function.

/* This function computes the roots of a quadratic equation a.x∧2 + b.x + c = 0. The function stores two real roots in *root1 and *root2 and returns the status of validity of roots. It handles four different kinds of cases.

(i) When coefficient a is zero irrespective of discriminant

(ii) When discriminant is positive

(iii) When discriminant is zero

(iv) When discriminant is negative.

Only in case (ii) and (iii), the stored roots are valid. Otherwise 0 is stored in the roots. The function returns 0 when the roots are valid and -1 otherwise.

The function also ensures rootl >= root2.

int get_QuadRoots(float a, float b, float c,

float *root1, float *root2);

*/

A software test engineer is assigned the job of doing black box testing. He comes up with the following test cases, many of which are redundant.

Test castInput SetExpected Output Set
abcroot1roo2Return Value
T10.00.07.00.00.0-1
T20.01.03.00.00.0-1
T31.02.01.0-1.0-1.00
T44.0-12.09.01.51.50
T51.0-2.0-3.03.0-1.00
T61.01.04.00.00.0-1
<br>

Which one of the following options provide the set of non-redundant tests using equivalence class partitioning approach from input perspective for black box testing

  1. ((a))

    T1, T2, T3, T6

  2. ((b))

    T1, T3, T4, T5

  3. ((c))

    T2, T4, T5, T6

  4. ((d))

    T2, T3, T4, TS

Show Answer
Answer: ((c))

T2, T4, T5, T6

The correct answer is option 3.

Key Points

T1T2T3T4T5T6
a=0 Hence any one of  T1 or T2 is redundantDiscriminant b2 – 4ac =4-4 =0 = (– 12)2 – 4 × 9 × 4 = 144 – 144 = 0 Hence any one of T3 or T4 is redundant.Discriminant b2 – 4ac = (– 2)2 – (– 3) × 4 × 1 = 4 + 12 = 16 > 0 discriminant > 0Discriminant > 0 discriminant b2 – 4ac = (1)2 – 4 × 1 × 4 = 1 – 16 = – 13 discriminant < 0.

Hence the correct answer is T2, T4, T5, T6.

Consider the following recursive C function that takes two arguments

 unsigned int foo(unsigned int n, unsigned int r) {  

      if (n > 0) return (n%r) + foo (n/r, r));

       else return 0;

}

58

What is the return value of the function foo when it is called as foo (345, 10)?

  1. ((a))

    345

  2. ((b))

    12

  3. ((c))

    5

  4. ((d))

    3

Show Answer
Answer: ((b))

12

The correct answer is option 2

Explanation:

So, foo (345, 10) return the value 12

foo(345,10) = 5 + foo(34, 10)

foo(345,10) = 5 + 4 + foo(3, 10)

foo(345,10) = 5 + 4 + 3 + foo(0, 10)

foo(0, 10) return 0

because 0< 0 false

foo(345,10) = 5 + 4 + 3 + 0 =12

59

What is the return value of the function foo when it is called as foo (513, 2)?

  1. ((a))

    9

  2. ((b))

    8

  3. ((c))

    5

  4. ((d))

    2

Show Answer
Answer: ((d))

2

The correct answer is option 4

Explanation:

foo (513, 2) returns the value 2

foo (513, 2) = 1 + foo (256, 2)

foo (513, 2) = 1 + 0 + foo (128, 2)

foo (513, 2) = 1 + 0 + 0 + foo (64, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + foo (32, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + foo (16, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + 0+ foo (8, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + 0+ 0+ foo (4, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + 0+ 0+ 0+ foo (2, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + 0+ 0+ 0+ 0+ foo (1, 2)

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + 0+ 0+ 0+ 0+ 1+ foo (0, 2)

foo (0, 2) return value 0

because 0<0 false

foo (513, 2) = 1 + 0 + 0 + 0 + 0 + 0+ 0+ 0+ 0+ 1+ 0

foo (513, 2) = 2

Consider the following circuit involving three D-type flip-flops used in a certain type of counter configuration.

60

If at some instance prior to the occurrence of the clock edge, P, Q and R have a value 0, 1 and 0 respectively, what shall be the value of POR after the clock edge?

  1. ((a))

    000

  2. ((b))

    001

  3. ((c))

    010

  4. ((d))

    011

Show Answer
Answer: ((d))

011

The correct answer is option 4.

Key Points \(D_P =Q_R \D_Q=\bar Q_P. \bar Q_R \D_R= \bar Q_R.Q_Q \)

ClockDPDQDRPQR
0---000
1010010
2011011
3100100
4000000

From above table If P Q R = 0 1 0 [at 1 st clock output] then next state of P Q R values = 0 1 1 [at 2 nd  clock].

61

[fall the flip-flops were reset to 0 at power on, what is the total number of distinct outputs (states) represented by POR generated by the counter?

  1. ((a))

    3

  2. ((b))

    4

  3. ((c))

    5

  4. ((d))

    6

Show Answer
Answer: ((b))

4

Key Points

 \(D_P =Q_R \D_Q=\bar Q_P. \bar Q_R \D_R= \bar Q_R.Q_Q \)

ClockDPDQDRPQR
0---000
1010010
2011011
3100100
4000000

Hence the is a MOD-4 counter hence the total number of distinct output (states)=4

Consider a network with five nodes, N1 to N5, as shown below.

<br>

The network uses a Distance Vector Routing protocol. Once the routes have stabilized, the distance vectors at different nodes are as following.

N1: (0, 1, 7, 8, 4)

N2: (1, 0, 6, 7, 3)

N3: (7, 6, 0, 2, 6)

N4: (8, 7, 2, 0, 4)

N5: (4, 3, 6, 4, 0)

Each distance vector is the distance of the best known path at that instance to nodes, N1 to N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance vectors with their respective neighbors. Then all nodes update their distance vectors. In between two rounds, any change in cost of a link will cause the two incident nodes to change only that entry in their distance vectors.

62

The cost of link N2-N3 reduces to 2 (in both directions). After the next round of updates, what will be the new distance vector at node, N3?

  1. ((a))

    (3, 2, 0, 2, 5)

  2. ((b))

    (3, 2, 0, 2, 6)

  3. ((c))

    (7, 2, 0, 2, 5)

  4. ((d))

    (7, 2, 0, 2, 6)

Show Answer
Answer: ((a))

(3, 2, 0, 2, 5)

Key Points

 

(6 is changed to 2)

So

N3→N1→3

N3→N2→2

N3→N3→0

N3→N4→2

N3→N5→5(Via N2)  (3,2,0,2,5)

New distance-vector at a node, N3 (3,2,0,2,5).

63

After the update in the previous question, the link NI-N2 goes down. N2 wiil reflect this change immediately in its distance vector as cost, ∞. After the NEXT ROUND of update, what will be the cost to N1 in the distance vector of N3?

  1. ((a))

    3

  2. ((b))

    9

  3. ((c))

    10

  4. ((d))

Show Answer
Answer: ((c))

10

Key Points

 

It is down So N2→N1 is ∞

If poison we use in applied these N2 says it is always ∞. But in question there asked what is its value at N3. So the alternative route is N3→N4→N5→N2→N1, so its value is 2+4+3+1=10.

Please note, in question, they asked "NEXT ROUND" of update, which means '∞' at N2 will be received by N5 but not by N3, Hence N3 still assumes N3→N4→N5→N2 is all alternative route to N1.

The cost to N1 in the distance vector of N3 is 10.

An undirected graph G(V, E) contains n (n > 2) nodes named ν1, ν2 ν3, ...νn. Two nodes vi,vj are connected if and only if 0 < | i - j | ≤ 2. Each edge (vi,vj) is assigned a weight i + j. A sample graph with n = 4 is shown below.

64

What will be the cost of the minimum spanning tree (MST) of such a graph with n nodes?

  1. ((a))

    112(11n25n)\dfrac{1}{12}(11n^2-5n)

  2. ((b))

    n2 - n + 1

  3. ((c))

    6n - 11

  4. ((d))

    2n + 1

Show Answer
Answer: ((b))

n2 - n + 1

The correct answer is option 2.

Key Points

Pattern observed in weight of MST being formed:

For n=3 ⇒ (1+2+3)+(1)

For n=4 ⇒ (1+2+3+4)+(1+2)

For n=5 ⇒ (1+2+3+4+5)+(1+2+3)

For n=6 ⇒ (1+2+3+4+5+6)+(1+2+3+4)

In general, the total weight of the minimum spanning tree for n:

i=1ni+i=1n2i\sum_{i=1}^{n} i + \sum_{i=1}^{n-2} i

=n- n + 1

Hence the correct answer is n2-n+1.

Alternate Method

 For n = 5, The graph is

 Cost of the minimum spanning tree (MST) of a graph with n=5 nodes

only option B satisfy.

65

The length of the path from ν5 to ν6 in the MST of previous question with n = 10 is

  1. ((a))

    11

  2. ((b))

    25

  3. ((c))

    31

  4. ((d))

    41

Show Answer
Answer: ((c))

31

The correct answer is option 3.

Key Points

 For n=10, The graph is

 

Cost of the minimum spanning tree (MST) of a graph with n=10 nodes

The length of the path from ν5 to ν6 in the MST= 8+4+3+6+10 = 31

The path  is V5⇒V6: (V5-V3-V1-V2-V4-V6)

Attempt this paper under real exam conditions

Timed interface, section switching, instant scoring, and question-by-question analytics — free.

Start Timed Attempt