MCQs
Let `oplus` denote the Exclusive OR (XOR) operation. Let '1' and '0' denote the binary
constants. Consider the following Boolean expression for F over two variables P and Q.
F (P, Q) = ((1 `oplus` P) `oplus` (P `oplus` Q)) `oplus` ((P `oplus` Q) `oplus` (Q `oplus` O))
The equivalent expression for F is
F (P, Q) = ((1 `oplus` P) `oplus` (P `oplus` Q)) `oplus` ((P `oplus` Q) `oplus` (Q `oplus` O))
= (`overline(P)` `oplus` (P`overline(Q)` + `overline(P)`Q)) `oplus` ((P`overline(Q)` + `overline(P)`Q) `oplus` Q)
=[`overline(P)`(PQ + `overline(P)` `overline(Q)`) + P(P`overline(Q)` + `overline(P)`Q)] `oplus` [(PQ + `overline(P)` `overline(Q)`) Q + (P`overline(Q)` + `overline(P)`Q)`overline(Q)`]
=(`overline(P)` `overline(Q)` + P`overline(Q)`) `oplus` (PQ + P`overline(Q)`) = `overline(Q)` `oplus` P = PQ + `overline(P)` `overline(Q)` = `overline(P oplus Q)`
Consider the following relational schema:
Employee (`underline(empId)`, empName, empDept)
Customer (`underline(custId)`,custName, salesRepId, rating)
SalesRepId is a foreign key referring to empId of the employee relation. Assume that each
employee
makes a sale to at least one customer. What does the following query return?
SELECT empName
FROM employee E
WHERE NOT EXISTS (SELECT custId
FROM customer C
WHERE C. salesRepId = E. empId
AND C. rating < > 'GOOD')
The outer query will return the value (names of employees) for a tuple in
relation E, only if
inner query for that tuple will return no tuple (usage of NOT
EXISTS). The inner query will run for every tuple of outer query. It selects
cust-id for an employee e, if
rating of customer is NOT good. Such an employee
should not be selected in the output of
outer query.
So the query will return the names of all those employees whose all customers
have GOOD rating.
Given statement is ~ `forall` d [r (d) `rightarrow` c (d)]
`equiv` ~ `forall` d[ ~ r(d) `or` c (d)]
`equiv` `exists` d[ r (d) `and` ~ c(d)]
(Since p `rightarrow` q `equiv` ~ p `or` q and let r(d) be rainy day, c(d) be cold day)
We know that v + r = e + 2 `rArr` e = n + r - 2 ... (1)
Where V = n(number of vertices) ;r number of faces and
e = number of edges
Given, `delta` `ge` 3 then 3n `ge` 2e
`rArr` e `ge` `(3n)/2`
`rArr` n + r - 2 `ge` `(3n)/2` (u sin g (1))
`rArr` r `ge` `(3n)/2` - n + 2 `rArr` r `ge` `n/2` + 2
`:.` Number of faces is atleast `n/2` + 2
Let `n_1`, `n_2`,.....`n_k` be the number of vertices respectively in K connected components of a
forest G,
then `n_1` - 1, `n_2`- 1,.....,`n_k` - 1 be the number of edges respectively in K connected
components and
`n_1` + `n_2` +..... + `n_k` = n (number of vertices in G)
Hence, number of edges in G = number of edges in K connected components
= (`n_1` - 1) + (`n_2` - 1`) +...... + (`n_k`) - 1 = n - k