# Question 1 you roll a 6 sided die 10 times what is

• Homework Help
• 23
• 97% (29) 28 out of 29 people found this document helpful

This preview shows page 2 - 6 out of 23 pages.

Question 1. You roll a 6-sided die 10 times. What is the chance of getting 10 sixes?
[2]: ten_sixes = 2 ten_sixes [2]: 2 [3]: _ = ok . grade( 'q1_1' ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Running tests --------------------------------------------------------------------- Test summary Passed: 1 2
Failed: 0 [ooooooooook] 100.0% passed Question 2. Take the same problem set-up as before, rolling a fair dice 10 times. What is the chance that every roll is less than or equal to 5?
Question 3. Assume we are picking a lottery ticket. We must choose three distinct numbers from 1 to 100 and write them on a ticket. Next, someone picks three numbers one by one, each time without putting the previous number back in. We win if our numbers are all called. If we decide to play the game and pick our numbers as 12, 14, and 89, what is the chance that we win?
3
Passed: 1 Failed: 0 [ooooooooook] 100.0% passed Question 4. Assume we have two lists, list A and list B. List A contains the numbers [10,20,30], while list B contains the numbers [10,20,30,40]. We choose one number from list A randomly and one number from list B randomly. What is the chance that the number we drew from list A is larger than the number we drew from list B?
1.2 2. Monkeys Typing Shakespeare (…or at least the string “datascience”) A monkey is banging repeatedly on the keys of a typewriter. Each time, the monkey is equally likely to hit any of the 26 lowercase letters of the English alphabet, regardless of what it has hit before. There are no other keys on the keyboard. Question 1. Suppose the monkey hits the keyboard 11 times. Compute the chance that the monkey types the sequence datascience . (Call this datascience_chance .) Use algebra and type in an arithmetic equation that Python can evalute. [10]: datascience_chance = ( 1/26 ) **11 datascience_chance [10]: 2.7245398995795435e-16 [11]: _ = ok . grade( 'q2_1' ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Running tests --------------------------------------------------------------------- 4
Test summary Passed: 1 Failed: 0 [ooooooooook] 100.0% passed Question 2. Write a function called simulate_key_strike . It should take no arguments , and it should return a random one-character string that is equally likely to be any of the 26 lower-case English letters.