Question 1
In a compiler, keywords of a language are recognized during
A
parsing of the program
B
the code generation
C
the lexical analysis of the program
D
dataflow analysis
GATE CS 2011    Lexical analysis    
Discuss it


Question 1 Explanation: 
Lexical analysis is the process of converting a sequence of characters into a sequence of tokens. A token can be a keyword.
Question 2
A layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT
A
block entire HTTP traffic during 9:00PM and 5 :0OAM
B
block all ICMP traffic
C
stop incoming traffic from a specific IP address but allow outgoing traffic to the same IP address
D
block TCP traffic from a specific user on a multi-user system during 9:00PM and 5:00AM
GATE CS 2011    Transport Layer    
Discuss it


Question 2 Explanation: 
A.Can Block entire HTTP traffic by blocking TCP port 80 and it is possible because it is L4 firewall. D) As it is L4 firewall can not block packet based on user identity because it is the responsiblity of Application layer
Question 3
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?
A
1/3
B
1/4
C
1/2
D
2/3
GATE CS 2011    Probability    
Discuss it


Question 3 Explanation: 
Since we know one outcome is head, there are only three possibilities {h, t}, {h, h}, {t, h} The probability of both heads = 1/3
Question 4
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? 
A
ml: HTTP m2: SMTP m3: POP
B
ml: SMTP m2: FTP m3: HTTP
C
ml: SMTP m2: POP m3: HTTP
D
ml: POP m2: SMTP m3: IMAP
GATE CS 2011    Application Layer    
Discuss it


Question 4 Explanation: 
Simple Mail Transfer Protocol (SMTP) is typically used by user clients for sending mails. Post Office Protocol (POP) is used by clients for receiving mails. Checking mails in web browser is a simple HTTP process.
Question 5
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 Ll. The product will have to be maintained for five years. Various parameters for the company are given in the table below.
Parameter Language L1 Language L2
Man years needed for development LOC/10000 LOC/10000
Development cost per man year Rs. 10,00,000 Rs. 7,50,000
Maintenance time 5 years 5 years
Cost of maintenance per year Rs. 1,00,000 Rs. 50,000
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?
A
4000
B
5000
C
4333
D
4667
GATE CS 2011    Software Engineering    
Discuss it


Question 5 Explanation: 
Let LOC of L1=x, so LOC of L2=2x Now, (x/10000)*1000000 + 5*100000 = (2x/10000)*750000 + 5*50000 Solving for x, we get x =5000 Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 6
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?
A
t1 > t2
B
t1 = t2
C
t1 < t2
D
nothing can be said about the relation between t1 and t2
Process Management    GATE CS 2011    
Discuss it


Question 6 Explanation: 
Process switches or Context switches can occur in only kernel mode . So for process switches first we have to move from user to kernel mode . Then we have to save the PCB of the process from which we are taking off CPU and then we have to load PCB of the required process . At switching from kernel to user mode is done. But switching from user to kernel mode is a very fast operation(OS has to just change single bit at hardware level) Thus T1< T2 This explanation has been contributed by Abhishek Kumar.
Question 7
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?
A
234.25
B
932.50
C
287.80
D
122.40
GATE CS 2011    Software Engineering    
Discuss it


Question 7 Explanation: 
In the Constructive Cost Model (COCOMO), following is formula for effort applied
Effort Applied (E) = ab(KLOC)bb [ person-months ]
                   = 2.8 x(40)1.20 
                   = 2.8 x 83.65 
                   = 234.25 
Question 8
Which one of the following is NOT desired in a good Software Requirement Specifications (SRS) document?
A
Functional Requirements
B
Non-Functional Requirements
C
Goals of Implementation
D
Algorithms for Software Implementation
GATE CS 2011    Software Engineering    
Discuss it


