GATE 2014 (Session 1)
65 questions
MCQ 40 · NAT 251-mark 30 · 2-mark 35
Questions 61–65 of 65
Consider an undirected graph G where self-loops are not allowed. The vertex set of G is {(i,j):1i12, 1j12}. There is an edge between (a,b) and (c,d) if |a-c|1 and |b-d| 1. The number of edges in the graph is ____.
Answer: 506
The graph is a 12 12 grid. Every cell is joined to all 8 cells around it, like the moves of a king in chess.
- Horizontal edges: 12 11 = 132
- Vertical edges: 12 11 = 132
- Diagonal edges, counting both directions: 2 11 11 = 242
Total = 506
Answer: 506
- Horizontal edges: 12 11 = 132
- Vertical edges: 12 11 = 132
- Diagonal edges, counting both directions: 2 11 11 = 242
Total = 506
Answer: 506
An ordered n-tuple () with is called graphic if there exists a simple undirected graph with n vertices having degrees respectively. Which of the following 6-tuples is NOT graphic?
Answer: (C)
Take the tuple (3, 3, 3, 1, 0, 0). Leave out the two vertices of degree 0. That leaves 4 vertices with degrees 3, 3, 3, 1.
Every vertex of degree 3 has to join all three of the other vertices. So the fourth vertex would end up with degree 3, and not 1. This tuple is not graphic.
The other tuples are graphic. For example, three separate edges, a 6-cycle and a small tree work for them.
Answer: (3, 3, 3, 1, 0, 0)
Every vertex of degree 3 has to join all three of the other vertices. So the fourth vertex would end up with degree 3, and not 1. This tuple is not graphic.
The other tuples are graphic. For example, three separate edges, a 6-cycle and a small tree work for them.
Answer: (3, 3, 3, 1, 0, 0)
Which one of the following propositional logic formulas is TRUE when exactly two of p, q, and r are TRUE?
Answer: (B)
Exactly two of are true in three cases: true and false; true and false; true and false. The last two together mean is true and exactly one of is true, which is . The first is . The OR of these two is (B).
- (A) is true when is true (all three), so it is wrong.
- (C) is true when and are false and is true (only one true), so it is wrong.
- (D) joins the two cases with AND. One needs true and the other false, so it is never true.
Answer: (B)
- (A) is true when is true (all three), so it is wrong.
- (C) is true when and are false and is true (only one true), so it is wrong.
- (D) joins the two cases with AND. One needs true and the other false, so it is never true.
Answer: (B)
Given the following schema:
employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id)
You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700. You issue the following query:
employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id)
You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700. You issue the following query:
SQL>SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAx(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id); What is the outcome?Answer: (B)
For each department at location 1700, the subquery gives the dept-id and the latest hire date. The outer query then keeps the employees whose (dept-id, hire-date) pair appears in that list. A multi-column IN is valid. GROUP BY can also be used in a subquery that has a join.
Answer: It executes and gives the correct result
Answer: It executes and gives the correct result
Consider two processors P1 and P2 executing the same instruction set. Assume that under identical conditions, for the same input, a program running on P2 takes 25% less time but incurs 20% more CPI (clock cycles per instruction) as compared to the program running on P1. If the clock frequency of P1 is 1GHz, then the clock frequency of P2 (in GHz) is _________.
Answer: 1.6
Execution time is IC CPI / f. Use these two relations:
and
Frequency of P2:
GHz
Answer: 1.6
and
Frequency of P2:
GHz
Answer: 1.6