0% found this document useful (0 votes)
239 views2 pages

Stats 100A Hw1

(1) The document describes a homework problem involving calculating probabilities for different events based on population data. It includes finding P(A), P(B), P(A|B), P(B|A) and using rules like the chain rule, total probability rule, and Bayes' rule. (2) Another problem involves generating random points in a unit square and calculating the probability they fall within a circle (P(X^2 + Y^2 ≤ 1)). It describes how this can be used to approximate pi. (3) A third problem calculates probabilities like P(X ≥ 1/2) and P(X ≥ 1/2 | X + Y ≥ 1) for uniformly distributed

Uploaded by

Billy Bob
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
239 views2 pages

Stats 100A Hw1

(1) The document describes a homework problem involving calculating probabilities for different events based on population data. It includes finding P(A), P(B), P(A|B), P(B|A) and using rules like the chain rule, total probability rule, and Bayes' rule. (2) Another problem involves generating random points in a unit square and calculating the probability they fall within a circle (P(X^2 + Y^2 ≤ 1)). It describes how this can be used to approximate pi. (3) A third problem calculates probabilities like P(X ≥ 1/2) and P(X ≥ 1/2 | X + Y ≥ 1) for uniformly distributed

Uploaded by

Billy Bob
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

STATS 100A HW1

Problem 1 Suppose a population has N people. Among them, N1 are males, and N0 are females.
Among the males, T1 are taller than 6 feet. Among the females, T0 are taller than 6 feet. Suppose
we randomly sample a person from the population. Let A be the event that the person is male.
Let B be the event that the person is taller than 6 feet.
Using the numbers N , N1 , N0 , T1 , T0 , calculate or prove the following:
(1) Calculate P (A), P (B), P (A|B), P (B|A), P (A ∩ B).
A: P (A) = |A|/|Ω| = N1 /N . P (B) = |B|/|Ω| = T /N , where T = T1 + T0 . P (A|B) =
|A ∩ B|/|B| = T1 /T . P (B|A) = |A ∩ B|/|A| = T1 /N1 . P (A ∩ B) = |A ∩ B|/|Ω| = T1 /N .
(2) Show that P (A ∩ B) = P (A)P (B|A) = P (B)P (A|B). This is called chain rule.
A: P (A∩B) = T1 /N . P (A)P (B|A) = (N1 /N )(T1 /N1 ) = T1 /N . P (B)P (A|B) = (T /N )(T1 /T ) =
T1 /N .
(3) Show that P (B) = P (A)P (B|A) + P (Ac )P (B|Ac ). This is called rule of total probability.
A: P (B) = T /N . P (A) = N1 /N . P (B|A) = T1 /N1 . P (Ac ) = N0 /N . P (B|Ac ) = T0 /N0 .
P (A)P (B|A) + P (Ac )P (B|Ac ) = N1 /N × T1 /N1 + N0 /N × T0 /N0 = (T1 + T0 )/N = T /N = P (B).
(4) Show that
P (A ∩ B) P (A)P (B|A)
P (A|B) = = .
P (B) P (A)P (B|A) + P (Ac )P (B|Ac )
This is called the Bayes rule.
A: P (A|B) = T1 /T . P (A ∩ B) = T1 /N . P (B) = T /N . P (A ∩ B)/P (B) = T1 /T . The last
equation comes from (2) and (3).
Problem 2 Suppose we generate X and Y from the uniform distribution over [0, 1] independently,
i.e., (X, Y ) is a random point within the unit square [0, 1]2 .
(1) Calculate P (X 2 + Y 2 ≤ 1) by measuring the area.
A: Let A = {(x, y) : x2 + y 2 ≤ 1}.
|A| π/4 π
P (X 2 + Y 2 ≤ 1) = = =
|Ω| 1 4

(2) Suppose we repeat the experiment n times. For large n, how often X 2 + Y 2 ≤ 1? Suppose
it happens m times. Can you approximate π based on m and n?
A:
m π 4m
≈ =⇒ π ≈
n 4 n
(3) Calculate P (X ≥ 1/2) and P (X ≥ 1/2|X + Y ≥ 1).
A: Let A = {(x, y) : x ≥ 1/2}, and B = {(x, y) : x + y ≥ 1}.
|A| 1
P (X ≥ 1/2) = =
|Ω| 2
|A ∩ B| 1/2 − 1/2 · 1/2 · 1/2 3
P (X ≥ 1/2|X + Y ≥ 1) = = =
|B| 1/2 4
(4) Let A be the event that X ∈ [.2, .6], and let B be the event that Y ∈ [.3, .5]. Show that
P (A ∩ B) = P (A)P (B).

1
A: P (A) = .4. P (B) = .2. P (A ∩ B) = .4 × .2 = .8.
Problem 3 (Optional) Read the following webpages on Buffon’s needle:
https://mste.illinois.edu/activity/buffon/
https://yihui.org/animation/example/buffon-needle/
Write a brief memo on (1) how to calculate the probability in the simplest case, (2) how to
estimate π using Monte Carlo.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy