Showing posts with label An-Introduction-to-Discrete-Probability. Show all posts
Showing posts with label An-Introduction-to-Discrete-Probability. Show all posts

Monday, February 13, 2012

Section 6.1-An Introduction to Discrete Probability-Discrete Mathematics and Its Applications - Part 3


Rosen, Discrete Mathematics and Its Applications, 6th edition
Extra Examples
Section 6.1—An Introduction to Discrete Probability (Part - 3)

p.397, icon at Example 9
#1. Suppose S = {1, 2, . . . , 20}. You select a subset T ⊆ S of size three. Find the probability that T has at least one even number in it.
Solution:
There are C(20, 3) subsets of size three, and choosing any of them is equally likely. It is easiest to use the rule p(E) = 1 − p(E). Let E be the event “T has at least one even number in it”. Therefore E is the event “T has only odd numbers in it”. We have 
p(E) = 1 − p(E) = 1 − C(10, 3) / C(20, 3) ≈ 0.895.


p.397, icon at Example 9
#2. Suppose S = {1, 2, . . . , 20}. You select a subset T ⊆ S of size three. Find the probability that T contains the numbers 10 or 20.

Solution:
There are C(20, 3) subsets of size three, and choosing any of them is equally likely. We use the rule for finding the probability of the union of two events, where E is the event “10 ∈ T” and F is the event “20 ∈ T ”. Note that we must subtract p(E ∩ F) because both 10 and 20 might be elements of T .
p(E ∪ F) = p(E) + p(F) − p(E ∩ F)
 = C(19, 2)/C(20, 3) + C(19, 2)/C(20, 3) − C(18, 1)/C(20, 3)
= C(19, 2) + C(19, 2) − C(18, 1)/C(20, 3)
≈ 0.284.

p.397, icon at Example 9
#3. A true/false quiz has 10 questions. If you randomly answer each question, what is the probability that
you score at least 70%?

Solution:
To score at least 70%, you need to answer 7, 8, 9, or 10 questions correctly. There is C(10, 10) = 1
way to answer all ten questions correctly, C(10, 9) = 10 ways to correctly answer nine questions correctly,
C(10, 8) = 45 ways to answer eight questions correctly, and C(10, 7) = 120 ways to answer seven questions correctly. Thus, the probability of answering at least seven questions correctly is
p(answer at least 7 correctly) = p(answer 10 correctly) + p(answer 9 correctly) + p(answer 8 correctly) + p(answer 7 correctly) 
=  1/ 2^10 + 10/2^10 + 45/2^10 + 120/2^10
= (1 + 10 + 45 + 120)/210 
= 176/1024
≈ 0.172.

Monday, February 6, 2012

Section 6.1-An Introduction to Discrete Probability-Discrete Mathematics and Its Applications - Part 2

Rosen, Discrete Mathematics and Its Applications, 6th edition
Extra Examples
Section 6.1—An Introduction to Discrete Probability (Part - 2)


p.394, icon at Example 1
#6. You pick five numbers, without replacement, from the set {1, 2, 3, . . . , 24, 25}. What is the probability that the product of the numbers chosen is odd?

Solution:
We can think of the experiment of choosing five numbers in two ways: pick all five numbers at once (i.e.,order does not matter), or pick the five numbers in succession (i.e., order matters).

Suppose we interpret the problem as one where we choose the five numbers all at once. Then the sample space S consists of all subsets of five numbers chosen from the set {1, 2, 3, . . . , 24, 25}, and we have |S| = C(25, 5).

The product will be odd if and only if each of the five chosen numbers is odd. (If any of the five chosen numbers is even, the product will be even.) Therefore
p(product is odd) = C(13, 5)/C(25, 5)  = (13!/(5! · 8!))/( 25!/(5! · 20!) ) =  (13! · 20!)/( 25! · 8!) ≈ 0.024.

Now suppose that we assume that order does matter. Because the five numbers chosen must all come from the 13 odd numbers between 1 and 25, the number of successes is P(13, 5). The number of possibilities is P(25, 5). Therefore,
p(product is odd) = P(13, 5)/P(25, 5)=(13!/8!)/(25!/20!) = (13! · 20!)/(25! · 8!) ≈ 0.024.

In this case the same answer is obtained whether we assume order matters or that order does not matter.

p.394, icon at Example 1
#7. Suppose S = {1, 2, . . . , 20}. You select a subset T ⊆ S of size three. Find the probability that T consists of two odd numbers and one even number.

Solution:
There are C(20, 3) subsets of size three, and choosing any of them is equally likely. There are ten odd numbers and ten even numbers in S. A “success” means that we select two odd numbers from the ten odd numbers and one even number from the ten even numbers. Therefore
p(T has two odd numbers and one even number) = ( C(10, 2) · C(10, 1) )/ C(20, 3) ≈ 0.395.


p.394, icon at Example 1
#8. Suppose S = {1, 2, . . . , 20}. You select a subset T ⊆ S of size three. Find the probability that T consists of three prime numbers.

Solution:
There are C(20, 3) subsets of size three, and choosing any of them is equally likely. There are eight primes in the first 20 integers — 2, 3, 5, 7, 11, 13, 17, 19. Therefore
p(T consists of three primes) = C(8, 3) / C(20, 3) ≈ 0.049.


p.394, icon at Example 1
#9. Suppose S = {1, 2, . . . , 20}. You select a subset T ⊆ S of size three. Find the probability that the three numbers in T have a sum that is less than nine.
Solution:
There are C(20, 3) subsets of size three, and choosing any of them is equally likely. There are four ways in which the three numbers can have a sum less than nine: 1, 2, 3; 1, 2, 4; 1, 2, 5; and 1, 3, 4. Therefore 
p(sum of the integers is less than nine) = 4 / C(20, 3) ≈ 0.004.


p.394, icon at Example 1
#10. A class has 20 women and 13 men. A committee of five is chosen at random. Find
(a) p(the committee consists of all women).
(b) p(the committee consists of all men)
(c) p(the committee consists of all of the same sex)

Solution:
(a) There are C(33, 5) possible committees of size five. Of these, there are C(20, 5) committees consisting
only of women. Therefore, the probability that the committee consists of all women is
C(20, 5) / C(33, 5) ≈ 0.065.
(b) There are C(33, 5) possible committees of size five. Of these, there are C(13, 5) committees consisting only of men. Therefore, the probability that the committee consists of all women is C(13, 5) / C(33, 5) ≈ 0.005.
(c) There are C(33, 5) possible committees of size five. Of these, there are C(20, 5) committees consisting only of women and C(13, 5) committees consisting only of men. Therefore, the probability that the committee consists of all women is
( C(20, 5) + C(13, 5) ) / C(33, 5) ≈ 0.07


p.394, icon at Example 1
#11. What is the probability of getting more heads than tails, if you toss a fair coin
(a) nine times?
(b) ten times?

Solution:
(a) If you toss a fair coin nine times, half the time you will have more H than T and half the time you will have more T than H. Therefore, the probability that you obtain more heads than tails is 1/2.
(b) If you toss a coin ten times, one of the following three possibilities must happen:
1. you toss equal numbers of H and T,
2. you toss more H than T,
3. you toss more T than H.
The sample space consists of all strings of ten letters, each of which is H or T. The number of ways of obtaining 5 H’s and 5 T’s is C(10, 5). (To see this, note that we must choose a set of 5 of the 10 spots in a string for H’s.)
Therefore, the number of ways of obtaining unequal numbers of heads and tails is 210 − C(10, 5). Half of these will have more heads than tails, and half will have more tails than heads. Thus, the number of ways of obtaining more heads than tails is (1/2) . ((2^10) − C(10, 5))) = ((2^9) − C(10, 5)/2). Therefore, the probability of obtaining more heads than tails is ((2^9) − C(10, 5)/2) / (2^10) =( (1/2) − C(10, 5)/(2^11)) .


p.394, icon at Example 1
#12. A family has two children. They are not twins. You ring the doorbell of the house they live in and a girl answers the door. What is the probability that the other child in the family is a girl? Assume that in the births of two children the probability of the birth of a girl or a boy are independent events and that the probability of the birth of a child of either sex is 1/2.

Solution:
The obvious answer is 1/2, because according to the assumptions in this example the probability that any child is a girl is 1/2. However this is not correct. The error here is in determining the sample space S. We know that the family cannot have two boys, because a girl answered the door. If we take as the sample space {1 girl and 1 boy, 2 girls}, then the two outcomes are not equally likely. Having “1 girl and 1 boy” is twice as likely as having “2 girls”. This is true because “1 girl and 1 boy” can occur in two ways: the older child is a girl and the younger child is a boy, or the older child is a boy and the younger child is a girl.
If we wish to use the basic definition of probability, p(E) = |E|/|S|, then the outcomes must all be equally likely. We can use the sample space where each element has the form “older child, younger child”. In this case we begin with a sample space of size four: {GG,GB,BG,BB}. Note that the probability of having one child of each sex is 1/2, not 1/4. Given that the family has at least one girl, we eliminate the possibility BB to obtain sample space S = {GG,GB,BG}. Each outcome has probability 1/3 and thus p(other child is a girl) = 2/3.

