HW 3 2
HW 3 2
HW 3 2
February,11 2024
1 Section 9.1
3/
a/ transitive
b/ reflexive,symmetric,transitive
c/ symmetric
d/ antisymmetric as false → false :true
e/ reflexive, symmetric, antisymmetric,transitive
f/ none of these relations
4/
a/antisymmetric, transitive
b/ reflexive, symmetric, transitive.It is not antisymmetric as a and b are
not the same person and they are just born on the same day
c/reflexive, symmetric and transitive.
d/ reflexive, symmetric. It is not antisymmetric as a and b are unequal
person. It is not transitive as if b and c are cousin and they have a com-
mon granparent and a and c aren’t cousins and sibling so a and c can’t
have a common grandparent → not transitive
5/
a/ reflexive, transitive.It is not symmetric as ones have visited web b
don’t mean they have visited web a. It is not antisymmetric as web a
not equal web b.
b/ symmetric
1
c/ symmetric. It is not reflexive as the exercise states that there is a
common link from web a to b and from b to a, not from and to itself.
Not antisymmetric as web a and b are not the same. Not transitive, as
if there is a common link from web b to c, this doesn’t mean there is a
common link that link directly from a to c
d/ symmetric as web page includes links to both web a and b.
6/
a/x+y=0 :symmetric
+ not reflexive as there is a counterexample: 2+2̸= 0
+ not antisymmetric as x=-y so they are not equal
+ not transitive as (2, −2) ∈ R ∧ (−2, 2) ∈ R but (2, 2) ∈
/R
b/x=±y : reflexive, symmetric, transitive
+ not antisymmetric as (−1, 1) ∈ R, (1, −1) ∈ R but -1 ̸= 1 ( true →
false is false)
c/ x-y is a rational number
+ reflexive as x-x=0,0 is a rational number
+ symmetric as if x-y is rational the y-x is, too
+ not antisymmetric as (−1, 1) ∈ R and (1, −1) ∈ R but -1̸= 1
+ transitive
d/x=2y: antisymmetric
e/ xy ≥ 0: reflexive. symmetric
f/ xy=0:
+ not reflexive since there is a counterexample: 1x1̸= 0
+ it is symmetric
+ not antisymmetric and transitive
g/ x=1: + not reflexive as it isn’t right with (3, 3)
+ not symmetric as it is right with (1, 2) but not right with (2, 1)
+ antisymmetric as if both (x, y) ∈ R ∧ (y, x) then x=y=1
+ transitive
h/ x=1 or y=1
+ not reflexive as it isn’t right with (3, 3)
2
+ symmetric as x and y has the same role + not antisymmetric as
(3, 1)(1,3)∈R but 2 is not equal to 1
+ not transitive
8/-as R= ∅ on a nonemptyset S so the hypotheses of both symmetric
and transitive are always false, which mean those statements are always
true. Meanwhile as S contains elements so (a, a) ∈ / R as R= ∅
9/-as R= ∅ on an emptyset S so the hypotheses of both symmetric and
transitive are always false which means those statements are always true.
Besides, as S= ∅ so the hypothesis statement ”If a ∈ S then (a, a) ∈ R”
is false so the statement is true.
10/
a/Let’s set R on a set S={a, b} Both symmetric and antisymmetric:R={(a, b) |a =
b}
b/ neither symmetric nor antisymmetric:
Let’s set R on a set S={1, 2, 3}
R={(1, 2) , (2, 1) , (2, 3) , }
11/ irreflexive: for every a ∈ A, (a, a) ∈ /R
exercise 3:c,d,f
12/a
13/ b
14/ irreflexive: all of them (as it is not right with (0, 0)
15/yes. for example set R on a set S={1, 2, 3}
R={(1, 1) , (1, 2) , (2, 1) , (2, 3) , }
16/ ∀a ∈ S, (a, a) ∈ /R
17/ (x, y) ∈ R that x is fatter than y : irreflexive as x can’t be fatter
than himself/herself.
18/- a,b,e are not asymmetric as they contain (a, a)
- c,d,f are asymmetric
19/
asymmetric: a
20/
3
asymmetric: a
21/
-a,b,c,e,f: the roles of x and y are the same.
-d is not asymmetric as it is not right with (0, 0)
-g,h is not asymmetric as it is not right with (1, 1)
22/ An asymmetric statement is always antisymmetric as the hypothesis
statement of antisymmetric statement is false .
23/
∀x, ∀y, (x, y) ∈ R → (y, x) ∈ /R
24/ R={(a, b) |a > b} with a,b denote the height of each person
25/ 2m×n
26/
a/ R−1 = {(b, a) |a < b}
b/ R = {(a, b) |a ≥ b}
27
a/R−1 = {(b, a) |a/b}
b/ R = {(a, b) |b/a}
28/
a/ R−1 = {(b, a) | state a borders state b} = {(a, b) | state a borders state
b} as the bordering relationship is symmetric
b/ R = {(a, b) | state a and b are not neighbors}
29/- The inverse relation R−1 equals to the graph of f −1
30
a/ {(1, 1) , (1, 2) , (2, 1) , (2, 2) , (2, 3) , (3, 1) , (3, 2) , (3, 3) , (3, 4)}
b/{(1, 2) , (2, 3) , (3, 4)}
c/∅
d/{(1, 1) , (2, 1) , (2, 2) , (3, 1) , (3, 2) , (3, 3)}
31/
a/{(a, b) | a is required to read or has read book b}
b/{(a, b) | a is required to read book b and has read book b}
c/{(a, b) | a is required to read or has read book b but not happen
4
simutaneously}
d/{(a, b) | a is required to read book b but hasn’t read book b}
e/{(a, b) | a has read book b but a isn’t required to read book b}
32/
S◦R={(1, 1) , (1, 2) , (2, 2) , (2, 1)}
33/
+ S◦R={(a, b)}then we have (a, c) ∈ R which means a is a parent of
c.(c, b) ∈ S which means c is a sibling of R then S◦R={(a, b)} means a
is a parent of b too
+ R◦S={(a, b)}: we have (a, c) ∈ S which means a is a sibling of
c.(c, b) ∈ R means c is a parent of b so R◦S={(a, b)} means a is an
uncle or aunt of b
39/
S1 40/
we have to find (a, b) ∈ R: a is a parent of b; (b, c) ∈ R: b is a parent of
c, then (a, c) ∈ R2 : a is a grandparent of c.
41/
this sequence start with a and end at b that a was the thesis advisor of
someone and b was a last doctorate.
42/
a/ {(a, b) |a/b ∨ b/a}
b/{(a, b) |a/b ∧ b/a}
c/{(a, b) |a/b ∧ b ∤ a}
d/{(a, b) |a ∤ b ∧ b/a}
e/{(a, b) |a/b ∨ a/b but not simutaneously}
43/
a/ {(a, b) |a ≡ b ( mod 3 or mod 4)}
b/{(a, b) |a ≡ b ( 12)}
c/{(a, b) |a ≡ b (mod 3)∧a ̸= b (mod4)}
e/ c/{(a, b) |a ≡ b (mod 3)∨a ≡ b (mod4)but not simutaneously}
51/
5
2 Section 9.2
5/-Composite key with 2 fields containing the Airline: Airline, Flight number,
Departure time
+ Gate is not a composite key as Nadir Airline has the same gate 34 for
2 flights so it is not valid
+ Destination is not a composite key as Nadir Airline has 3 flights going
to Detroit.
6/-Composite key with 2 fields containing the Professor: Course number,
Time
- Not a composite key:
+ Department: as Pr.Cruz has lectures as Zoology Department 2 times.
The same things happen with Pr.Farber at Psychology Department
+Room: Pr. Farber has 1 lecture at A100 room and Pr.Cruz has 2 lec-
tures at A100 room
7/
a/ Student ID number is definitely a primary key as each student has
different ID number,
b/No because more than 1 people can have the same name
c/ No
8/
a/ yes as it is unique to each book
b/ no
c/ no
9/
a/ Primary key: Social Security number
b/ No more than 1 person has the same name and the same Street ad-
dress
c/ No more than 1 person has the same name,the same Street address
and city
6
28/
a/ Operations that correspond: It selects the Suppiler from Part needs
table with the Parts number range form 1000 to 5000 and delete the du-
plicates
b/- Table 11: (23; 1092; 1) , (23; 1101; 3) , (31; 4975; 3) , (31; 3477; 2) , and (33; 1001; 1)
29/
a/ Operations that correspond: It select Supplier and Project from
Part needs and Part inventory tables if the Quantity is not above 10
b/ (23, 1) , (23, 3) , (31, 3) , (32, 4)
32/
33/
a/- Diapers:+ Count:5, Support:5/6
b/ frequent itemsets (≥ 0.6):
{diapers} {milk} {diapers, milk}
34/
a/-Neanderthal: + count=5
+ support:5/8
b/frequent itemsets: + {evolution}, {Neanderthal}, {Human} (they ap-
pear 5 times)
+{Human, Neanderthal} ( appears 5 times)
35/
σ{beer} → {diapers} =σ{beer, diapers}= 2 → support= 31
- confidence= 23
36/σ{human, DNA} → {Neanderthal} =σ{human, DNA, Neanderthal}= 38
- confidence({human, DNA} → {Neanderthal}) =1
3 Section 9.3
7
place symmetrically around the main diagonal
7/
a/ reflexive, symmetric, transitive
+ not irreflexive and asymmetric as the main diagonal contains only 1s
+ not antisymmetric as 1 pair of 1s places symmetrically around the
main diagonal
b/ antisymmetric, ttransitive
c/ symmetric
8/
a/ - symmetric
+ it is neither reflexive nor irreflexive as the main diagonal contain both
1s and 0.It is not antisymmetric and asymmetric as there are 2 pairs of
1s place symmetrically around the main diagonal
+ it is not transitive as the Boolean square is not itself
b /- reflexive, antisymmetric
+ it is not irreflexive and asymmetric as the main diagonal contains only
1s
+ it is not symmetric as 0s can be placed symmetrically with 1s
+it is not transitive as the Boolean square is not itself
c/ - irreflexive,symmetric
+ it is not irreflexive and asymmetric as the main diagonal contains only
1s
It is not antisymmetric and asymmetric as there are 2 pairs of 1s place
symmetrically around the main diagonal
+ it is not transitive as the Boolean square is not itself
9/
a/ nonzero entries if a>b:with 1, all of the entries are zero. With 2, we
have 1 nonzero entries, with 3 we have 2 nonzero entries then we recog-
nize the rules :we have 1+2+3+....+99 nonzero entries = 4950 nonzero
entries
b/ever positive number has 99 nonzero entries so with 100 positive num-
8
bers, we have 99x100=9900 nonzero numbers
c/ every positive number has 1 nonzero entry except 1 so we have 99
nonzero entries
d/with a=1,whatever b is, we still have 100 nonzero entries
e/ only 1 nonzero entries when both a and b are equal 1.
10/
a/- when a=1, we have 1000 nonzero entries, when a=2, we have 999
nonzero entries, then 1000+999+...1=500500 nonzero entries
b/when a=1 or a=1000, we have 1 nonzero entry, while with the re-
maining 998 positive numbers, each has 2 non-zero entries. so we have
1+1+2x998=1998 non-zero entries
c/ we have (1, 999) , (2, 998) , (3, 997) .... (500, 500) which means from 1 to
999, each has 1 nonzero entry so we have 999 nonzero entries
d/ we have 1000+999+..+1=500500 nonzero entries
e/ as a is always different from 0 so we have 1000x1000=1000000 nonzero
entries
11/-change 1s to 0s and inverse
12/- change the row to column and change the column to the row .
13/
a/R−1
0 1 1
1 1 0
1 0 1
b/R
1 1 0
0 0 1
0 1 0
9
c/R2
1 1 1
1 1 1
1 1 1
14/ a/
0 1 0
1 1 1
1 1 1
b/
0 1 0
0 1 1
1 0 0
c/
0 1 1
1 1 1
0 1 0
d/
1 1 1
1 1 1
0 1 0
e/
0 0 0
1 0 0
0 1 1
15/ a/R2
0 0 1
1 1 0
0 1 1
10
b/ R3 = R2 ◦ R
1 1 0
0 1 1
1 1 1
c/R4 = R ◦ R
0 1 1
1 1 1
1 1 1
29/ asymmetric directed graph means it is not reflexive and antisym-
metric so the directed graph can’t have loops and closed paths
30/ the directed graph is irreflexive when it has no loops
31/ - ex23: irreflexive as it has no loops, only from b to c has closed
path so it isn’t symmetric and antisymmetric
- ex24: reflexive, antisymmetric( as there aren’t no anti-parallel edges),
transitive - ex25: irreflexive, antisymmetric
32/
- ex26: reflexive
- ex27: symmetric as it appears antiparallel pairs which also means it
is not antisymmetric, so it can’t be asymmetric. It is not reflexive or
irreflexive as loops do appear but not appear at all vertexes.
- ex28: reflexive as it has all loops at all vertexes (not reflexive), sym-
metric as antiparallel pairs appear at (a, b) and (c, d). It is transitive as
it has 2 paths and loops at a,b,c,d
33/- reverse the direction of each of the directed graph.
34/ eliminate all edges and loops that exists in directed graph and add
edges and loops where they didn’t exist.
35/ we have MR =R, MR2 = MR ◦ MR = R ◦ R → MRk = MRk−1 ◦ MR =
Rk−1 ◦ R = Rk
→ MRk ◦ MR = Rk ◦ R = Rk+1 → MRk+1 = Rk+1
36/
- union: combine the edges of both graphs. This new graph will contain
11
all the edges and loops of these 2 graphs
- intersection: Take all the edges and loops which both of 2 relations all
have and eliminate ones that just belong to one relation.
- symmetric difference: take all the edges and loops that just belong to
one relation and eliminate ones that belong to both of the relations
-difference:take only the edges and loops of 1 relation but not in the other
relation
-composition: draw the same directed graph having the same vertices ,
if there is an edge from a to b in R and an edge from b to c in S then,
add an edge from a to c.
4 9.4
c• •d
12