Question 8 Explanation: 
The software requirements specification document is a requirements specification for a software system, is a complete description of the behavior of a system to be developed and may include a set of use cases that describe interactions the users will have with the software. In addition it also contains non-functional requirements. Non-functional requirements impose constraints on the design or implementation (such as performance engineering requirements, quality standards, or design constraints) (Source: Wiki) An SRS document should clearly document the following aspects of a system: Functional Requirements, Non-Functional Requirements and Goals of implementation (Source: Fundamentals of Software Engineering by Rajib Mall)
Question 9
Which of the following pairs have DIFFERENT expressive power?
A
Deterministic finite automata(DFA) and Non-deterministic finite automata(NFA)
B
Deterministic push down automata(DPDA)and Non-deterministic push down automata(NPDA)
C
Deterministic single-tape Turing machine and Non-deterministic single-tape Turing machine
D
Single-tape Turing machine and multi-tape Turing machine
GATE CS 2011    Context free languages and Push-down automata    
Discuss it


Question 9 Explanation: 

NDPDA can handle languages or grammars with ambiguity, but DPDA cannot handle languages with ambiguity and any context-free grammar.

Question 10
HTML(Hypertext 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?
A
Embed web objects from different sites into the same page
B
Refresh the page automatically after a specified interval
C
Automatically redirect to another page upon download
D
Display the client time as part of the page
GATE CS 2011    HTML and XML    
Discuss it


Question 11
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?
A
Interrupt from Hard Disk
B
Interrupt from Mouse
C
Interrupt from Keyboard
D
Interrupt from CPU temperature sensor
Input Output Systems    GATE CS 2011    
Discuss it


Question 11 Explanation: 
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 keyboard receive low priority (Source: Computer System Architecture by Morris Mano) Interrupt from CPU temperature sensor would have serious consequences if ignored.
Question 12
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. BankAccount_Num: Unique account number at
   the bank. A student can have multiple accounts
   or join accounts. This attribute stores the 
   primary account number.
4. Name: Name of the student
5. Hostel_Room: Room number of the hostel 
Which one of the following option is INCORRECT?
A
BankAccount_Num is candidate key
B
Registration_Num can be a primary key
C
UID is candidate key if all students are from the same country
D
If S is a superkey such that S∩UID is NULL then S∪UID is also a superkey
GATE CS 2011    Database Design(Normal Forms)    
Discuss it


Question 12 Explanation: 
Candidate Key value must uniquely identify the corresponding row in table. BankAccount_Number is not a candidate key. As per the question “A student can have multiple accounts or joint accounts. This attributes stores the primary account number”. If two students have a joint account and if the joint account is their primary account, then BankAccount_Number value cannot uniquely identify a row.
Question 13
Which one of the following circuits is NOT equivalent to a 2-input XNOR (exclusive NOR) gate? GATECS201113
A
A
B
B
C
C
D
D
GATE CS 2011    Digital Logic & Number representation    
Discuss it


Question 13 Explanation: 
All options except D produce XOR. See following image (Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html) gate201113
Question 14
The simplified SOP (Sum Of Product) form of the boolean expression (P + Q' + R') . (P + Q' + R) . (P + Q + R') is
A
(P'.Q + R')
B
(P + Q'.R')
C
(P'.Q + R)
D
(P.Q + R)
GATE CS 2011    Digital Logic & Number representation    
Discuss it


Question 14 Explanation: 
Question 15
The minimum number of D flip-flops needed to design a mod-258 counter is.
A
9
B
8
C
512
D
258
GATE CS 2011    
Discuss it


Question 15 Explanation: 

An n-bit binary counter consists of n flip-flops and can count in binary from 0 to 2^n - 1.  (Source: Computer System Architecture by Morris Mano

2^n ≥ 258

Question 16
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?
A
On per-thread basis, the OS maintains only CPU register state
B
The OS does not maintain a separate stack for each thread
C
On per-thread basis, the OS does not maintain virtual memory state
D
On per-thread basis, the OS maintains only scheduling and accounting information
Process Management    GATE CS 2011    
Discuss it


Question 16 Explanation: 
Threads share address space of Process. Virtually memory is concerned with processes not with Threads. A thread is a basic unit of CPU utilization, consisting of a program counter, a stack, and a set of registers, (and a thread ID.) As you can see, for a single thread of control - there is one program counter, and one sequence of instructions that can be carried out at any given time and for multi-threaded applications-there are multiple threads within a single process, each having their own program counter, stack and set of registers, but sharing common code, data, and certain structures such as open files. nitika_58 Option (A): as you can see in the above diagram, NOT ONLY CPU Register but stack and code files, data files are also maintained. So, option (A) is not correct as it says OS maintains only CPU register state. Option (B): according to option (B), OS does not maintain a separate stack for each thread. But as you can see in above diagram, for each thread, separate stack is maintained. So this option is also incorrect. Option (C): according to option (C), the OS does not maintain virtual memory state. And It is correct as Os does not maintain any virtual memory state for individual thread. Option (D): according to option (D), the OS maintains only scheduling and accounting information. But it is not correct as it contains other information like cpu registers stack, program counters, data files, code files are also maintained. Reference: https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/4_Threads.html This solution is contributed by Nitika Bansal
Question 17
CSE_201117
A
K4 is planar while Q3 is not
B
Both K4 and Q3 are planar
C
Q3 is planar while K4 is not
D
Neither K4 nor Q3 are planar
GATE CS 2011    Graph Theory    
Discuss it


Question 17 Explanation: 
A Graph is said to be planar if it can be drawn in a plane without any edges crossing each other. Following are planar embedding of the given two graphs (Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html) gate2011A21
Question 18
If the difference between expectation of the square of a random variable (E[X²]) and the square of the expectation of the random variable (E[X])² is denoted by R, then?
A
R = 0
B
R < 0
C
R >= 0
D
R > 0
GATE CS 2011    Probability    
Discuss it


Question 18 Explanation: 
The difference between  (E[X²]) and (E[X])² is called variance of a random variable.  Variance measures how far a set of numbers is spread out. (A variance of zero indicates that all the values are identical.) A non-zero variance is always positive:
Question 19
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?
A
Finite state automata
B
Deterministic pushdown automata
C
Non-Deterministic pushdown automata
D
Turing Machine
GATE CS 2011    Lexical analysis    
Discuss it


Question 20
Let the page fault service time be 10ms in a computer with average memory access time being 20ns. If one page fault is generated for every 10^6 memory accesses, what is the effective access time for the memory?
A
21ns
B
30ns
C
23ns
D
35ns
Memory Management    GATE CS 2011    
Discuss it


Question 20 Explanation: 
Let P be the page fault rate
Effective Memory Access Time = p * (page fault service time) + 
                               (1 - p) * (Memory access time)
                             = ( 1/(10^6) )* 10 * (10^6) ns +
                               (1 - 1/(10^6)) * 20 ns
                             = 30 ns (approx)   
Question 21
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 operand in memory?
A
Immediate Addressing
B
Register Addressing
C
Register Indirect Scaled Addressing
D
Base Indexed Addressing
GATE CS 2011    Computer Organization and Architecture    
Discuss it


Question 22
What does the following fragment of C-program print?
char c[] = "GATE2011";
char *p =c;
printf("%s", p + p[3] - p[1]) ;
A
GATE2011
B
E2011
C
2011
D
011
GATE CS 2011    
Discuss it


Question 22 Explanation: 
Question 23
A max-heap is a heap where the value of each parent is greater than or equal to the values of its children. Which of the following is a max-heap?
A
A
B
B
C
C
D
D
GATE CS 2011    
Discuss it


Question 24
1) Let P be a regular language and Q be context-free language such that Q 	\subseteq P. (For example, let P be the language represented by the regular expression p*q* and Q be {pnqn|n \in N}). Then which of the following is ALWAYS regular? (A) P \cap Q (B) P - Q (C) \sum* - P (D) \sum* - Q
A
A
B
B
C
C
D
D
GATE CS 2011    Context free languages and Push-down automata    
Discuss it


Question 24 Explanation: 
1. P ∩ Q would be Q, due to the given fact that Q ⊆ P, hence context free but not regular. 2. P − Q = P ∩ Q might not even be a context free language, due to the closure properties of context free languages. 3. Σ∗ − P is equivalently complement of P, hence regular. Refer to closure laws of regular languages. 4. Σ∗ − Q is equivalently complement of Q, hence it might not even be a context free language. Refer to closure laws of CFLs. Reference: http://quiz.geeksforgeeks.org/theory-of-computation-closure-properties-of-context-free-languages/ See http://www.geeksforgeeks.org/automata-theory-set-4/ This solution is contributed by Vineet Purswani.
Question 25
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 Which of the following statements is TRUE?
A
The algorithm uses dynamic programming paradigm
B
The algorithm has a linear complexity and uses branch and bound paradigm
C
The algorithm has a non-linear polynomial complexity and uses branch and bound paradigm
D
The algorithm uses divide and conquer paradigm.
GATE CS 2011    
Discuss it


Question 26
2) Consider the language L1,L2,L3 as given below. L1={0^{p}1^{q} | p,q \in N} L2={0^{p}1^{q} | p,q \in N and p=q} L3={0^{p}1^{q}0^{r} | p,q,r \in N and p=q=r} Which of the following statements is NOT TRUE?
A
Push Down Automata (PDA) can be used to recognize L1 and L2
B
L1 is a regular language
C
All the three languages are context free
D
Turing machine can be used to recognize all the three languages
GATE CS 2011    Context free languages and Push-down automata    
Discuss it


Question 26 Explanation: 
L1 is regular. Its DFA is given as
       gate2011A35
L2 is not regular, can be proved using pumping lemma (refer to Ullman). But L2 is CFL.
        S → AB
        A → 0A|ε
        B → 1B|ε
L3 is not CFL, can be proved using pumping lemma (refer to Ullman). But L3 is Recursive. gate2011A35b Every regular language is also a CFL. So PDA can be used to recognized L1 and L2. As a CFL and Regular language is algo a Recursive language. Hence, Turing machine can be used to recognise L1, L2 and L3. L2 is not regular, can be proved using pumping lemma (refer to Ullman). But L2 is CFL.
        S → AB
        A → 0A|ε
        B → 1B|ε
L3 is not CFL, can be proved using pumping lemma (refer to Ullman). But L3 is Recursive. Every regular language is also a CFL. So PDA can be used to recognised L1 and L2. As a CFL and Regular language is algo a Recursive language. Hence, turing machine can be used to recognise L1, L2 and L3. Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 27
Consider two binary operators '\uparrow ' and '\downarrow' with the precedence of operator \downarrow being lower than that of the \uparrow operator. Operator \uparrow is right associative while operator \downarrow is left associative. Which one of the following represents the parse tree for expression (7 \downarrow 3 ­\uparrow 4 ­\uparrow 3 \downarrow 2)?
A
A
B
B
C
C
D
D
GATE CS 2011    
Discuss it


Question 27 Explanation: 
Question 28
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 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 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?
A
3.4
B
4.4
C
5.1
D
6.7
GATE CS 2011    Computer Organization and Architecture    
Discuss it


Question 28 Explanation: 
 Explanation:
                        STATEMENT                                           CLOCK CYCLE(S) NEEDED
              Initialize the address register                                        1
              Initialize the count to 500                                            1
        LOOP: Load a byte from device                                                2
              Store in memory at address given by address register                   2
              Increment the address register                                         1
              Decrement the count                                                    1
              If count != 0 go to LOOP                                               1

        Interrrupt driven transfer time = 1+1+500×(2+2+1+1+1) = 3502
        DMA based transfer time = 20+500*2 = 1020
        Speedup = 3502/1020 ≈ 3.4

Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 29
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?
A
0
B
1
C
n!
D
(1/(n+1)).2nCn
GATE CS 2011    
Discuss it


Question 30
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))
A
P(x) being true means that x is a prime number
B
P(x) being true means that x is a number other than 1
C
P(x) is always true irrespective of the value of x
D
P(x) being true means that x has exactly two factors other than 1 and x
GATE CS 2011    Propositional and First Order Logic.    
Discuss it


