Download model solutions

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

Probability wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Birthday problem wikipedia , lookup

Transcript
CS 173, Fall 2008
Quiz 3 Solutions
Problem 1: True or False (3 points)
Mark each of the following statements as true or false. No justification is required.
(a) Let R be a relation on all integers such that (x, y) ∈ R if and only if x = 2y. R is
irreflexive.
Solution: False. Although most integers aren’t related to themselves, 0 is.
(b) In probability theory, a random variable is a function from the sample space of an
experiment to the set of real numbers.
Solution: True. This is a quote straight from the textbook definition.
(c) Let T be a relation on all integers such that (x, y) ∈ T if and only if there is an integer
k such that x + y = 2k. T is an equivalence relation.
Solutions: True. The definition says that x and y are related iff x + y is even. But x + y
is even exactly when both are even, or both are odd. So all odd integers are related to
each other, as are all even integers.
Problem 2: Closures (3 points)
Let R be the relation on the set {0, 1, 2, 3} containing the following ordered pairs
(0, 1), (1, 1), (1, 0), (2, 0), (0, 3)
Draw a directed graph showing the transitive closure of R.
Solution:
0
2
1
3
Problem 3: Short Answer (12 points)
Briefly explain your answer (e.g. state what theorem you are applying) or show work.
1. If a set A has n elements, how many possible relations are there on A?
Solution: The set A × A contains n2 elements. A relation is a subset of A × A, so
2
there are 2n relations.
2. What is the coefficient of x5 y 8 in (x + y)13 ?
13
13
Solution:
or
. This is fine for full credit.
5
8
Or you could express it with factorials:
This is actually equal to
sout for full credit.
13·12·11·10·9
5·4·3·2
13!
.
8!5!
= 9 · 11 · 13. However, you didn’t need to work thi
3. Imagine flipping a coin 5 times. What is the probability of exactly three of the flips
being tails? Assume that heads and tails occur with equal probability.
Solution:
There are 25 = 32 different sequences of 5 flips in our sample space.
5
5
= 16
.
= 10 of these contain exactly three tails. So the probability is 10
32
2
Or you coulduse the
formula for 3 successes in 5 independent Bernoulli trials (p. 407
5
of the text):
(0.5)3 (0.5)2 which produces the same answer.
3
2
4. Imagine rolling two four-sided dice, where each die produces an integer from the set
{1, 2, 3, 4} with equal probability. Consider a random variable X which maps the result
of rolling two dice to the maximum of the two numbers produced by the dice. What
is E(X), the expected value of X?
Solution: There are seven ways to roll a pair of numbers with largest number 4, five
ways with largest number 3, three with largest number 2, and only one roll for which
the maximum number is 1. There are 16 total rolls. So our expected value is:
1
1
50
25
(7 · 4 + 5 · 3 + 3 · 2 + 1 · 1) = (28 + 15 + 6 + 1) =
=
= 3.125
16
16
16
8
Problem 4: Definition (2 points)
How does a total order differ from a partial order?
Solution: In a total order, every pair of elements is comparable. That is, for any two
elements x and y, either xRy or yRx.
Problem 5: Short Proof (5 points)
Consider the set of intervals on the real line J = {(a, b) | a, b ∈ R and a ≤ b}. Define the
containment relation C as follows:
(a, b) C (c, d) if and only if a ≤ c and d ≤ b
Prove that C is transitive.
Solution: Let (a, b), (c, d) and (e, f ) be three real intervals. Suppose that (a, b) C (c, d)
and (c, d) C (e, f ).
By the definition of C, (a, b) C (c, d) implies that a ≤ c and d ≤ b. Similarly, (c, d) C (e, f )
implies that c ≤ e and f ≤ d.
Since a ≤ c and c ≤ e, a ≤ e. Since f ≤ d and d ≤ b, f ≤ b.
By the definition of C, since a ≤ e and f ≤ b, (a, b) C (e, f ).
So (a, b) C (c, d) and (c, d) C (e, f ) implies that (a, b) C (e, f ). So C is transitive.
[This is more detail than I actually expected for a full-credit answer!]
3