Proabability - I


Problem 1 (5 points):

You are at a taco stand. You order your tacos and go over to the salsa bar. There are 20 different types of salsa to choose from. Using combinatorics, write a MATLAB script to answer the following:

1. How many different combinations of 5 salsas can be made? Display the fol-lowing at the end of the code: ‘The number of 5 salsa combinations that can be made is: N1’ where N1 is the number you calculated.

2. If there are 11 hot salsas and 9 mild salsas in the bar, how many com-binations of 3 hot salsas and 2 mild salsas can be formed? Display the string ‘The number of 5 salsa combinations with 3 hot salsas and 2 mild salsas that can be formed is: N2’ where N2 is the num-ber you calculated.

Save the script as taco.m and upload it to Gauchospace when you are finished.


Problem 2 (5 points)

When you are surfing it is all about waiting for the right wave. Exactly how waves come in ‘sets’ and how big each of them gets is quite complex. But just imagine that waves come in sets of seven. Each wave in the set independently has a 10% chance of being big enough to ride. Write a MATLAB script called surf.m that simulates 1,000,000 sets of waves and estimates the probability that you will get exactly 3 big waves in a set. Display your answer when the code finishes. Also, calculate by hand what this probability should be and have your code display this as well. Upload surf.m to Gauchospace when you are finished.


Problem 3 (10 points)

You are on vacation at Yellowstone National Park and enjoying a long hike through the rough and rugged wilderness. All of a sudden two grizzly bears jump out of the woods and onto the trail in front of you. In order to escape, you quickly think of several courses of action to take that depend on the items you have in your knapsack: rope, a lighter, a canteen, a hunk of meat, zinc oxide, marshmallows, and a frying pan. According to warnings by park rangers, choosing the right escape method depends on whether both bears are male or not. Given that at least one of the bears is male, you need to figure out what the probability of both bears being male is in order to escape. Write a Matlab script called bear.m that creates two random variables, bear1 and bear2, and uses them in a 100,000 trial Monte Carlo simulation that computes the probability of both bears being male. Note that a random bear has an equal probability of being male or female. The output of the script should only print The estimated probability of both bears being male is P’ where P is the percent probability. Once complete, upload bear.m to gauchospace. Hint: the answer is not 1/2.