Skip to content

Commit db09f58

Browse files
authored
Merge pull request #75 from snowch/claude/binomial-distribution-calculator-QJG1z
Fix CDF descriptions and improve Bernoulli section clarity
2 parents e09c62d + 8036e34 commit db09f58

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

chapter_07.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -175,27 +175,28 @@ plt.show()
175175

176176
The CDF shows the step function: starts at 0 for x < 0, jumps to 0.7 at x=0 (the value when outcome is 0), stays flat at 0.7 until x=1, then jumps to 1.0 at x=1 (the value when including both outcomes 0 and 1).
177177

178-
**Understanding PMF and CDF Charts**
178+
Note: Here, P(X ≤ 0) = P(X = 0) = 0.7 because X can't take negative values; in general, "X ≤ 0" means "at or below 0", not "exactly 0".
179179

180-
Now that we've seen both types of visualizations, let's understand how to read and use them practically:
180+
**Reading the PMF**
181181

182-
**PMF (Probability Mass Function) Charts:**
183-
- **What they show:** The height of each bar represents the probability of that exact outcome
182+
- **What it shows:** The height of each bar represents the probability of that exact outcome
184183
- **How to read:** Look at the bar height to find P(X = k) for any specific value k
185184
- **Practical use:** Answer questions like "What's the probability of success?" or "What's the probability of exactly 1 positive test?"
186185
- **Key property:** All bar heights must sum to 1.0 (total probability)
187186

188-
**CDF (Cumulative Distribution Function) Charts:**
189-
- **What they show:** The cumulative probability P(X ≤ k) up to and including each value k
187+
**Reading the CDF**
188+
189+
- **What it shows:** The cumulative probability P(X ≤ k) up to and including each value k
190190
- **How to read:** The height at position k tells you the probability of getting k or fewer successes
191-
- **Why step functions?** For discrete distributions, probability accumulates in jumps at each possible value. Between possible values, the CDF stays constant (no additional probability). The step occurs at each value where the distribution has mass.
191+
- **Why step functions?** For discrete distributions, probability accumulates in jumps at each possible value. Between possible values, the CDF stays constant (no additional probability)
192+
- **Key identity:** The jump at k equals P(X = k) — the size of each step up is the PMF value
192193
- **Practical uses:**
193194
- Find P(X ≤ k) directly by reading the height at k
194195
- Find P(X > k) by calculating 1 - P(X ≤ k)
195196
- Find P(a < X ≤ b) by calculating P(X ≤ b) - P(X ≤ a)
196-
- **Key property:** The CDF always increases (or stays flat) and approaches 1.0
197+
- **Key property:** The CDF is right-continuous, always increases (or stays flat), and approaches 1.0
197198

198-
**Note on CDF visualization:** The charts use `where='post'` in the step plot to create proper right-continuous step functions. Discrete CDFs are right-continuous (they jump up at each value and include that value in the cumulative probability), which `where='post'` correctly represents.
199+
**Note on CDF visualization:** The charts use `where='post'` in the step plot to create proper right-continuous step functions. This means the CDF jumps up at each value and includes that value in the cumulative probability.
199200

200201
:::{admonition} Example: Medical Diagnostic Test with p = 0.1
201202
:class: tip
@@ -450,7 +451,7 @@ plt.show()
450451

451452
![Binomial CDF](ch07_binomial_cdf_generic.svg)
452453

453-
The CDF shows the step function increasing from 0 to 1, representing the cumulative probability of getting k or fewer heads.
454+
The CDF shows P(X ≤ k), the cumulative probability of getting k or fewer heads.
454455

455456
:::{admonition} Example: Sales Calls with n = 20, p = 0.15
456457
:class: tip
@@ -535,7 +536,7 @@ plt.show()
535536

536537
![Binomial CDF](ch07_binomial_cdf.svg)
537538

538-
The CDF shows the step function increasing from 0 to 1, representing the cumulative probability of getting k or fewer successful calls.
539+
The CDF shows P(X ≤ k), the cumulative probability of getting k or fewer successful calls.
539540

540541
:::
541542

@@ -705,7 +706,7 @@ plt.show()
705706

706707
![Geometric CDF](ch07_geometric_cdf_generic.svg)
707708

708-
The CDF shows the step function increasing from 0 toward 1 as k increases (eventually you'll succeed).
709+
The CDF shows P(X ≤ k), approaching 1 as k increases (eventually you'll succeed).
709710

710711
:::{admonition} Example: Certification Exam with p = 0.6
711712
:class: tip
@@ -803,7 +804,7 @@ plt.show()
803804

804805
![Geometric CDF](ch07_geometric_cdf.svg)
805806

806-
The CDF shows the step function increasing from 0 toward 1 as the trial number increases.
807+
The CDF shows P(X ≤ k), increasing toward 1 as the trial number increases.
807808

808809
:::
809810

@@ -971,7 +972,7 @@ plt.show()
971972

972973
![Negative Binomial CDF](ch07_negative_binomial_cdf_generic.svg)
973974

974-
The CDF shows the step function increasing from 0 to 1, representing the cumulative probability of achieving r successes within k trials.
975+
The CDF shows P(X ≤ k), the cumulative probability of achieving r successes within k trials.
975976

976977
:::{admonition} Example: Quality Control with r = 3, p = 0.05
977978
:class: tip
@@ -1075,7 +1076,7 @@ plt.show()
10751076

10761077
![Negative Binomial CDF](ch07_negative_binomial_cdf.svg)
10771078

1078-
The CDF shows the step function increasing from 0 to 1, representing the cumulative probability of finding 3 defective items within k tests.
1079+
The CDF shows P(X ≤ k), the cumulative probability of finding 3 defective items within k tests.
10791080

10801081
:::
10811082

@@ -1242,7 +1243,7 @@ plt.show()
12421243

12431244
![Poisson CDF](ch07_poisson_cdf_generic.svg)
12441245

1245-
The CDF shows the step function increasing from 0 to 1, useful for questions like "What's the probability of 6 or fewer calls?"
1246+
The CDF shows P(X ≤ k), useful for questions like "What's the probability of 6 or fewer calls?"
12461247

12471248
:::{admonition} Example: Email Arrivals with λ = 5
12481249
:class: tip
@@ -1327,7 +1328,7 @@ plt.show()
13271328

13281329
![Poisson CDF](ch07_poisson_cdf.svg)
13291330

1330-
The CDF shows the step function increasing from 0 to 1, useful for questions like "What's the probability of 6 or fewer emails?"
1331+
The CDF shows P(X ≤ k), useful for questions like "What's the probability of 6 or fewer emails?"
13311332

13321333
:::
13331334

@@ -1497,7 +1498,7 @@ plt.show()
14971498

14981499
![Hypergeometric CDF](ch07_hypergeometric_cdf_generic.svg)
14991500

1500-
The CDF shows the step function increasing from 0 to 1, useful for questions like "What's the probability of getting at most 1 Ace?"
1501+
The CDF shows P(X ≤ k), useful for questions like "What's the probability of getting at most 1 Ace?"
15011502

15021503
:::{admonition} Example: Lottery Tickets with N=100, K=20, n=10
15031504
:class: tip
@@ -1589,7 +1590,7 @@ plt.show()
15891590

15901591
![Hypergeometric CDF](ch07_hypergeometric_cdf.svg)
15911592

1592-
The CDF shows the step function increasing from 0 to 1, representing the cumulative probability of getting k or fewer winning tickets.
1593+
The CDF shows P(X ≤ k), the cumulative probability of getting k or fewer winning tickets.
15931594

15941595
:::
15951596

0 commit comments

Comments
 (0)