Homework 2
Instructions:
- Show ALL Work, Neatly and in Order.
- No credit for Answers Without Work.
- Submit a single PDF file including all solutions.
- DO NOT submit individual files or images.
- For coding questions, submit ONE.py
file with comments.
For this homework, you only need numpy
and matplotlib
.
Question 1
Write some of the elements of the following sets:
- \(\{ 5x-1: x \in \mathbb{Z} \}\)
- \(\{ x \in \mathbb{R}: \sin \pi x = 0 \}\)
- \(\{X : X \subseteq \{3,2,a\} \text{ and } |X|=2 \}\)
Write the following sets in set notation:
- \(\{ 2, 4, 8, 16, 32, 64, ...\}\)
- \(\{0,1,4,9,16,25,36, ...\}\)
- \(\{..., \frac{1}{8},\frac{1}{4},\frac{1}{2},1,2,4,8,... \}\)
Question 2
A retail store accepts either American Express or VISA. The percentages of customers carrying each card are:
- American Express: \(24%\)
- VISA: \(61%\)
- Both: \(11%\)
What percentage of customers carry a card accepted by the store?
Question 3
Sixty percent of students wear neither a ring nor a necklace. Given:
- \(20%\) wear a ring
- \(30%\) wear a necklace
Find the probability that a randomly chosen student wears:
- A ring or a necklace
- Both a ring and a necklace
Question 4
Two fair dice are rolled. Find the conditional probability that at least one die lands on \(6\), given that they land on different numbers.
Question 5
An urn contains \(6\) white and \(9\) black balls. If \(4\) balls are selected without replacement, what is the probability that the first \(2\) are white and the last \(2\) are black?
Question 6
A defendant is judged guilty if at least \(2\) out of \(3\) judges vote guilty. Given:
- Probability of a guilty vote when defendant is guilty: \(0.7\)
- Probability of a guilty vote when defendant is innocent: \(0.2\)
- \(70%\) of defendants are guilty
Compute the conditional probability that judge \(3\) votes guilty given:
- Judges \(1\) and \(2\) vote guilty.
- Judges \(1\) and \(2\) split votes.
- Judges \(1\) and \(2\) vote not guilty.
Are the judges’ votes independent? Conditionally independent? Explain.
Question 7
Given the distribution function of \(X\):
\[ F_{X}(\lambda) = \begin{cases} 0, & \lambda < 0 \\ \frac{1}{2}, & 0 \leq \lambda < 1 \\ \frac{3}{5}, & 1 \leq \lambda < 2 \\ \frac{4}{5}, & 2 \leq \lambda < 3 \\ \frac{9}{10}, & 3 \leq \lambda < 3.5 \\ 1, & \lambda \geq 3.5 \\ \end{cases} \]
Find \(p_X(\lambda)\).
Question 8
A player rolls a fair die and flips a fair coin. If heads, they win twice the die value; if tails, they win half. Determine the expected winnings.
Coding Exercise 1: Binomial Distribution
The binomial distribution PMF is:
\[ p_X(\lambda) = {n \choose k} \lambda^n (1-\lambda)^{n-k} \]
Using Python, generate binomial data and create visualizations for \(p_X(\lambda)\) and \(F_X(\lambda)\).