75 views
0 0 votes

Consider $\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ}),\mathrm{Enrollment}(\mathrm{sid},\mathrm{cid}).$

Using the above schema, which condition correctly characterizes a course $c$ whose all enrolled students belong to the same university, while also including a course with no enrolled students?
 

  1. $\exists s_1,s_2,n_1,n_2,u_1,u_2(\mathrm{Student}(s_1,n_1,u_1)\land \mathrm{Enrollment}(s_1,c)\land \mathrm{Student}(s_2,n_2,u_2)\land \mathrm{Enrollment}(s_2,c)\land u_1=u_2)$
     
  2. $\forall s_1,s_2(\mathrm{Enrollment}(s_1,c)\land \mathrm{Enrollment}(s_2,c))$
     
  3. $\forall s_1,s_2,n_1,n_2,u_1,u_2((\mathrm{Student}(s_1,n_1,u_1)\land \mathrm{Enrollment}(s_1,c)\land \mathrm{Student}(s_2,n_2,u_2)\land \mathrm{Enrollment}(s_2,c))\Rightarrow u_1=u_2)$
     
  4. $\exists s(\mathrm{Student}(s,n,u)\land \mathrm{Enrollment}(s,c))$

1 Answer

0 0 votes

We must ensure that any pair of students enrolled in the same course has the same university.

So choose arbitrary enrolled students $s_1$ and $s_2$.

If both are enrolled in course $c$, then require $u_1=u_2$.

Hence,

$(\mathrm{Student}(s_1,n_1,u_1)\land \mathrm{Enrollment}(s_1,c)\land \mathrm{Student}(s_2,n_2,u_2)\land \mathrm{Enrollment}(s_2,c))\Rightarrow u_1=u_2$.

This condition must hold for all pairs, so universal quantification is required.

A useful equivalent form is, there must not exist two students enrolled in the course with $u_1\neq u_2$.

That follows from

$\forall x(P(x)\Rightarrow Q(x))\equiv\neg\exists x(P(x)\land\neg Q(x))$.

Let's see what happens for a course with zero or one enrolled student.

There is no pair violating the condition, so the universal expression is true.

Therefore such courses are correctly retained.

Hence,

Answer : $\boxed{\mathrm{C}}$

Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
101
101 views
GO Classes asked Sep 29
101 views
Consider the relation $\mathrm{Sailors}(\mathrm{sid},\mathrm{sname},\mathrm{rating},\mathrm{age})$ and the following TRC expression: $$\{S\mid \neg(S\in \mathrm{Sailors})...
0 0 votes
1 1 answer
79
79 views
GO Classes asked Sep 29
79 views
Consider$\mathrm{Course}(\mathrm{cid},\mathrm{name},\mathrm{year},\mathrm{duration})$$\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ})$$\mathrm{Instructor}(\mat...
1 1 vote
1 1 answer
78
78 views
GO Classes asked Sep 29
78 views
Using the same $\mathrm{Manager}$, $\mathrm{Stores}$, $\mathrm{Sales}$, and $\mathrm{Products}$ schema from the exam, define:$\mathrm{NailSale}(S)$ = store $S$ sold more ...
1 1 vote
1 1 answer
84
84 views
GO Classes asked Sep 29
84 views
Consider $\mathrm{Manager}(\mathrm{NAME})$ and $\mathrm{Stores}(\mathrm{STORE\_ID},\mathrm{ADDRESS},\mathrm{REGION},\mathrm{MANAGER})$.Which TRC expression correctly retu...