Question: Statistics 6260/4960 Fall 2016 Assignment 3 80 points Due: Wednesday, November 9 Suppose n people have a $5 bill, and n people have a $10

Statistics 6260/4960 Fall 2016 Assignment 3 80 points Due: Wednesday, November 9 Suppose n people have a $5 bill, and n people have a $10 bill. They line up single file one night to buy a ticket that costs $5. The agent selling tickets has some given number of $5 bills at the beginning of the night. No one ever changes place in line. If the agent does not have change for the next customer, the ticket booth shuts down. Ignore the fact this would not happen with real human beings. Each possible ordering of the customers is equally likely. What is the probability that every customer who lined up at the beginning of the process will be able to purchase a ticket? Remember, there are 2n customers, so the answer will depend on n. Use R to simulate the problem by writing a function. Do not give an analytic solution. The function prototype is: ticket.line <- function(n,start.5,sim.length) Here n is the number of people in line who have a $5 bill (and this equals the number of people who have a $10 bill). You should check that n is a positive integer. start.5 is the number of $5 bills the ticket taker has when all 2n people are in line. Note that start.5 may be any non-negative integer. sim.length should also be a positive integer. It is the number of times a ticket line will be simulated. Your simulation will create a randomly selected ticket line. Then you determine if everyone gets to purchase a ticket. You repeat this process sim.length times. You keep count of how many of these randomly selected ticket lines allow the last customer to purchase a ticket. The function returns the number of times the last customer was able to purchase a ticket divided by sim.length This is the simulated probability. Do email me one file containing your function using the usual conventions for your filename, and do include name = \"your name\" as the first executable statement. Remember not to have any other executable statements in your file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!