Skip to content
Tutorials Center
My learning

Topics

Lesson 35 of 37 ยท Projects and Practice

Practice Set: Probability and Distributions

Ten practice problems on conditional probability, trees, Bayes, binomial and normal distributions, with a code checker so you can test your own answers.

Time to practice. Work each problem on paper first, then check your answer with the code. The checker prints the values to compare with yours; if they differ, find the step that went wrong rather than just copying the number.

Topics: conditional probability, tree diagrams, independence, Bayes, random variables, binomial and normal distributions.

Problems

Part A: conditional probability and trees

  1. In a class of 40, 24 take French, 16 take Spanish, and 6 take both. (Everyone takes at least one.) Find P(Spanish | French).
  2. A box holds 6 white and 4 black balls. Two are drawn without replacement. Find P(both the same colour).
  3. Events A and B have P(A) = 0.5, P(B) = 0.4, P(A and B) = 0.2. Are they independent?
  4. A factory has two machines. Machine X makes 70% of items, 2% of which are defective. Machine Y makes 30%, 5% of which are defective. An item is found defective. What is the probability it came from machine Y?

Part B: random variables

  1. A game: roll a fair die. Win $10 if you roll a 6, win $2 if you roll 4 or 5, otherwise win nothing. It costs $2 to play. Find the expected net gain per play.
  2. X has distribution P(1) = 0.3, P(2) = 0.4, P(3) = 0.3. Find E(X) and Var(X).

Part C: binomial and normal

  1. A multiple-choice test has 8 questions with 4 options each. A student guesses every answer. Find P(exactly 2 correct) and P(at least 6 correct).
  2. A fair coin is flipped 20 times. Find the mean and standard deviation of the number of heads.
  3. Test scores are N(70, 10ยฒ). Find P(score > 85) and the score that marks the top 10%.
  4. A component lasts on average 1,200 hours with standard deviation 150 (normal). Find the probability a component lasts between 1,000 and 1,350 hours.

Checker 1: counting and Bayes

Python Answers for problems 1 to 4

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Checker 2: random variables and distributions

Python Answers for problems 5 to 10

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

How to learn from mistakes

  • If a probability came out greater than 1 or negative, you made an arithmetic or logic error.
  • For "without replacement" problems, did the second factor change?
  • For "given" problems, which group is your denominator?
  • For normal problems, did you standardize with z = (x - ฮผ)/ฯƒ and use the correct tail?
  • Draw a tree or table for anything with more than one stage.

Redo any problem you missed a day later without looking at the solution. Spaced repetition beats rereading.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. In problem 1 you restrict attention to French students. What is your denominator?

    Given French, the universe is the 24 French students.
  2. 2. A binomial problem says 'at least 6 out of 8'. Which approach is simplest?

    The cases are mutually exclusive, so their probabilities add.
  3. 3. For a normal variable, finding the score marking the top 10% uses...

    The top 10% lie above the 90th percentile.

Summary

  • Always draw a picture or table before multiplying fractions.
  • Identify the type: conditional, tree, Bayes, expected value, binomial or normal.
  • Use code to check answers, and to find where a method goes wrong.

Next: Practice Set: Regression and Inference