ICS 6D Homework 9
1. If you have 2n socks in a drawer, n white and n black, and you reach in to choose 2 socks at random,
(a) How many ways are there to choose? (Hint: think of all the socks as all different but n are black and n are white).
(b) How many of these ways result in getting a pair of the same color?
(c) Write a simple closed form formula in terms of n for the chance choosing a matching pair of socks from a drawer with n white and n black socks. (You should expand the ”choose” notation and get a simplified expression).
2. A password requires that you use a sequence of upper-case characters, lower-case characters and digits. A valid password must be at least 10 characters long, and it must contain at least one character from each of the three sets of characters. If you generate 10 random characters from the union of the three sets of characters, what is the probability that you will get a valid password?
3. A wedding party of 8 people line up for a photo in a random order. What is the probability that the bride and the groom are next to each other?
4. A teacher selects a subset of 5 students out of her class of 20 to work together on a project.
(a) Suppose a student Sam has a best friend in the class. What is the probability that Sam and his best friend are either both chosen or both not chosen for the project?
(b) Now suppose that Sam has two best friends in the class. What is the probability that he is with at least one of the friends (either on the project or off the projst)?
5. A red die and a blue die are thrown. Define the following events:
• A: The sum is even.
• B: The sum is at least 10.
• C: The red die comes up 5.
(a) What is P r(A)?
(b) What is P r(B)?
(c) What is P r(C)?
(d) What is P r(A | C)?
(e) What is P r(B | C)?
(f) What is P r(A | B)?
(g) What pairs of events are independent?
6. The letters {a, b, c, d, e, f, g} are put in a random order. Define the following events:
• A: The letter b falls in the middle (with three before it and three after it).
• B: The letter c comes after the letter b, although not necessarily immediately after it. For example, ”agbdcef” would be an outcome in this event. 2 • C: The letters ”def” occur together in that order (e.g. ”gdefbca”).
(a) What is P r(A)?
(b) What is P r(B)? (Hint: first select the location for the b and c, then place the rest of the letters)
(c) What is P r(C)?
(d) What is P r(A | C)?
(e) What is P r(B | C)?
(f) What is P r(A | B)?
(g) What pairs of events are independent?
7. A casino offers a game which costs a dollar to play each round. In a round, two cards from a perfectly shuffled deck are selected. If the two cards have the same rank (i.e., both queens or both 8’s, etc), then the player wins $10 dollars. What are a player’s expected winnings in a round (including the cost of playing the round)? Note that this number could be negative.
8. A coin is tossed 5 times. Let X be the random variable denoting the number of heads minus the number of tails. (a) What is the range of X? (b) What is the distribution over X? (c) What is the expected value of X?
9. There are 40 computers in a network. 3 of the computers store a copy of a particular file. A random subset of 5 computers is chosen from the 40. Let C be the number of computers in the subset that have a copy of the file.
(a) What is the range of C?
(b) What is the distribution over C?
(c) What is the expected value of C?