Question 30 Explanation: 
Discrete Mathematics and Its Applications by Kenneth H Rosen
 So the predicate is evaluated as
    P(x) = (¬(x=1))∧(∀y(∃z(x=y*z)⇒((y=x)∨(y=1))))
 P(x) being true means x ≠ 1 and
 For all y if there exists a z such that x = y*z then
 y must be x (i.e. z=1) or y must be 1 (i.e. z=x)
 
 It means that x have only two factors first is 1 
 and second is x itself.
 
This predicate defines the prime number.
Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 31
Given i=√-1, what will be the evaluation of the integral gate2011Q31?
A
0
B
2
C
-i
D
i
GATE CS 2011    Numerical Methods and Calculus    
Discuss it


Question 32
Consider a database table T containing two columns X and Y each of type integer. 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 MX 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;
A
127
B
255
C
129
D
257
GATE CS 2011    SQL    
Discuss it


Question 33
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?
A
Index position of mode of X in X is the same as the index position of mode of Y in Y.
B
Index position of median of X in X is the same as the index position of median of Y in Y.
C
μy = aμx+b
D
σy = aσx+b
GATE CS 2011    Probability    
Discuss it


Question 33 Explanation: 
Adding a constant like b shift the distribution while multiplying to a constant like a stretch the distribution along median gate2011A29 Mode is the most frequent data of the distribution, so the index position of the mode will not change. From the above graph it is clear that index position of the median will also not change. Now for the mean gate2011A29b And for the standard deviation gate2011A29c     Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 34
A deck of 5 cards (each carrying a distinct number from 1 to 5) is shuffled thoroughly. Two cards are then removed one at 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?
A
1/5
B
4/25
C
1/4
D
2/5
GATE CS 2011    Probability    
Discuss it


Question 34 Explanation: 
You have to select 2 cards from 5. Since the order in which they are drawn matters, there are 5P2 = 5!/3! = 20 elementary events from which there are 4 favorable number of cases: 5 before 4, 4 before 3, 3 before 2 and 2 before 1. Hence, probability = 4/20 = 1/5   Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 35
Consider the following table of arrival time and burst time for three processes P0, P1 and P2.
Process   Arrival time   Burst Time
P0            0 ms          9 ms
P1            1 ms          4 ms
P2            2 ms          9 ms
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?
A
5.0 ms
B
4.33 ms
C
6.33
D
7.33
GATE CS 2011    CPU Scheduling    
Discuss it


Question 35 Explanation: 
Question 36
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 initially stored in memory. The binary operators used in this expression tree can be evaluate by the machine only when the operands are in registers. The instructions produce results 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?   gate2011Q26
A
2
B
9
C
5
D
3
GATE CS 2011    Computer Organization and Architecture    
Discuss it


Question 36 Explanation: 

R1←c,  R2←d,  R2←R1+R2,  R1←e,  R2←R1-R2
Now to calculate the rest of the expression we must load a and b into the registers but we need the
content of R2 later.
So we must use another Register.
R1←a, R3←b, R1←R1-R3, R1←R1+R2

Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html

Question 37
Which of the given options provides the increasing order of asymptotic complexity of functions f1, f2, f3 and f4? f1(n) = 2^n f2(n) = n^(3/2) f3(n) = nLogn f4(n) = n^(Logn)
A
f3, f2, f4, f1
B
f3, f2, f1, f4
C
f2, f3, f1, f4
D
f2, f3, f4, f1
GATE CS 2011    
Discuss it


Question 37 Explanation: 
nLogn is the slowest growing function, then comes n^(3/2), then n^(Logn).  Finally, 2^n is the fastest growing function.
Question 38
Four matrices M1, M2, M3 and M4 of dimensions pxq, qxr, rxs and sxt respectively can be multiplied is several ways with different number of total scalar multiplications. For example, when multiplied as ((M1 X M2) X (M3 X M4)), the total number of multiplications is pqr + rst + prt. When multiplied as (((M1 X M2) X M3) X M4), the total number of scalar multiplications is pqr + prs + pst. If p = 10, q = 100, r = 20, s = 5 and t = 80, then the number of scalar multiplications needed is:
A
248000
B
44000
C
19000
D
25000
GATE CS 2011    
Discuss it


Question 38 Explanation: 
We get minimum number of multiplications using ((M1 X (M2 X M3)) X M4). Total number of multiplications = 100x20x5 (for M2 x M3) + 10x100x5 + 10x5x80 = 19000.
Question 39
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. GATE2011DBMS1 The database can be configured to do ordered indexing on Ap or hashing on Ap. Which of the following statements is TRUE?
A
Ordered indexing will always outperform hashing for both queries
B
Hashing will always outperform ordered indexing for both queries
C
Hashing will outperform ordered indexing on Q1, but not on Q2
D
Hashing will outperform ordered indexing on Q2, but not on Q1.
GATE CS 2011    ER and Relational Models    
Discuss it


Question 39 Explanation: 
If record are accessed for a particular value from table, hashing will do better. If records are accessed in a range of values, ordered indexing will perform better. See this for more details.
Question 40
Consider the matrix as given below. GATECS2011Q40 Which one of the following options provides the CORRECT values of the eigenvalues of the matrix?
A
1, 4, 3
B
3, 7, 3
C
7, 3, 2
D
1, 2, 3
GATE CS 2011    Linear Algebra    
Discuss it


Question 40 Explanation: 

The Eigen values of a triangular matrix are given by its diagonal entries. We can also calculate (or verify given answers) using characteristic equation obtained by |M - λI| = 0.

 

1-λ    2     3

0     4-λ    7           =       0

0      0     3-λ 

Which means

(1-λ)(4-λ)(3-λ) = 0

Question 41
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: GATECS2011Q41 What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?
A
4.0
B
2.5
C
1.1
D
3.0
GATE CS 2011    Computer Organization and Architecture    
Discuss it


Question 41 Explanation: 
Pipeline registers overhead is not counted in normal 
time execution

So the total count will be

5+6+11+8= 30 [without pipeline]

Now, for pipeline, each stage will be of 11 n-sec (+ 1 n-sec for overhead).
and, in steady state output is produced after every pipeline cycle. Here,
in this case 11 n-sec. After adding 1n-sec overhead, We will get 12 n-sec
of constant output producing cycle.

dividing 30/12 we get 2.5 
Question 42
Definition of a language L with alphabet {a} is given as following.
             L={gate2011Q42| k>0, and n is a positive integer constant}
What is the minimum number of states needed in DFA to recognize L?
A
k+1
B
n+1
C
2^(n+1)
D
2^(k+1)
GATE CS 2011    Regular languages and finite automata    
Discuss it


Question 42 Explanation: 
Question 43
An 8KB 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?
A
4864 bits
B
6144 bits
C
6656 bits
D
5376 bits
GATE CS 2011    Computer Organization and Architecture    
Discuss it


Question 43 Explanation: 
   Cache size = 8 KB
   Block size = 32 bytes
   Number of cache lines = Cache size / Block size = (8 × 1024 bytes)/32 = 256

   gate2011A41

   total bits required to store meta-data of 1 line = 1 + 1 + 19 = 21 bits
   total memory required = 21 × 256 = 5376 bits
Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 44
An application loads 100 libraries at start-up. 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)
A
0.50 s
B
1.50 s
C
1.25 s
D
1.00 s
Input Output Systems    GATE CS 2011    
Discuss it


Question 44 Explanation: 
Question 45
A deterministic finite automation (DFA)D with alphabet {a,b} is given below GATE2011AT1 Which of the following finite state machines is a valid minimal DFA which accepts the same language as D? GATE2011AT2 GATE2011AT3
A
A
B
B
C
C
D
D
GATE CS 2011    Regular languages and finite automata    
Discuss it


Question 45 Explanation: 
Options (B) and (C) are invalid because they both accept ‘b’ as a string which is not accepted by give DFA. (D) is invalid because it accepts "bba" which are not accepted by given DFA.
Question 46
Database table by name Loan_Records is given below.
Borrower    Bank_Manager   Loan_Amount
 Ramesh      Sunderajan     10000.00
 Suresh      Ramgopal       5000.00
 Mahesh      Sunderajan     7000.00
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 );
A
3
B
9
C
5
D
6
GATE CS 2011    SQL    
Discuss it


