Final Exam
Final Exam
Part A
Question 1
In Company, there are 55 members of staff. Each member posts a greeting card to all the members. How many greeting cards where posted by them?
Each person posts to 54 people. Therefore:
55 * 54 = 2970
Question 2
Which of the following represents the set:
Question 3
Let be a relation on the set of positive integers with
Which of the following statements is true about this relation ?
- It is reflexive. , . A number always divides itself.
- It is NOT symmetric. , If , then is NOT true. For example, 2 / 4 is true, but 4 / 2 is false.
- It is transitive. if and then . If 2 / 4 and 4 / 8 then 2 / 8. If 3 / 6 and 6 / 60 then 3/ 60.
Therefore the answer is reflexive, transitive and NOT symmetric.
Question 4
Which of the following are not functions?
The trick to this will be to find the ones that have invalid input in the range.
a.
This is a function. As there are no negative numbers returned , , so it will never divide by 0.
b.
This is NOT a function, as the range is invald when
c.
This is NOT a function, as the range is invalid when ,
d.
This is a function. There isn't any number in the set of rational numbers that can't be divided by 2.
Question 5
Which degree sequence cannot represent a simple graph?
We know that for a simple graph, the degree of each vertex of G is at most equal to .
Therefore: is not a simple graph.
Question 6
Let and be two propositions. Which one of the following logical expression is equivalent to
p | q | ||||||||
---|---|---|---|---|---|---|---|---|---|
0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |
1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
Question 7
What is the number of edges in a complete graph ?
Number of edges in complete graph =
\begin{align} &= 10 * 9 / 2 \\ &= 90 / 2 \\ &= 45 \end{align}
Question 8
In how many ways a committee of 5 members can be selected from 6 men and 5 women, consisting of 3 men and 2 woman?
Number of ways we can select 3 men from 6 men (given order is not important):
Number of ways we can select 2 woman from 5 woman:
Using the multiplication principle, we get 20 * 10 = 200
Question 9
In how many ways can a football team of 11 be selected from a squad of 15 players?
Question 10
Consider the following predicate logic statement:
, ,
Which one of the predicate logic statements below is equivalent to the negation of the original statement?
, ,
, ,
We can simplify that, knowing that the negation of is
, ,
Part B
Question 1
a. List the elements of the following sets
i.
ii.
iii.
b. Let and be two sets such that and . Find:
i.
\begin{align} |A \cup B| &= |A| + |B| - |A \cap B|\\ &= n + n - 1 \\ &= 2n - 1 \end{align}
ii.
We know that . Therefore,
c. Prove the following set identities, using either Venn Diagrams or the rules of sets. Show your working.
i.
The set identity is not correct.
It can be simplified based on absorption rule:
It would only be correct when
This venn diagram shows that
ii.
This statement is FALSE.
This Venn Diagram shows that
iii.
This Venn Diagram proves that this set identity is TRUE.
d. Let , and be three propositions for which and are T and is false. Determine the truth value for each of the following.
i.
ii.
iii.
e. The universe of discourse is the set of all positive integers,
What are the truth values for each of the following?
i.
True
When , is true for all
ii.
False.
These are no positive integers that can be added to make zero, or multiplied to make zero. This would only be true if the universe of discourse included 0 or negative numbers.
iii.
False.
When and , and ,
f. Re-write the following statements without any negations on quantifiers.
i.
ii.
iii.
g. Decide whether the following arguments are valid or not. State the Rule of Inference or fallacy userd.
Note: I assume this parent question description is wrong, based on the questions below it.
i. Let , , and be three sets. Prove by contradiction that if and then
To prove by contradiction, we start on the assumption that the statement we want to prove is false, and show this leads to false proposition.
Assume that and then
From set difference, we have and . Since , we have Therefore, we have and , which contradicts the assumption that
Therefore, our assumption that must be false. This proves that and then
ii. Suppose that I want to purchase a tablet computer. I can choose either a large or a small screen; a 64GB, 128GB or 256 GB storage capacity and black, while, gold or silve cover.
Screen options = 2 Storage capacity options = 3 Cover colour options = 4
Total options = 2 * 3 * 4 = 24
Question 3
a. Explain the difference between a Euler path and an Euler cycle
A Euler path is a path in a graph that visited each edge exactly once. A Eyler cycle is a Euler path that visits each edge exactly once, but which ends at the same vertex.
The key difference is that a Euler path ends at different vertices, where a cycle ends at the same vertex.
b. Find the maximum nnumber of comparisons to be made to find any record in a binary search tree which holds 3000 records.
Assuming the tree is balanaced, the maximum number of comparisons to be made is equal to the height.
We calculate the height as
h = 9
Therefore, there are 9 comparisons to be made to find any record in a balanaced BST.
c. Explain what is meant by the term "path"
A path is a trail (where no edge is repeated) where neither vertices nor edges are repeated.
d. The figure shows a network of cycle tracks. The number on each edge represents the length, in milse, of that track. Jay wishse sto cycle from A to I as part of a cycling holiday. She wishes to minimise the distance she travels.
Init.
Node | Shortest path from A |
---|---|
A | 0 |
Unvisited = {B, D, E, C, F, G, H, I}
Step 2.
Visit B.
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
Unvisited = {D, E, C, F, G, H, I}
Step 3.
Visit E.
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 | B |
Unvisited = {D, C, F, G, H, I}
Step 4.
Visit D
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 | B |
D | 23 + 28 | B |
Unvisited = {D, C, F, G, H, I}
Step 5.
Visit C
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 | B |
D | 23 + 28 | B |
C | 39 | A |
Unvisited = {F, G, H, I}
Step 6.
Visit F
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 =50 | B |
D | 23 + 28 = 51 | B |
C | 39 | A |
F | 51 + 21 = 83 | D |
Unvisited = {G, H, I}
Step 7.
Visit G
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 =50 | B |
D | 23 + 28 = 51 | B |
C | 39 | A |
F | 51 + 21 = 83 | D |
G | 51 +37 = 88 | D |
Unvisited = {H, I}
Step 7.
Visit G
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 =50 | B |
D | 23 + 28 = 51 | B |
C | 39 | A |
F | 51 + 21 = 83 | D |
G | 51 +37 = 88 | D |
Unvisited = {H, I}
Step 8.
Visit I
Node | Shortest path from A | Previous vertex |
---|---|---|
A | 0 | A |
B | 23 | A |
E | 23 + 27 =50 | B |
D | 23 + 28 = 51 | B |
C | 39 | A |
F | 51 + 21 = 83 | D |
G | 51 +37 = 88 | D |
I | 88 + 21 = 109 | G |
Unvisited = {H}
Shortest path: A -> B -> D -> G -> I
e) Given is the st of integers {2, 3, 4, 5, 6, 7, 8}. Let R be a relation defined on S by the following condition such that:
, if then x mod 2 = y mod 2
i. Draw the digraph of R
ii. Show that R is an equivalence relation.
- R is reflexive. ,
- R is symmetric. , if , then
- R is transitive. , if AND then
Therefore is a equivalence relation.
iii. Find the equivalence classes for R.
iv. Is item R a partial order?
To be a partial order, R must reflexive, transitive and ANTI-symmetric. R is NOT anti-symmetric. , if and it is NOT the case that for example and but
f. Let and be functions. Prove that if g o f is one-to-one , then f is one-to-one.
Proof
Since is one-to-one, we show that for all if then
is a one-to-one function. So, given with then
Therefore, .
Therefore, , which implies is a one to one function.