Homework 1

CHE 116: Numerical Methods and Statistics

Version 1.0 (1/18/2018)


1. Probability (4 Points)

The probability of an event or element in a sample space is written as $P(A)$, where $A$ is the event or element in the sample space. Answer the following problems symbolically and simplified. Each problem is worth 1 point.

  1. [2 points] Our sample space contains three elements: $Q = \{A, B, C\}$. What is the probability of observing $P(A \,\textrm{OR} \,\textrm{B}\, \textrm{OR}\, C)$

  2. [1 points] If we observe two sequential independent samples with the same sample space as above, what is the probability of observing $A$ and then $B$?

  3. [2 points] You have a sample space with the numbers 1-10, where each element in the sample space has the same probability. If event $E$ is elements $\{2, 5, 7\}$, then what is the probability of the event $E$, $P(E)$?

  4. [2 points] What is the probability of not event $E$ from the previous question?

  5. [4 points] State the number of observations/samples for the probabilities specified in questions 1.1-1.4.

1.1

$$ P(A \,\textrm{OR} \,\textrm{B}\, \textrm{OR}\, C) = P(A) + P(B) + P(C) = 1 $$

1.2

$$ P(A) \times P(B) $$

1.3

$$ P(E) = P(2) + P(5) + P(7) = \frac{1}{10} + \frac{1}{10} + \frac{1}{10} = \frac{3}{10} $$

1.4

$$ P(~E) = 1 - P(E) = \frac{7}{10} $$

1.5

  1. 1
  2. 2
  3. 1
  4. 1

2. Die Probability

You are rolling a die with 6 sides. Event $A$ is that you roll a number less than 5. Event $B$ is that you roll a $6$. Event $C$ rolling a number less than 2. Answer these problems using python code. Each problem is worth 1 point.

  1. [1 point] What is the probability of event $A$?
  2. [1 point] If you roll once, what is the probability of rolling event $A$ or $C$?
  3. [1 point] If you roll event $A$, on your next roll what is the probability of event $B$?
  4. [2 points] What is the probability of rolling event $A$ and event $B$ in the course of two rolls?
  5. [2 points] What is the probability of rolling event $A$ followed by event $B$?
  6. [4 points] Why are your answers different for questions 2.4 and 2.5? Answer this in words using Markdown.

2.1

The markdown answers are only for clarity and not required for credit

$$ A = \{3, 4, 5, 6\} $$

In [1]:
4 / 6


Out[1]:
0.6666666666666666

2.2

The first roll has no impact

$$ P(A\,\textrm{OR}\, C) = P(A) + P(C) - P(A \cap C) $$

Note due to change to HW, mark 4/6 + 1/6 - 0 as correct as well


In [2]:
4 / 6  + 1 / 6 - 1/6


Out[2]:
0.8333333333333333

2.3

Again, the roll has no impact


In [3]:
1/6


Out[3]:
0.16666666666666666

2.4

The wording means we could roll A then B or B then A. A combination.


In [4]:
(1 / 6) * (4 / 6) + (4 / 6) * (1 / 6)


Out[4]:
0.2222222222222222

2.5

The wording means only one permutation: A then B


In [5]:
(1 /  6) * ( 4 / 6)


Out[5]:
0.1111111111111111

2.6

2.4 is a combination with two permutation so we must sum the probabilities of each permutation. 2.5 is a specific permutation so we must only compute the product of the probabilities.

3. Sample Spaces

Answers these problems symbolically

Each problem is worth 4 points

  1. [2 points] You play a game where each time you flip a coin and draw a card from a 52 card deck. Both of these actions make up an observation. What is the size of the sample space?
  2. [1 point] What is the sample space for number of students attending lecture if there are 80 students enrolled?
  3. [1 point] You dial random 10 digit phone numbers. What's the sample size?
  4. [1 point] You have a 10 character password which can contain lowercase letters and numbers. What's the sample space size?
  5. [1 point] You double the length of your password. What's the sample size now?
  6. [4 points] Based on the previous problem, would a password that is a complete sentence (35 characters) with only lowercase letters plus a space be more or less secure than the previous problem? Justify your answer.

3.1

Each observation consists of two items. So the possibilities are (heads, card 1), (heads, card 2), (heads, card 3), etc. This gives $2 \times 52 = 104$ possible pairs of outcomes. 104

3.2

$$ \{0, 2, \ldots, 80\} $$

3.3

$$ 10^{10} $$

3.4

$$ (26 + 10)^{10} \approx 10^{15} $$

3.5

$$ (26 + 10)^{20} \approx 10^{31} $$

3.6

$$ (26 + 1)^{35} \approx 10^{50} $$

Significantly more secure