0% found this document useful (0 votes)
11 views3 pages

TEST1

This document is an examination paper for the Discrete Structures course at Murang’a University of Technology for first-year software engineering students. It includes instructions for candidates, a variety of questions covering topics such as set theory, truth tables, and algorithms, and is divided into two sections with specific marks allocated for each question. The exam was conducted on December 21, 2018, with a duration of two hours.
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)
11 views3 pages

TEST1

This document is an examination paper for the Discrete Structures course at Murang’a University of Technology for first-year software engineering students. It includes instructions for candidates, a variety of questions covering topics such as set theory, truth tables, and algorithms, and is divided into two sections with specific marks allocated for each question. The exam was conducted on December 21, 2018, with a duration of two hours.
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/ 3

MURANG’A UNIVERSITY OF TECHNOLOGY

SCHOOL OF COMPUTING AND INFORMATION TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE

UNIVERSITY ORDINARY EXAMINATION

2018/2019 ACADEMIC YEAR


FIRST YEAR FIRST SEMESTER EXAMINATION FOR, BACHELOR OF
SCIENCE IN SOFTWARE ENGINEERING

SCS102 – DISCRETE STRUCTURES

DURATION: 2 HOURS

DATE: 21/12/2018

TIME: 9:00-11:00 AM

Instructions to candidates:

1. Answer question One and Any Other Two questions


2. Mobile phones are not allowed in the examination room.
3. You are not allowed to write on this examination question paper.
SECTION A: ANSWER ALL QUESTIONS IN THIS SECTION

QUESTION ONE (30 MARKS)

a) If 𝐴 ⊂ 𝐵, then what is 𝐴 ∪ 𝐵? (4marks)


b) Construct truth table for the following statement formulas;
i. ~(~P∨~Q) (2marks)
ii. 𝑃 ∧ 𝑄 ∨ ~𝑃 ∧ 𝑄 ∨ 𝑃 ∧∼ 𝑄 ∨ (∼ 𝑃 ∧∼ 𝑄) (2marks)
c) Given the following table, show the domain range and relation

x -2 0 4 5 8
y 4 5 -3 -1 3
(4marks)
d) Show that ∼ (𝑃 ∨ 𝑄) →∼ 𝑃 is a tautology. (6marks)
e) Consider four sets A,B,C and D such that
𝑨 ∩ 𝑩 ≠ ∅, 𝑨 ∩ 𝑪 ≠ ∅, 𝑨 ∩ 𝑫 = ∅, 𝑩 ∩ 𝑪 ≠ ∅, 𝑩 ∩ 𝑫 = ∅, 𝑪 ∩ 𝑫 = ∅,
𝒂𝒏𝒅 𝑨 ∩ 𝑩 ∩ 𝑪 = ∅

Draw venn diagrams to visualize these operations (7marks)


f) Write the inverse of the mapping

5
4 4
-6 -2
0

(5marks)

SECTION B – ANSWER ANY TWO QUESTIONS IN THIS SECTION

QUESTION TWO (20 MARKS)

a) Which of the following are not well-formed formulas (wff)? Support your answers with
justifiable reasons (4marks)
i. ~𝐴
ii. ~~𝑨
iii. (𝐴 ∧ 𝐵) ⊃ 𝐶)
iv. ~((~𝑨 ∧ 𝑩) ⊃∼∼ 𝑪
v. 𝑨 → 𝑩 → (∧ 𝑩)
b) Let 𝐶𝑥 = “x is a university-like campus”
𝑆𝑥 = “x supports students”
Convert the following predicate logic statements into their equivalent English statements.
i. ∀𝑥[𝐶𝑥] ∨ ∀𝑥[𝑆𝑥] (2marks)
ii. ∀𝑥[𝐶𝑥] ∨ ∀𝑥[~𝐶𝑥) (2marks)

c) (i) What is a recursive algorithm? (2marks)


(ii)Under which circumstances would you opt for a recursive algorithm? (3marks)
(iii) Define a recursive algorithm that generates factorials (7marks)

QUESTION THREE (20 MARKS)

a) Given that sets A= 5,10,13,14 and


B= 5,13,17,23

Calculate the following formulas

i. 𝐴−𝐵 (2marks)
ii. 𝐴−∅ (2marks)
b) Show that for any two sets of A and B
𝐴− 𝐴∩𝐵 =𝐴−𝐵 (6marks)
c) Four students John, Sam, Mary and Joy registered for three units as follows. John
registered for CSC 100 and CSC101, Sam registered for CSC 101, Joy registered for CSC
101 and CSC 102, and Mary registered for CSC 102. The fifth student Ken did not
register for any course. Identify the relations involved in this case and use a table to
present them (6marks)
d) Given that the set
𝕌 = 1,2,3,4,5,6,7,8,9 , 𝐴 = 1,2,3,4 , 𝑎𝑛𝑑 𝐵 = {3,4,5,6,7,8,9}
Perform the following operations.
i. 𝐴∪𝐵 (2marks)
∁∁
ii. 𝐵 (2marks)

QUESTION FOUR (20 MARKS)

a) Distinguish between deductive validity and inductive validity. Give examples as


appropriate (5marks)
b) The recursive Fibonacci algorithm has been criticized. Describe these criticisms
(5marks)
c) Write a non-recursive function to generate Fibonacci numbers such that it avoids the
pitfalls in (b) above. (10marks)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy