GATE 2018 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2018

65 questions

MCQ 41 · NAT 241-mark 30 · 2-mark 35

Questions 51–55 of 65

Q51Relational Algebra2 marksMCQ−0.67 if wrong
Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B. Consider the query
Q:r⋈(σB<5(s))Q:r \Join (\sigma _{B\lt 5}(s))
Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null values.
Which one of the following queries is NOT equivalent to Q?

Q52Normal Form2 marksMCQ−0.67 if wrong
Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed. The underlined attributes are the respective primary keys.
Schema I: Registration (rollno, courses)
 Field 'courses' is a set-valued attribute containing the set of courses a student has registered for.
 Non-trivial functional dependency:
 rollno → courses

Schema II: Registration (rollno, courseid, email)
 Non-trivial functional dependencies:
 rollno, courseid → email
 email → rollno

Schema III: Registration (rollno, courseid, marks, grade)
 Non-trivial functional dependencies:
 rollno, courseid → marks, grade
 marks → grade

Schema IV: Registration (rollno, courseid, credit)
 Non-trivial functional dependencies:
 rollno, courseid → credit
 courseid → credit
Which one of the relational schemas above is in 3NF but not in BCNF?

Q53Graph Theory2 marksNAT
Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1,2,...,100. There is an edge between vertices u and v if and only if the label of u can be obtained by swapping two adjacent numbers in the label of v. Let y denote the degree of a vertex in G, and z denote the number of connected components in G. Then, y+ 10z = _____.

Q54Probability Theory2 marksNAT
Consider Guwahati (G) and Delhi (D) whose temperatures can be classified as high (G), medium (M) and low (L). Let P(HGH_{G}) denote the probability that Guwahati has high temperature. Similarly, P(MGM_{G}) and P(LGL_{G} ) denotes the probability of Guwahati having medium and low temperatures respectively. Similarly, we use P(HDH_{D}),P(MDM_{D}) and P(LDL_{D}) for Delhi.
The following table gives the conditional probabilities for Delhi's temperature given Guwahati's temperature.
HD MD LD HG 0.40 0.48 0.12 MG 0.10 0.65 0.25 LG 0.01 0.50 0.49
Consider the first row in the table above. The first entry denotes that if Guwahati has high temperature (HGH_{G}) then the probability of Delhi also having a high temperature (HDH_{D}) is 0.40; i.e., (HDH_{D}|HGH_{G}) = 0.40. Similarly, the next two entries are P(MDM_{D}| HGH_{G})= 0.48 and P(LDL_{D}|HGH_{G}) = 0.12. Similarly for the other rows. If it is known that P(HGH_{G})= 0.2, P(MGM_{G})= 0.5, andP(LGL_{G})= 0.3, then the probability (correct to two decimal places) that Guwahati has high temperature given that Delhi has high temperature is _______

Q55Function2 marksNAT
Consider the following program written in pseudo-code. Assume that x and y are integers.

Count(x,y) {
     if (y != 1){
        if (x != 1) {
                  print("*");
                  Count(x/2, y);
                  }
            else {
                     y = y-1;
                    Count(1024, y);
                  }
      }
} 
The number of times that the print statement is executed by the call Count(1024,1024) is _____.