0% found this document useful (0 votes)
12 views8 pages

DM Midterm Assessment 2020 21

The document is a midterm assessment for a Computer Science course focusing on Discrete Mathematics, consisting of five questions covering topics such as Set Theory, Functions, Propositional Logic, Predicate Logic, and Boolean Algebra. Each question requires detailed answers, including proofs, diagrams, and symbolic representations, with a total of 100 marks available. Candidates are instructed to answer all questions for full marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

DM Midterm Assessment 2020 21

The document is a midterm assessment for a Computer Science course focusing on Discrete Mathematics, consisting of five questions covering topics such as Set Theory, Functions, Propositional Logic, Predicate Logic, and Boolean Algebra. Each question requires detailed answers, including proofs, diagrams, and symbolic representations, with a total of 100 marks available. Candidates are instructed to answer all questions for full marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

MIDTERM ASSESSMENT

CM120

BSc EXAMINATION

COMPUTER SCIENCE

Discrete Mathemaitcs

INSTRUCTIONS TO CANDIDATES:

This assignments consists of five questions. You should answer all five questions.
Full marks will be awarded for complete answers to a total of Five questions.
The marks for each part of a question are indicated at the end of the part in [.]
brackets.
There are 100 marks available on this paper.

© University of London 2020

UL21/120 Page 1 of 8
Question 1 Set Theory

(a) i. Describe the following set using the listing method:

A = {x : x ∈ Z and 0 ≤ x3 < 100}

[2]
ii. Rewrite the following set using the set builder method:

B = {−1, 1/2, −1/3, 1/4, −1/5, 1/6, · · · }

[2]

(b) In a survey of 200 student, it was found that: 150 students took programming
(P), 80 students took mathematics (M), 55 students took art (A), 60 students
took mathematics and programming (M & P), 25 students took took art
and mathematics (A & M), 40 students took art and programming (A & P),
and 15 students took art, mathematics and programming (A & M & P).

i. Draw a Venn diagram to display this information.


ii. Use Venn diagram to the find the number of students that took
1. programming only
2. two modules only
3. mathematics and programming but not art
[6]

(c) Let A and B be two subsets of the universal set U . Prove or disprove that

P(A ∪ B) = P(A) ∪ P(B).

[4]

(d) Let A and B be two subset of a universal set U . Show that:

A⊆B ⇔A∪B =U

[6]

UL21/120 Page 2 of 8
Question 2 Functions

(a) Let f : R → Z. where f (x) = b x2 c.

i. Find f (1) [1]


ii. What is the set of pre-images of 10 [1]
iii. Say whether or not f (x) is injective( one-to-one), justifying your answer. [2]

iv. Say whether or not f (x) is surjective(onto), justifying your answer. [2]

(b) Given a function g : R → R is defined by g(x) = 3x + 5.

i. Show that the function g is a bijection. [2]


ii. Find g −1 [2]

(c) Let f : Df → [0, = ∞) be a bijective function with f (x) = ln(x + 1).

i. Find domain, Df of this function. [1]


ii. Find the inverse function f −1 . [2]
iii. Plot the curves of both function, f and f −1 in the same graph. [2]
iv. What can you say about these two curves? [1]

(d) Determine whether each of the following functions, defined from Z × Z to


Z, is one-to-one , onto, or both. Explain your answers.

i. f (x, y) = x2 + 1
ii. g(x, y) = x + y + 2
[4]

UL21/120 Page 3 of 8
Question 3 Propositional Logic

(a) Let p, q, r and s four propositions. Assuming that p and r are false and that
q and s are true, find the truth value of each of the following propositions:

i. ((p ∧ ¬q) → (q ∧ r)) → (s ∨ ¬q)


ii. ((p ∨ q) ∧ (q ∨ s)) → ((¬r ∨ p) ∧ (q ∨ s))
[2]

(b) Let p and q be two propositions defined as follows: p means ’A student can
take the algorithm module ’ whereas q means ’Student passes discrete
mathematics’
Express each of the three following compound propositions symbolically
by using p, q and appropriate logical symbols.

i. ‘A sufficient condition for a student to take the algorithm module is that


they pass discrete mathematics’.

ii. ‘A student can take the algorithm module only if they pass discrete
mathematics’.

iii. ‘ A student can takes the algorithm module if they pass discrete mathematics’.

iv. ‘ A student either passes discrete mathematics or can take the algorithm
module’
[4]

(c) Write in words and express symbolically in terms p and q, defined in (a),
the contrapositive, the converse and the inverse of the implication:
‘A student can take the algorithm module if they pass discrete mathematics
’ [6]

(d) Consider the following three propositions:


s means ’”Samir goes to the party ”
c means ’”Callum goes to the party”
j means ’”Jay goes to the party”.
Express each of the three following compound propositions symbolically
by using c, j, s and appropriate logical symbols.

UL21/120 Page 4 of 8
i. “Samir goes to the party only if both Callum and ‘Jay aren’t going to
the party.
ii. “Either both Samir and Jay go to the party or Callum goes to the party,
but not both ”.
[4]

(e) A tautology is a proposition that is always true. Let p and q be two


propositions, show that (p → q) ⇔ (¬q → ¬p) is a tautology. [4]

UL21/120 Page 5 of 8
Question 4 Predicate logic

(a) Let P (x, y) be a boolean function. Assume that ∀x∃yP (x, y) is T rue and
that the domain of discourse is nonempty. Which of the following must also
be true? If the statement is true, explain; otherwise, give a counter-example.

i. ∀x∀yP (x, y)
ii. ∃x∀yP (x, y)
iii. ∃x∃yP (x, y)
[6]

(b) Given the following argument:


”If it rains then the concert will be cancelled”
”The concert was cancelled, therefore it rained”
Assume p means ” it rains” whereas q means ”concert cancelled”

i. Translate this argument to a symbolic form.


ii. Construct the truth table.
iii. Determine if this argument is a valid argument or not.
[8]

(c) Let p, q, r, s and t be statements variables. Use the valid argument forms
to deduce the conclusion, ¬q, from the premises, giving a reason for each
step.
(a) ¬p ∨ q → r
(b) s ∨ ¬q
(c) ¬t
(d) p → t
(e) ¬p ∧ r → ¬s
——————————————————
(f) ∴ ¬q [6]

UL21/120 Page 6 of 8
Question 5 Boolean Algebra

(a) What is the value of the boolean expression (x + y)(x.y)? [3]

(b) Consider the following combinatorial circuit with three inputs x, y and z,
and one output f (x, y, z):

i. Write the output f (x, y, z) in its disjunctive normal form. [2]


ii. Fill in the missing output value in the following table:
x y z f(x,y,z)
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[4]
iii. Show that f (x, y, z). can be simplified to f (x, y, z) = x(y + z) [2]
iv. Draw the simplified circuit equivalent to f (x, y, z). [2]

(c) i. What is the advantage of using Karnaugh map (K-map)?


[2]
ii. Fill in the following K-map for the Boolean function

F (x, y, z) = x.y.z + x.y.z + x.y.z + x.y.z

UL21/120 Page 7 of 8
HHxy
HH
00 01 11 10
z HH
0
1
[2]
iii. Use the previous K-map and find a minimisation, as the sum of three
terms, of the expression

F (x, y, z) = x.y.z + x.y.z + x.y.z + x.y.z

[3]

END OF PAPER

UL21/120 Page 8 of 8

You might also like