Homework 5

CHE 116: Numerical Methods and Statistics

2/15/2018


1 Combinations (18 Points)

  1. [2 points] A family may have up to 3 cars. On a street with 5 families, how many possibilities of car ownership among the 5 families can their be? Assume the families can be distinguished.

  2. [2 points] You are playing starcraft matches against your friend. You have won 7 out of 10 matches. How many sequences of win/lose could arrive at such a score of 7 - 3 (7 wins, 3 losses). For example, one sequence is Win, Lose, Win, Win, Win, Win, Lose, Lose, Win, Win. Hint: Try thinking about this as a rearranging letters problem

  3. [2 points] You have a sequences of 0s and 1s. Let $k$ represent the number of 1s and $n$ be the length of the sequence. For example, $01110$ has $k = 3$ and $n = 5$. How many sequences are there for a fixed $n$ and $k$?

  4. [4 points] The equation from problem 1.3 has been seen in unit 2 in a different context. What was it used to calculate? What is different about its use there and the examples from problem 1.3 and 1.2?

  5. [5 points] Using your information from 1.2 through 1.4 reason about the purpose of the binomial coefficient in the formula for the binomial probability distribution.

  6. [2 points] You have 8 textbooks but you can only carry 3 at a time. How many possible combinations of textbooks can you carry?

2 Working with Probability Distributions (20 Points)

Consider a probability distribution with a 5 element sample space: $Q = \{-3, 0, 2, 3, 6\}$ whose probabilities are $\{1 / 10,\, 4 / 10, \,1/ 10, \,2 / 10,\, 2 / 10\}$ respectively. For example, $P(3) = 2 / 10$. Answer the following questions below:

  1. [5 points] Is this probability distribution normalized? Use a for loop and the += operator

  2. [5 points] What is the distribution's expected value? Use a for loop and the += operator

  3. [5 points] What is the distribution's variance? Use numpy to evaluate this and not a for loop. Do not use the built in var or std functions. You can reuse value for $E[X]$ from 2.2.

  4. [5 points] Define the random variable $S(x) = x^2$. What is $\textrm{E}[S]$. Use a for loop

3 Standard Probility Distributions (7 Points)

Choose below the probability distribution that best fits the described process. Choose only from Bernoulli, Geometric, Binomial, Poisson, Exponential, and Normal. 1 Points each.

  1. Number of lottery winners
  2. Number of students who completed their homework in a class with 25 students.
  3. The speed of a car on the highway
  4. The number of collisions before a chemical reaction happens between two molecules
  5. Whether or not your front door is open
  6. The time between seeing your best friend
  7. The number of occupied tables in a restaurant with 18 tables.

4 Working with Probability Distributions (19 Points + 5 Extra Credit)

For the following problems, choose and state an appropriate distribution, write out its parameters based on the problem statement and then compute the requested quantity. Write the distribution information in Markdown/LaTeX and compute answers in Python. Use for loops for computing expected value and prediction intervals. Do not use numpy or the formulas given in lecture notes. For the geometric distribution or Poisson distribution, replace the $\infty$ with a large number like 500. Assume in all these examples that multiple trials are independent.

  1. [2 points] You go from store to store trying to find a special toy for your dog. Stores have the toy with probability 0.3. What's the expected number of store you must visit before obtaining the toy? Remember to read the instruction above!!

  2. [2 points] When you open the door for your dog, there is a 0.38 probability of him going outside. What is the probability of the dog not going outside?

  3. [2 points] You are playing fetch with your dog. He retrieves the ball which you throw with probability 0.8. After 5 throws, what's the probability of him returning the ball only once?

  4. [2 points] You give your dog 4 treats per day on average. What is the probability of your dog receives 10 treats?

  5. [4 points] Your dog is running laps around the house where the time between the laps is 30 seconds. What's the probability of the dog completing a lap less than 10 seconds? *Hint: compute the integral analytically in LaTeX, then evaluate the upper/lower terms in Python.

  6. [5 points] You are hunting for dog poop in the yard. You check the dog's 10 favorite places to poop. Each can hold 1 or 0 poops. If the probability of your dog pooping in a spot is 0.3, what is the probability of finding more than 6 poops?

  7. [2 points] Your dog is "one in a million". Given that there are 73 million dogs in the US, what is the probability your dog is truly unique. In other words, what is the probability that there are 0 dogs like yours.

  8. [Extra Credit 5 Points] Repeat problem 4.1 but find how many stores you need to visit to have a 90% chance of finding the toy.