Q.1 – Q.30 carry one mark each. 1. Consider the following C function. float f,(float x, int y) { float p, s; int i; for (s=1,p=1,i=1; i⋅ m
⋅ ⋅
(B)
(C)
, ,>an a a12
∠ a a1,2,>an
⌠ 〉 (r1
r2
… rm)
∠
, ,>an a a12
( ⌠ 〉 r1∗ r2∗>∗ rm) ( ⌠ 〉 r1) r2)>) rm)
(D)
∠
, ,>an a a12
Q. 31-90 carry two marks each.
31.
Let (S, δ) be a partial order with two minimalelements a and b, and a maximum element c. Let P: S ‰ {True, False} be a predicate defined on S. Suppose that
P(a)= True, P(b)= False and P(x)
P(y) for all x, y S satisfying xδy,
where stands for logical implication. Which of the following statements CANNOT be true? (A) P(x) = True for all x S such that x b (B) P(x) = False for all x S such that x a and x c (C) P(x) = False for all x S such that b δ x and x c (D) P(x) = False for all x S such that a δ x and b δ x 32. Which of the following is a valid first order formula? (Here 〈 and are first order formulae with x as their only free variable) (A) ((x)[〈] (x)[]) (x)[〈 ] (B) (x)[〈] (x)[〈 ∋ ] (C) ((x)[〈 ( ] (x)[〈] (x)[〈] (D) (x)[〈 ] ((x)[〈] (x)[])
GATE CS - 2003
33.
Consider the following formula _ and its two interpretations I1 and I2 ]] 〈: (x)[Px (y)[Qxy ¬Qyy (x)[¬Px] I1: Domain: the set of natural numbers Px α ”x is a prime number‘ Qxy α ”y divides x‘ I2: same as I1 except that Px = ”x is a composite number‘. Which of the following statements is true? (A) I1 satisfies 〈, I2 does not (C) Neither I2 nor I1 satisfies 〈 (B) I2 satisfies 〈, I1 does not (D) Both I1 and 12 satisfy 〈 kn, 34.
m identical balls are to be placed in n distinct bags. You are given that m ε where k is a natural number ε1. In how many ways can the balls be placed in the bags if each bag must contain at least k balls? ≈m k ’ ≈ + m kn n (B) ∆ n 1
«
1
’ ÷ ◊
(A)
« ∆n
1◊
÷
(C) ∆ 35.
≈m 1’ ÷
«n k ◊
≈m kn + + n k
2’
÷
◊
(D) ∆
«