CS代考 CS5002 Discrete Structures Prof. Rachlin Spring 2022 March 23, 2022

CS5002 Discrete Structures Prof. Rachlin Spring 2022 March 23, 2022
Homework #7
Assigned: Wednesday March 23, 2022
Due: Tuesday March 29, 2022 @ 11:59pm ET/Boston −5%: Wednesday March 30, 2022 @ 11:59pm ET/Boston −10%: Thursday March 31, 2022 @ 11:59pm ET/Boston

Copyright By PowCoder代写 加微信 powcoder

Instructions:
• Homework is due on Tuesday at 11:59pm ET/Boston. Homeworks received up to 24 hours late (11:59pm ET on Wednesday) will be penalized 5 percent. Homeworks received up to 48 hours late (11:59pm ET on Thursday) will be penalized 10 percent. NO assignment will be accepted after 48 hours.
• We expect that you will study with friends and fellow students and you are welcome to verbally discuss the problems openly. However, your solution writeup should be the product of your own mind and expressed in your own words. The TAs and I will be available to answer specific questions or address speific points of confusion but we will not verify your answers prior to submission.
• Assignments should be typed using Word or LateX, or hand-written neatly. When submitting to gradescope be sure to indicate the page containing your answer to each problem, so that the TAs don’t have to search for your solution.
• To get full credit, explain your solution and show each step of the solution process! Simply writing down a correct answer will receive little or no credit. We don’t need your scratch work or draft solutions, only your final solution explaining your step-by-step reasoning. Recommendation: try to imagine you need to explain your solution to someone not in this class.
• If you think the TA made a clerical error in grading your assignment, you may submit a regrade request on Gradescope within 1 week of the publication of the grades. After 1 week of publication, ALL GRADES ARE FINAL.
Problem 1 [20 pts (10,10)]: Warm-up problems
i. What is the probability, if a die is rolled five times, that only two different values appear?
Sample space: S = all sequences of five numbers from {1, 2, 3, 4, 5, 6}. |S| = 65.
Event E = all sequences with only two values. |E| = 􏰀6􏰁 · (25 − 2) = 15 · 30 = 450 (select the
two values, then pick a sequence of 5 – excluding the two sequences that are all one color or the other).
P [E] = |E|/|S| = 450/65 ≈ 0.0579

