2023-11-15
This commit is contained in:
6
CS1029/notes-2023-11-01
Normal file
6
CS1029/notes-2023-11-01
Normal file
@@ -0,0 +1,6 @@
|
||||
Edge contractions: merge two vertices, removing an edge between them
|
||||
Representations: adjacency list
|
||||
adjacency matrix
|
||||
What does the determinant of an adjacency matrix mean?
|
||||
incidence matrix: vertices against edges, 1 where edge is connected to vertex
|
||||
|
||||
1
CS1029/notes-2023-11-07
Normal file
1
CS1029/notes-2023-11-07
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
CS1029/notes-2023-11-08
Normal file
1
CS1029/notes-2023-11-08
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
CS1029/notes-2023-11-14
Normal file
1
CS1029/notes-2023-11-14
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
58
CS1029/practical-2023-11-03/relations
Normal file
58
CS1029/practical-2023-11-03/relations
Normal file
@@ -0,0 +1,58 @@
|
||||
1. a) {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5), (5, 5) }
|
||||
Reflexive: \forall x. (x, x) \in R
|
||||
Antisymmetric (& not symmetric): all pairs have x <= y. forall x, y. x <= y, !(y <= x) || y == x
|
||||
Transitive
|
||||
b) {(1, 2), (1, 4), (2, 1), (2, 3), (3, 2), (3, 4), (4, 1), (4, 3)}
|
||||
Not reflexive: there are no pairs of (x, x)
|
||||
Symmetric - all pairs have their reverse represented
|
||||
Not antisymmetric: symmetric and anti-symmetric are mutually exclusive
|
||||
Not transitive: (1, 2) and (2, 3) - 1 + 3 is not odd
|
||||
|
||||
2. {(item, quantity)}
|
||||
{(Name, {(key, value)})}
|
||||
{(Name, Address, {(Room type, price, {(key, value)})}, ...)}
|
||||
|
||||
3. 105 305 306 505 705 707 905 906 909
|
||||
|
||||
4. a) ab ac bc cb
|
||||
b) {(a, a), (a, b), (a, c), (b, b), (b, a), (b, c), (c, a), (c, b), (d, d)}
|
||||
|
||||
5.a) {(1, 1), (1, 2), (1, 4), (2, 1), (2, 3), (3, 2), (3, 3), (3, 4), (4, 1), (4, 3), (4, 4)}
|
||||
Not reflexive: (2, 2) is not present
|
||||
Symmetric, therefore not anti-symmetric
|
||||
Not transitive: (1, 2) and (2, 3), but not (1, 3)
|
||||
|
||||
b) 12 21 14 41 32 23 43 34
|
||||
Not reflexive
|
||||
Symmetric, therefore not antisymmetric
|
||||
Not transitive: 12 and 23 but not 13
|
||||
|
||||
6. 1 1 0 0
|
||||
1 1 0 0
|
||||
1 0 1 1
|
||||
0 0 0 1
|
||||
|
||||
Yes, it's reflexive
|
||||
|
||||
8. {(a, b) | a divides b OR b divides a}
|
||||
9. No, it's not transitive. (a, b) & (b, d), but not (a, d)
|
||||
10. a) Not equivalence relation: missing transitivity
|
||||
(1, 3) and (3, 2), but not (1, 2)
|
||||
b) {0}, {1, 2}, {3}
|
||||
11. \forall n \in N_0:
|
||||
0 + 3n
|
||||
1 + 3n
|
||||
2 + 3n
|
||||
|
||||
12. a) Y
|
||||
b) N: 0 is in both - not disjoint
|
||||
c) Y
|
||||
d) N: 0 is missing
|
||||
|
||||
13. a) 00 11 22 33 44 55 12 21 34 43 35 53 45 54
|
||||
b) 00 11 22 33 44 55 01 10 23 32 45 54
|
||||
c) 00 11 22 33 44 55 01 10 02 20 12 21 34 43 35 53 45 54
|
||||
|
||||
14. a) Y, trivially
|
||||
b) N: not antisymmetric ((2, 3) and (3, 2))
|
||||
c) N: not reflexive (no (3, 3))
|
||||
64
CS1029/practical-2023-11-10/graphs
Normal file
64
CS1029/practical-2023-11-10/graphs
Normal file
@@ -0,0 +1,64 @@
|
||||
1. Undirected, unlooped, multi-edged: multigraph
|
||||
b) directed, looped, multi-edged: directed pseudo-multigraph
|
||||
|
||||
2. ac bd
|
||||
b) cd cd dd ee ab bc
|
||||
|
||||
3. {{paper}}
|
||||
|
||||
4. vertices: 6
|
||||
edges: 6
|
||||
degree: a: 2 b: 4 c: 1 f: 3 e: 2 d: 0
|
||||
isolated: d
|
||||
pendant: c
|
||||
b) vertices: 5
|
||||
edges: 14
|
||||
degree: a: 6 b: 6 c: 6 d: 5 e: 3
|
||||
isolated: -
|
||||
pendant: -
|
||||
|
||||
5. vertices: 4
|
||||
in-a : 2
|
||||
out-a: 2
|
||||
in-b: 3
|
||||
out-b: 4
|
||||
in-c: 2
|
||||
out-c: 1
|
||||
in-d: 1
|
||||
out-d: 1
|
||||
|
||||
6. {ac} {bde}
|
||||
b) Not bipartite: 3-loop bcf would require 3 sets
|
||||
|
||||
7. {{ paper }}
|
||||
|
||||
8. a -> abcd
|
||||
b -> d
|
||||
c -> ab
|
||||
d -> bcd
|
||||
|
||||
9. | a b c d
|
||||
--+--------
|
||||
a | 1 1 1 1
|
||||
b | 0 0 0 1
|
||||
c | 1 1 0 0
|
||||
d | 0 1 1 1
|
||||
|
||||
10. {{ paper }}
|
||||
|
||||
11. v1 -> u1
|
||||
v2 -> u4
|
||||
v3 -> u2
|
||||
v4 -> u5
|
||||
v5 -> u3
|
||||
|
||||
12. v1 -> u4
|
||||
v2 -> u3
|
||||
v3 -> u1
|
||||
v4 -> u2
|
||||
|
||||
13. PSCL
|
||||
a) YNN4
|
||||
b) N---
|
||||
c) N---
|
||||
d) YYY5
|
||||
Reference in New Issue
Block a user