Note: Suppose, in addition, we knew that it was the older child who answered the door. In this case the sample space becomes S = {GG,GB} because the older child is not a boy. Thus, the probability that the other child is a girl is 1/2.

Tuesday, January 31, 2012

Section 6.1- An Introduction to Discrete Probability-Discrete Mathematics and Its Applications - 1

Rosen, Discrete Mathematics and Its Applications, 6th edition
Extra Examples
Section 6.1—An Introduction to Discrete Probability (Part - 1)

p.394, icon at Example 1
#1. A computer password consists of five lower case letters, with repeated letters allowed. Find p(E) where E is the event that the password begins with c.

Solution:
The sample space S has 26^5 elements, corresponding to the number of ways to fill in the following five blanks with lower case letters: . The event E has 26^4 elements, corresponding to the number of ways to fill in the four blanks in c . Therefore
p(E) = p(password begins with c) =|E|/|S| = (26^4)/(26^5) = 1 /  26  ≈  0.038.
Note: In place of writing p(E), we often replace E with the English description of E.


p.394, icon at Example 1
#2. A computer password consists of five lower case letters, with repeated letters allowed.
(a) Find p(F1), where F1 is the event that the password contains no vowels.
(b) Find p(F2), where F2 is the event that the password contains only vowels.

Solution:
(a) The set F1 has 21^5
elements because each of the five blanks must be filled in with one of 21 consonants.
Therefore
p(F1) = p(password contains no vowels) = |F1| / |S| = (21^5) / (26^5 ) ≈ 0.344.

(b) The set F2 has 5^5 elements because each of the five blanks must be filled in with one of five vowels. Therefore
p(F2) = p(password contains only vowels) = |F2| / |S| = (5^5) / (26^5) ≈ 0.00026


p.394, icon at Example 1
#3. A professor teaches two sections of a calculus course and gave a quiz to the students in each section.
In Section 1, 8 students out of 35 got a score of 90 or higher. In Section 2, 11 students out of 28 got a score of 90 of higher.
Find the probability that the student:
(a) is in Section 1, if the student is chosen at random from among all 63 students.
(b) is not in Section 1, if the student is chosen at random from among all 63 students.
(c) scored at least 90 on the quiz, if the student is chosen at random from those in Section 1.
(d) is in Section 1 and scored at least 90 on the quiz, if the student is chosen at random.
(e) is in Section 1, if the student is chosen at random from those who scored at least 90 on the quiz.

Solution:
The given information can be displayed in the following table:
                 |  Section 1 | Section 2 |
Score ≥ 90  |       8        |       11     |
score < 90   |      27       |      17      |

(a) Of the 63 students, 35 are in Section 1. Therefore, the probability that the student is in Section 1 is 35/63.
(b) The probability that a randomly chosen student is not in Section 1 is equal to the probability that the student is in Section 2, which is 28/63.
(c) There are 35 students in Section 1. The probability that the student scored at least 90 is 8/35.
(d) Eight students are in Section 1 and scored at least 90 on the quiz. Therefore, the probability that the student is in Section 1 and scored at least 90 on the quiz is 8/63.
(e) The number of students who scored at least 90 on the quiz is 19, and, of these, 8 come from Section 1.
Therefore, the probability that a randomly chosen student comes from Section 1 is 8/19.


p.394, icon at Example 1
#4. You flip a coin twice. Find the following:
(a) p(E) where E is the event of getting heads on the first flip and tails on the second flip.
(b) p(F) where F is the event of getting one head and one tail in the two flips.

Solution:
The sample space for this experiment is S = {H H, H T , T H, T T } where H stands for heads, T for tails, the first letter in each pair is the result of the first flip, and the second letter is the result of the second flip.
(a) The event E = {H T }. Thus p(E) = |E|/|S| = 1/4.
(b) The event F = {H T  ,  T  H}. Thus p(F) = |E|/|F| = 2/4 =  1/2.


p.394, icon at Example 1
#5. A tetrahedral die is a regular polyhedron consisting of 4 equilateral triangles, with the four faces
numbered 1, 2, 3, 4. You roll the pair of tetrahedral dice. Find the probability that the sum is: (a) 2, (b) 3,
(c) 4, (d) 5, (e) 6, (f) 7, (g) 8.

Solution:
The sample space consists of the 16 elements:
(1, 1),(1, 2),(1, 3),(1, 4),(2, 1),(2, 2),(2, 3),(2, 4),(3, 1),(3, 2),(3, 3),(3, 4),(4, 1),(4, 2),(4, 3),(4, 4).
Thus, the probabilities are: (a) 1/16, (b) 2/16, (c) 3/16, (d) 4/16, (e) 3/16, (f) 2/16, (g) 1/16.