Download 152.54 KB - KFUPM Resources v3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Proofs of Fermat's little theorem wikipedia , lookup

Line (geometry) wikipedia , lookup

Transcript
1
King Fahd University of Petroleum and Minerals
College of Computer Science and Engineering
Information and Computer Science Department
ICS 253: Discrete Structures I
Summer Semester 2012-2013
Major Exam #2, Saturday July 13, 2013.
Name:
ID#:
Instructions:
1. This exam consists of seven pages, including this page, containing three
questions. An additional helping sheet is also attached.
2. You have to answer all three questions.
3. The exam is closed book and closed notes. No calculators or any helping
aides are allowed. Make sure you turn off your mobile phone and keep it in
your pocket if you have one.
4. The questions are NOT equally weighed. Some questions count for more
points than others.
5. The maximum number of points for this exam is 100.
6. You have exactly 90 minutes to finish the exam.
7. Make sure your answers are readable.
8. If there is no space on the front of the page, feel free to use the back of the
page. Make sure you indicate this in order for me not to miss grading it.
Question Number
Maximum # of Points
1
35
2
45
3
20
Total
100
Earned Points
2
1. (35 points) Basic Structures: Sets, Functions, Sequences and Sums.
a. (10 points) Draw the graph of the function
š‘„
š‘“(š‘„) = āŒˆ2āŒ‰ + āŒŠš‘„āŒ‹
where āˆ’4 ā‰¤ š‘„ ā‰¤ 4
āˆž
b. (7 points) Find ā‹ƒāˆž
š‘–=1 š“š‘– and ā‹‚š‘–=1 š“š‘– if for every positive integer i,
Ai = (-i, i), that is, the set of real numbers x with -i < x < i.
3
a. (8 points) Give an example of two uncountable sets A and B such that
š“ āˆ© šµ is
(i)
empty.
b.
(ii)
finite but not empty.
(iii)
countably infinite.
(iv)
uncountable.
(10 points) Compute the following summation:
10
8
āˆ‘ āˆ‘ (2š‘— āˆ’ š‘—(3š‘– ))
š‘–=7 š‘—=1
4
2. (45 points) Induction and Recursion
a. (5 points) Give a recursive definition of š‘Žš‘› = 2š‘› + 1
b. (10 points) Prove that 12 āˆ’ 22 + 32 āˆ’· · ·+ (āˆ’1)nāˆ’1n2 =
whenever n is a positive integer.
š‘› = 1,2,3, ā€¦
(āˆ’1)š‘›āˆ’1 š‘›(š‘›+1)
2
5
c. (20 points) Answer the following questions related to forming different
values of stamps:
(i) (5 points) Which amounts of postage can be formed using only 5cent and 7-cent stamps? Make sure your statement is of the form:
All values greater than or equal to n can be formed using only 5cent and 7-cent stamps.
(ii) (15 points) Prove the conjecture you made using strong induction.
6
d. (10 points) The set of leaves and the set of internal vertices of a full
binary tree can be defined recursively.
Basis step: The root r is a leaf of the full binary tree with exactly one
vertex r. This tree has no internal vertices.
Recursive step: The set of leaves of the tree T = T1 · T2 is the union of
the sets of leaves of T1 and of T2. The internal vertices of T are the root
r of T and the union of the set of internal vertices of T1 and the set of
internal vertices of T2.
Use structural induction to show that l(T ), the number of leaves of a
full binary tree T , is 1 more than i(T ), the number of internal vertices
of T .
7
3. (20 points) Counting
a. (5 points) Derive the number of one-to-one functions that are from a
set with 5 elements to a set with 10 elements.
b. (5 points) Derive the number of strings of eight English letters that
contain at least one vowel, if letters can be repeated. Note: There are 5
vowels in English.
a. (10 points) An arm wrestler is the champion for a period of 75 hours.
(Here, by an hour, we mean a period starting from an exact hour, such
as 1 p.m., until the next hour.) The arm wrestler had at least one match
an hour, but no more than 125 total matches. Show that there is a
period of consecutive hours during which the arm wrestler had exactly
24 matches.
Some Useful Formulas
n(n ļ€« 1)
iļ€½
ļƒ„
2
i ļ€½1
n
n
ļƒ„ ai ļ€½
i ļ€½0
ļ‚„
ļƒ„ ia
i ļ€½1
i ļ€­1
n(n ļ€« 1)( 2n ļ€« 1)
i ļ€½
ļƒ„
6
i ļ€½1
,
2
a nļ€«1 ļ€­ 1
where a ļ‚¹ 1
a ļ€­1
ļ€½
1
ļ€Ø1 ļ€­ a ļ€©
2
p ļ‚® ( p ļƒš q)
ļ‚„
,
ļƒ„a
i ļ€½0
i
ļ€½
ļƒ¦ nļ€Øn ļ€« 1ļ€© ļƒ¶
i ļ€½ļƒ§
ļƒ·
ļƒ„
ļƒØ 2 ļƒø
i ļ€½1
n
n
,
2
3
1
where a ļ€¼ 1 ,
1ļ€­ a
where a ļ€¼ 1
Addition
[ļƒ˜q ļƒ™ ( p ļ‚® q)] ļ‚® ļƒ˜p
Modus Tollens
Hypothetical
( p ļƒ™ q) ļ‚® p
Simplification [( p ļ‚® q) ļƒ™ (q ļ‚® r )] ļ‚® ( p ļ‚® r )
syllogism
Disjunctive
(( p)ļƒ™ (q)) ļ‚® ( p ļƒ™ q) Conjunction
[( p ļƒš q) ļƒ™ ļƒ˜p] ļ‚® q
syllogism
[ p ļƒ™ ( p ļ‚® q)] ļ‚® q
Modus Ponens [ļ€Ø p ļƒš qļ€© ļƒ™ ļ€Øļƒ˜p ļƒš r ļ€©] ļ‚® ļ€Øq ļƒš r ļ€©
Resolution