Question 46 Explanation: 
Question 47
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 = . 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 discreminant 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 roots. The function returns
           0 when the roots are valid and -1 otherwise.
           The function also ensures root1 >= 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. gate2011Q38 Which one of the following option provide the set of non-redundant tests using equivalence class partitioning approach from input perspective for black box testing?
A
T1,T2,T3,T6
B
T1,T3,T4,T5
C
T2,T4,T5,T6
D
T2,T3,T4,T5
GATE CS 2011    Software Engineering    
Discuss it


Question 47 Explanation: 
gate2011A38 T2,T4,T5 and T6 belong to different classes. Hence it gives an optimal test suite. Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 48
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;
}
What is the return value of the function foo when it is called as foo(345, 10) ?
A
345
B
12
C
5
D
3
Recursion    GATE CS 2011    
Discuss it


Question 48 Explanation: 
The call foo(345, 10) returns sum of decimal digits (because r is 10) in the number n. Sum of digits for 345 is 3 + 4 + 5 = 12. pranjul_43 This solution is contributed by Pranjul Ahuja
Question 49
Consider the same 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;
}
What is the return value of the function foo when it is called as foo(513, 2)?
A
9
B
8
C
5
D
2
Recursion    GATE CS 2011    
Discuss it


Question 49 Explanation: 
foo(513, 2) will return 1 + foo(256, 2). All subsequent recursive calls (including foo(256, 2)) will return 0 + foo(n/2, 2) except the last call foo(1, 2) . The last call foo(1, 2) returns 1. So, the value returned by foo(513, 2) is 1 + 0 + 0…. + 0 + 1. The function foo(n, 2) basically returns sum of bits (or count of set bits) in the number n.
Question 50
Consider the following circuit involving three D-type flip-flops used in a certain type of counter configuration. GATECS2011Q50 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 PQR after the clock edge?
A
000
B
001
C
010
D
011
GATE CS 2011    Digital Logic & Number representation    
Discuss it


Question 50 Explanation: 
P' = R Q' = (P + R)' R' = QR' Given that (P, Q, R) = (0, 1, 0), next state P', Q', R' = 0, 1, 1 ----------------------------------------------------------------------------------------------- D flip flop truth table
D Q(t+1)
0 0
1 1
Initially (p,q,r) =(0,1,0) D for p=R D for q=NOT(p xor r) D for r= (not)r.q So Q(t+1) for(p,q,r) p=>r=0 so p=0 q=> NOT(p xor r) => 1      so q=1 r=>(not)r.q => 1         so r=1 (p,q,r)=(0,1,1)
Question 51
Consider the data given in previous question. If all the flip-flops were reset to 0 at power on, what is the total number of distinct outputs (states) represented by PQR generated by the counter?
A
3
B
4
C
5
D
6
GATE CS 2011    Digital Logic & Number representation    
Discuss it


Question 51 Explanation: 
There are four distinct states, 000 → 010 → 011 → 100 (→ 000) so the answer is B
Question 52
Consider a network with five nodes, N1 to N5, as shown below. GATECS2011Q51 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 the 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. 52. 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.
A
(3, 2, 0, 2, 5)
B
(3, 2, 0, 2, 6)
C
(7, 2, 0, 2, 5)
D
(7, 2, 0, 2, 6)
GATE CS 2011    Network Layer    
Discuss it


Question 52 Explanation: 
Question 53
Consider the same data as given in previous question. After the update in the previous question, the link N1-N2 goes down. N2 will reflect this change immediately in its distance vector as cost, infinite. After the NEXT ROUND of update, what will be cost to N1 in the distance vector of N3?
A
3
B
9
C
10
D
Infinite
GATE CS 2011    Network Layer    
Discuss it


Question 53 Explanation: 
Question 54
An undirected graph G(V, E) contains n ( n > 2 ) nodes named v1 , v2 ,….vn. 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. What will be the cost of the minimum spanning tree (MST) of such a graph with n nodes?
A
1/12(11n^2 – 5n)
B
n^2 – n + 1
C
6n – 11
D
2n + 1
GATE CS 2011    
Discuss it


