• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Gate IT 2005

Question 31

Let n = p2q, where p and q are distinct prime numbers. How many numbers m satisfy 1 ≤ m ≤ n and gcd (m, n) = 1? Note that gcd (m, n) is the greatest common divisor of m and n.  
  • p(q - 1)
  • pq
  • (p2- 1) (q - 1)
  • p(p - 1) (q - 1)

Question 32

What is the value of theta  
  • -1
  • 1
  • 0
  • π

Question 33

Let P(x) and Q(x) be arbitrary predicates. Which of the following statements is always TRUE?
  • ((∀x(P(x)∨Q(x))))⟹((∀xP(x))∨(∀xQ(x)))
  • (∀x(P(x)⟹Q(x)))⟹((∀xP(x))⟹(∀xQ(x)))
  • (∀x(P(x))⟹∀x(Q(x)))⟹(∀x(P(x)⟹Q(x)))
  • (∀x(P(x))⇔(∀x(Q(x))))⟹(∀x(P(x)⇔Q(x)))

Question 34

Consider the non-deterministic finite automaton (NFA) shown in the figure. State X is the starting state of the automaton. Let the language accepted by the NFA with Y as the only accepting state be L1. Similarly, let the language accepted by the NFA with Z as the only accepting state be L2. Which of the following statements about L1 and L2 is TRUE? Correction in Question: There is an edge from Z->Y labeled 0 and another edge from Y->Z labeled 1 - in place of double arrowed and no arrowed edges.
  • L1 = L2
  • L1 ⊂ L2
  • L2 ⊂ L1
  • None of the above

Question 35

Let P be a non-deterministic push-down automaton (NPDA) with exactly one state, q, and exactly one symbol, Z, in its stack alphabet. State q is both the starting as well as the accepting state of the PDA. The stack is initialized with one Z before the start of the operation of the PDA. Let the input alphabet of the PDA be Σ. Let L(P) be the language accepted by the PDA by reading a string and reaching its accepting state. Let N(P) be the language accepted by the PDA by reading a string and emptying its stack. Which of the following statements is TRUE?  
  • L(P) is necessarily Σ* but N(P) is not necessarily Σ*
  • N(P) is necessarily Σ* but L(P) is not necessarily Σ*
  • Both L(P) and N(P) are necessarily Σ*
  • Neither L(P) nor N(P) are necessarily Σ*

Question 36

Consider the regular grammar: S → Xa | Ya X → Za Z → Sa | ϵ Y → Wa W → Sa where S is the starting symbol, the set of terminals is {a} and the set of non-terminals is {S, W, X, Y, Z}. We wish to construct a deterministic finite automaton (DFA) to recognize the same language. What is the minimum number of states required for the DFA?

  • 2

  • 3

  • 4

  • 5

Question 37

A language L satisfies the Pumping Lemma for regular languages, and also the Pumping Lemma for context-free languages. Which of the following statements about L is TRUE?  
  • L is necessarily a regular language.
  • L is necessarily a context-free language, but not necessarily a regular language
  • L is necessarily a non-regular language
  • None of the above

Question 38

Given below is a program which when executed spawns two concurrent processes : semaphore X : = 0 ; /* Process now forks into concurrent processes P1 & P2 */
P1 P2
repeat forever V (X) ; Compute ; P(X) ;  repeat forever P(X) ; Compute ; V(X) ;
Consider the following statements about processes P1 and P2:
  1. It is possible for process P1 to starve.
  2. It is possible for process P2 to starve.
Which of the following holds?  
  • Both I and II are true
  • I is true but II is false
  • II is true but I is false
  • Both I and II are false

Question 39

Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and R4, as shown below.
P1 P2
Compute: Use R1; Use R2; Use R3; Use R4; Compute; Use R1; Use R2; Use R3;. Use R4;
Both processes are started at the same time, and each resource can be accessed by only one process at a time The following scheduling constraints exist between the access of resources by the processes:
  • P2 must complete use of R1 before P1 gets access to R1
  • P1 must complete use of R2 before P2 gets access to R2.
  • P2 must complete use of R3 before P1 gets access to R3.
  • P1 must complete use of R4 before P2 gets access to R4.
There are no other scheduling constraints between the processes. If only binary semaphores are used to enforce the above scheduling constraints, what is the minimum number of binary semaphores needed?  
  • 1
  • 2
  • 3
  • 4

Question 40

Which of the following input sequences will always generate a 1 at the output z at the end of the third cycle?

  • 0 0 0 1 0 1 1 1 1

  • 1 0 1 1 1 0 1 1 1

  • 0 1 1 1 0 1 1 1 1

  • 0 0 1 1 1 0 1 1 1

There are 90 questions to complete.

Last Updated :
Take a part in the ongoing discussion