Comp 122 Comp 121 Cosf 122 Discrete Structures Exam
Comp 122 Comp 121 Cosf 122 Discrete Structures Exam
UNIVERSITY EXAMINATIONS
MAIN CAMPUS
SECOND SEMESTER, 2023 ACADEMIC YEAR
EXAMINATION FOR THE DEGREE OF COMPUTER SCIENCE,
INFORMATION TECHNOLOGY, EDUCATION SCIENCE AND
COMPUTER SECURITY AND FORENSIC
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart,
Jesus as Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 1 of 6
SECTION A: (Compulsory) TOTAL MARKS FOR THIS SECTION IS 30.
1.
d) What is theprimary motivation for using Boolean algebra to simplify logic expressions?
(2
marks)
e) A coffee shop has 4 different types of coffee. You can order your coffee in a small,
medium, or large cup. You can also choose whether you want to add cream, sugar, or
milk (any combination is possible, for example, you can choose to add all three). In how
many ways can you order your coffee? (3 marks)
f) Derive the Boolean expression for the logic circuit shown below: (2 marks)
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart,
Jesus as Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 2 of 6
h) By use of the truth table discuss the following connectives
i. Implication (2 marks)
ii. Conjunction (2 marks)
iii. Disjunction (2 marks)
iv. Bi-conditional (2 marks)
2.
i. There will be exactly 4 black cell phones among the chosen phones; (2 marks)
ii. There will be less than 3 black cell phones among the chosen phones.(2 marks)
e) From the truth table below, determine the standard SOP expression. (4 marks)
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart,
Jesus as Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 3 of 6
f) Use the graph given below to derive an adjacency matrix (4 marks)
3.
i. A∪B (1 mark)
ii. A∩B (1 mark)
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart,
Jesus as Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 4 of 6
d) Describe the following common gates giving their symbols and truth tables
i. AND (2 marks)
ii. NAND (2 marks)
iii. OR (2 marks)
iv. EX-OR (2 marks)
e) Discuss the different rules of inference for quantified statements along with suitable
example of each. (4 marks)
4.
a) Determine whether each statement is true or false, and explain your reasoning.
i. If an argument is valid then it is possible for the conclusion to be false when all
premises are true. (2 marks)
ii. If the premises can’t all be true, then the argument is valid. (2 marks)
iii. If p ⇔ q and q ⇔ r, then p ⇔ r. (2 marks)
b) Map the SOP expression into a k-map (2 marks)
c) Let A, B, Cbe three sets as shown in the following Venn diagram. For each of the
following sets, draw a Venn diagram and shade the area representing the given set.
i. A∪B∪C (1 mark)
ii. A∩B∩C (1 mark)
iii. A∪(B∩C) (1 mark)
e) Suppose that the computer science department contains 5 faculty members, a committee is
formed consisting of 3 members. How many ways are there to form the committee?
(3 mark)
f) Discuss the two application areas of proposition logic (3 mark)
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart,
Jesus as Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 5 of 6
5
a) Write each of the following statements, in English, in the form “if p, then q”.
i. I go swimming on Mondays. (1 mark)
ii. In order to be able to go motorcycling on Sunday, the weather must be good.
(1
mark)
iii. Eat your vegetables or you can’t have dessert. (1 mark)
b) What is the simplified sum of product form for the Boolean expression:
c) Given the following adjacency matrix draw the resulting graph G (3 mark)
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart,
Jesus as Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 6 of 6