Question 55
The length of the path from v5 to v6 in the MST of previous question with n = 10 is
A
11
B
25
C
31
D
41
GATE CS 2011    
Discuss it


Question 56
Which of the following options is the closest in the meaning to the word below: Inexplicable
A
incomprehensible
B
indelible
C
inextricable
D
infallible
GATE CS 2011    English    
Discuss it


Question 56 Explanation: 
Inexplicable means something that can not be explained. Incomprehensible looks the best option.
Question 57
If Log(P) = (1/2)Log(Q) = (1/3)Log(R), then which of the following options is TRUE?
A
P2 = Q3R2
B
Q2 = PR
C
Q2 = R3P2
D
R = P2Q2
GATE CS 2011    General Aptitude    
Discuss it


Question 57 Explanation: 
It is given that Log(P) = (1/2)Log(Q) = (1/3)Log(R)

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

Let the base of log be B

P = BC
Q = B2C
R = B3C

Which means Q2 = PR
Question 58
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.
A
to visit
B
having to visit
C
visiting
D
for a visit
GATE CS 2011    English    
Discuss it


Question 58 Explanation: 
Contemplate is a transitive verb. So it should be followed by a gerund . Hence the correct usage of contemplate is verb+ ing form.
Question 59
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_____________.
A
Hyperbolic
B
Restrained
C
Argumentative
D
Indifferent
GATE CS 2011    English    
Discuss it


Question 59 Explanation: 
The word placed should be similar to understated and tentative. Restrained seems to be the best choice.
Question 60
Choose the word from the options given below that is most nearly opposite in meaning to the given word: Amalgamate
A
merge
B
split
C
collect
D
separate
GATE CS 2011    
Discuss it


Question 60 Explanation: 
Amalgamate combine or unite to form one organization or structure. Separate on the other hand, although a close antonym, is too general.
Question 61
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. Based on the above passage which topic would not be included in a unit on bereavement?
A
how to write a letter of condolence
B
what emotional stages are passed through in the healing process
C
what the leading causes of death are
D
Show to give support to a grieving friend
GATE CS 2011    English    
Discuss it


Question 61 Explanation: 
As per the given passage, the unit on bereavement is about how to deal with bereavement and grief, not about the causes of death. All other options make sense.
Question 62
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: ME_2011_63 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?
A
P
B
Q
C
R
D
S
GATE CS 2011    General Aptitude    
Discuss it


Question 62 Explanation: 
Answer should be A **The danger to human beings varies proportionately with the toxicity, potency and growth attributed to a microbe**
P = 800*0.4*50 = 16000
Q = 600*0.5*40 = 12000
R = 300*0.4*30 = 3600
S = 200*0.8*20 = 3200
Question 63
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)?
A
5
B
4
C
7
D
6
GATE CS 2011    General Aptitude    
Discuss it


Question 63 Explanation: 
The value of V+F is 4q + 100/q We can try all possible options and see that q = 5 gives the minimum value
Question 64
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?
A
4
B
5
C
6
D
7
GATE CS 2011    General Aptitude    
Discuss it


Question 64 Explanation: 
Let each truck can take at most x units.  Let the daily order be y and let backlog be z.

7*4*x = 4y + z
3*10*x = 10y + z

We need value of (5y + z)/5 in terms of x.

We can get value of y by subtracting first from second
6y = 2x
y = x/3

We can get value of z by substituting  value of y in first equation
4y + z = 28x
4(x/3) + z = 28x
z = (80/3)x

So the value of (5y + z)/5 is 5*(x/3) + (80/3)x  which is 17/3

So almost 6 days needed.
Question 65
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?
A
7.58 litres
B
7.84 litres
C
7 litres
D
7.29 litres
GATE CS 2011    General Aptitude    
Discuss it


Question 65 Explanation: 
spirit left after first replacement = 9 litre spirit left after second replacement = 9 * (9/10) spirit left after third replacement = 9 * (9/10) * (9/10) = 7.29
There are 65 questions to complete.

GATE CS Corner


See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.