ii. Which is more likely, rolling an 8 when two dice are rolled, or rolling an 8 when three dice are rolled?
Solution: 2 dice are rolled. With 2 dice, there are 5 ways (2-6, 6-2, 3-5, 5-3, 4-4) giving a probability 5/62 while with 3 dice we get (1-1-6, 1-2-5…..all the ways to get 7 with 2 dice (6) + ways to get 6 with 2 dice (5), ways to get 5 with 2 dice (4), get 4 (3), get 3 (2) and get 2 (1). This is 21 giving a probability 21/63.
Problem 2 [30 pts (6,6,6,12)]: Luigi’s House of Random Pizza
At Luigi’s House of Random Pizza, you can order only one thing: A medium pizza with three
random topping layers chosen by Luigi himself. Luigi has 5 different toppings: Pepperoni, Mush- room, Anchovie, Onion, and Pepper. For example, you might get: Pepperoni-Onion-Mushroom, or maybe Mushroom-Pepperoni-Onion (the order of the layers matters to Luigi) or if you are especially lucky then Anchovie-Anchovie-Anchovie.
1. Today is your lucky day! Luigi hands you an Anchovie-Anchovie-Anchovie pizza! What were the chances?!?
Solution: E = {(Anchovie, Anchovie, Anchovie)} and |E| = 1. |S| = 53 = 125 So: P (E) = 1/125.
2. It turns out you are alergic to Anchovies. But if you complain then Luigi will respond: No pizza for you! so you decide to take your chances. What are your chances of getting a pizza with 1 or more anchovy toppings?
Solution: Let E = {pizzas with some anchovies} and E = {pizzas with no anchovies}. P(E) = 1 − P(E) = 1 − |E|/|S|
So: P(E)=1−43/125=1− 64 ≈0.488 125
3. What is the probability that you get a pizza with either two or three distinct toppings? (For example, Mushroom-Onion-Mushroom or Pepper-Onion-Mushroom.) Reduce your answer to a decimal.
Solution: P(> 1 topping) = 1 − P(1 topping) = 1 − 5 = 24. 125 25

4. What is the probability that Luigi gives you a pizza with exactly two distinct toppings (occurring in any order)? Reduce your answer to a decimal.
Solution: P (2 toppings) = 1 − P (1 topping) − P (3 toppings) From above, P (1 topping) = 5
P(3 toppings) = 5 · 4 · 3 = 5·4·3 = 60 555 125 125
SoP(2toppings)=1−5 −60=60=12=0.48 125 125 125 25
Method 2: Pick 2-layer topping: 􏰀5􏰁, then 1-layer topping: 􏰀4􏰁, then decide where one-layer 5·4·3 60 1 1
topping goes: 3, so 125 = 125 = 0.48.
Method 3: Pick two toppings: 􏰀5􏰁, pick which one is the single-layer topping: (2), and where
2 10·2·3 60
it goes in the layer sequence: (3) so again 125 = 125 = 0.48
Problem 3 [20 points (10,10)]: Thinking Independently.
1. A fair coin is flipped 4 times. Let E be the event that the first flip is heads. Let F be the event that the coin landed on heads an even number of times. Are E and F independent? Show your work.
Solution: p(E) = 0.5. p(F)=0.5 because there are eight out of 16 cases where heads comes up anevennumberoftimes: {TTTT,HHTT,TTHH,HTHT,THTH,HTTH,THHT,HHHH}.
E∩F ={HHHH,HHTT,HTHT,HTTH}soP(E∩F)=0.25. Since P(E ∩ F) = P(E) · P(F), we conclude that E and F are independent.
2. A family has three children. Assume that having either a boy or a girl is equally likely. Let the event E be the event that the family has children of both sexes, and F be the event that the family has at most 1 boy. Are the events E and F independent?
Solution: Each outcome is equally probable with probability 1/8.
Since E = {BBG, BGB, GBB, GGB, GBG, BGG} and F = {BGG, GBG, GGB, GGG} and E∩F ={BGG,GBG,GGB}itfollowsthatP(E)= 86 = 34,P(F)= 12,andP(E∩F)= 38 = P(E)·P(F). So E and F are also independent.
Problem 4 [30 points (7,7,8,8)]: All your marbles
Susie has a bag of marbles containing 3 Red, 7 Green, and 10 Blue marbles. In this problem,
the phrase with replacement means that marbles are drawn one at a time and after the draw it is replaced back into the bag before picking the next marble. The phrase without replacement means that each marble is drawn and held onto until all marbles are drawn.
1. What is the probability of picking 5 marbles and getting at least one red marble? Calculate the probability (a) with replacement, and (b) without replacement.
Solution: (a)1−P(nored)=1−(17)5 ≈0.556(b)1−P(nored)=1−􏰀17􏰁/􏰀20􏰁≈0.601 20 55

2. Pick 8 marbles: 4 green and 4 blue. Calculate the probability (a) with replacement and (b) without replacement.
Solution: (a) 74 · 104 · 􏰀8􏰁/208 ≈ 0.066 (b) 􏰀7􏰁􏰀10􏰁/􏰀20􏰁 ≈ 0.058 4 448
3. If Susie sells you 7 marbles chosen randomly without replacement, what are your chances of getting at least six marbles of the same color?
Solution: Ways of getting six or more marbles of the same color include getting 6 or 7 green
marbles, or 6 or 7 blue marbles.
Exactly 6 green: 􏰀7􏰁􏰀13􏰁 = 91 (Can’t choose the remaining green) 61
Exactly 7 green: 􏰀7􏰁 = 1 7
Exactly 6 blue: 􏰀10􏰁􏰀10􏰁 = 2, 100 (Can’t pick any more blues) 61
Exactly 7 blue: 􏰀10􏰁 = 120 7
SoP(sixof akind)=(91+1+2100+120)/􏰀20􏰁≈0.030 7
4. Susie sells the marbles for 5 cents each. For 5 cents, she’ll let you pick out a random marble out of the bag. (There are no taksie-backsies – i.e., no replacements!) How much would you have to pay Susie to be sure of getting at least 6 marbles of the same color?
Solution: You might waste 15 cents removing the 3 red marbles after which, in the worst case you spend 50 cents to get 5 green and 5 blue marbles. The next nickle gets you your six-of-a-kind. So 70 cents for 14 marbles altogether.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com