Question: Please solve both 3 and 4 in python. 3. Craps is a popular gambling game involving two dice. The rules are as follows. Only the
Please solve both 3 and 4 in python.

3. Craps is a popular gambling game involving two dice. The rules are as follows. Only the totals of the two dice count. The player throws the dice and wins at once if the first throw is 7 or 11, loses at once if it is 2,3 , or 12 . Any other throw is called her "point". If the first throw is a point, then the player throws the dice repeatedly until she either wins by throwing the point again or loses by throwing a 7 . What is the probability of winning? To determine the probability, write a program that simulates the game of craps. Repeat the game at least 100,000 times to determine the probability of winning. Use the randint function in numpy.random (e.g. from numpy.random import randint) to generate random numbers simulating the roll of dice. 4. The Birthday Problem is: if there are a group of n people in a room, what is the probability that two or more of them have the same birthday? It is possible to determine the answer to this question by simulation. Write a function that calculates the probability that two or more of n people will have had the same birthday, where n is the calling argument. (Hint: To do this, the function should create an array of size n and generate n birthdays in the range of 1 to 365 randomly. It should then check to see if any of the n birthdays are identical. The function should perform this experiment at least 5000 times, and calculate the fraction of those times in which two or more people had the same birthday.). Write a test program that calculates and prints the probability that two or more of the n people will have the same birthday for n=2,3,,40
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
