Homework 1

CHE 116: Numerical Methods and Statistics

Version 1.1 (1/14/2015)


1. Simple Probability (4 Points)

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

  1. If we observe an event, what is the probability that the event is $A$ or $B$ assuming that $A$ and $B$ are mutually exclusive?

  2. If we observe a sample, what is the probability of observing $A$ or $B$ if they are the only two possible samples?

  3. What is the probability of observing samples or events $A$ and $B$ if they are independent?

  4. Question 1.2 and question 1.3 were ambiguous about the number of observations. Specifically how many observations occur in each question?

Question 1.1 Answer

If we observe an event, what is the probability that the event is $A$ or $B$ assuming that $A$ and $B$ are mutually exclusive?

$P(A) + P(B)$

Question 1.2 Answer

$1#

Question 1.3 Answer

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

Question 1.4 Answer

1.2 1 observation, 1.3 two observations

2. Die Probability (6 Points)

You are rolling a die with 6 sides. Event $A$ is that you roll a number greater than 3. Event $B$ is that you roll a $3$. Event $C$ rolling a number less than 3. Answer these problems using python code. Make sure your numbers contain decimals (write 1.0 instead of 1) so python knows you want to have decimals. Each problem is worth 1 point.

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

In [1]:
#Answer to 2.1
3.0 / 6.0


Out[1]:
0.5

In [2]:
#Answer to 2.2
3.0/6.0 + 2.0/6.0


Out[2]:
0.8333333333333333

In [3]:
#Answer to 2.3
3.0 / 6.0


Out[3]:
0.5

In [4]:
#Answer to 2.4
(3.0 / 6.0) * (1.0 / 6.0)


Out[4]:
0.08333333333333333

In [6]:
#Answer to 2.5
(3.0 / 6.0) * (1.0 / 6.0) + (3.0 / 6.0) * (1.0 / 6.0)


Out[6]:
0.16666666666666666

Question 2.6 answer

Question 2.4 is a specific permutation, where as 2.5 asks for the probability of that combination, allowing for both possible permutations (answer is acceptable in either markdown or python code)

3. Sample Spaces (16 Points)

Answers these problems symbolically

Each problem is worth 2 points

  1. You play a game where each time you flip a coin and roll a die. Both of these actions make up an observation. What is the size of the sample space?
  2. What is the sample space for kinetic energy?
  3. You have a random number with 3 digits places. What's the sample space size? What's the sample size of a 3 digit number in base 8?
  4. You have a 6 character password which can contain a-z (lowercase). What's the sample space size?
  5. You double the length of your password. What's the sample size now?
  6. With the 6 character password, you now include uppercase letters, the number 0-9 and and 4 punctuation characters. What's the sample size?
  7. Based on the previous problem, would a password that is a complete sentence (30 characters) with only lower case letters plus a space or a normal password (10 characters) involing symbols and numbers be more secure? Justify your answer. You may approximate your answer to the nearest order of magnitude.
  8. What is the sample space for 2 methane molecules and 4 oxygen atoms reacting assuming no radicals or ions are formed? Enumerate (list all) the sample space.

Question 3.1 Answer

$$Q = 2 \times 6 = 12$$

Question 3.2 Answer

$$[0,\infty)$$

Question 3.3 Answer

$$Q = 10^3, 8^3$$

Question 3.4 Answer

$$Q = 26^6 = 308,915,776$$

Question 3.5 Answer

$$Q = 26^{12} = 9,542,895,6661,682,176$$

Question 3.6 Answer

$$Q = (26 + 26 + 10 + 4)^6 = 82,653,950,016$$

Question 3.7 Answer

A complete sentence would have more, since $27^{30} >> 66^{10}$. The more general anwser is that increasing length goes by $a^x$ whereas increasing symbol amount goes by $x^a$. $a^x$ grows significantly faster.

Question 3.8 Answer

  1. 2CH$_4$ + 2O$_2$
  2. CH$_4$ + C + 2H$_2$O + O$_2$
  3. CH$_4$ + 2H$_2$ + 2O$_2$
  4. 2C + 4H$_2$O
  5. 2C + 2H$_2$O + O$_2$ + 2H$_2$
  6. 2C + 4H$_2$ + 2O$_2$

In [ ]: