#set document(title: "5.3 Geometric Distributions", author: "Rachel Webb") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 5.3#h(0.6em)Geometric Distributions The geometric distribution is a discrete probability distribution used to find the probability of success when there are two outcomes to each trial, and the trials are independent with the same probability of occurrence. A geometric probability distribution results from a random experiment that meets all of the following requirements. + Repeat the trials until you get a success. + The trials must be independent. + Each trial must have exactly two categories that can be labeled “success” and “failure.” + The probability of a “success,” denoted by p, remains the same in all trials. The probability of “failure” is often denoted by q, thus q = 1– p. + Random Variable, X, counts the number of trials until your first success If a random experiment satisfies all of the above, the distribution of the random variable X, where X counts the number of trials until the first success, is called a geometric distribution. If a discrete random variable X has a geometric distribution with the probability of success is p, we write X ~ G(p). #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The geometric distribution is P(X = x) = p ∙ q#super[(x – 1)] , x = 1, 2, 3, … where x is the number of trials up to the first success that you are trying to find the probability for, p is the probability of a success for one trial and q = 1 – p is the probability of a failure for one trial. ] Be careful, a “success” is not always a “good” thing. Sometimes a success is something that is “bad,” like finding a defect or getting in a car crash. The success will be the event from the probability question. #examplebox("Example 1")[][ A game of chance has only two possible outcomes to win or lose for each time you play. The probability of losing the game is 65%. You play this game until your first loss. What is the probability of playing the game exactly 6 times in a row? #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Geometric probabilities without the q^(x-1) arithmetic] Crunch's Geometric box counts trials up to and including the first success - the same convention as the book's P(X = x) = p \* q^(x-1) - but it reports the cumulative P(X \<= k). The book asks for "exactly", so open both links and subtract, keeping all six decimals: 0.998162 - 0.994748 = 0.0034. Then set p = 0.5 with k = 8 and k = 7 for the coin example's 0.00391. - Game p = 0.65: P(X \<= 6) = 0.998162 - Game p = 0.65: P(X \<= 5) = 0.994748, so P(X = 6) = 0.0034 - Green eyes p = 0.02: P(X \<= 5) = 0.096079 minus P(X \<= 4) = 0.077632 gives 0.0184 ] #solutionbox[ We have independent trials with two outcomes, no set sample size and the same probability of success each time we play so we can use the geometric distribution. Let p = 0.65, which means q = 1 – 0.65 = 0.35 and x = 6. P(X = 6) = 0.65 ∙ 0.35#super[5] = 0.0034. This is the probability of winning the first 5 games and losing on the 6th game in which you would stop playing. ] ] #strong[TI-84:] Press \[2nd\] \[DISTR\]. This will get you a menu of probability distributions. Press 0 or arrow down to geometpdf( and press \[ENTER\]. This puts #strong[geometpdf] ( on the home screen. Enter the values for p and x with a comma between each. Press \[ENTER\]. This is the probability density function and will return you the probability of exactly x successes. For the previous example, we would use geometpdf(0.65,6). #figure(figph[TI-84 DISTR menu with geometpdf( highlighted among options including binompdf, binomcdf, poissonpdf, poissoncdf, and geometcdf, beside a home screen computing geometpdf(.65,6) = .0034139219.], alt: "TI-84 DISTR menu with geometpdf( highlighted among options including binompdf, binomcdf, poissonpdf, poissoncdf, and geometcdf, beside a home screen computing geometpdf(.65,6) = .0034139219.", caption: none) #strong[TI-89:] Go to the \[Apps\] #strong[Stat/List Editor], then select F5 \[DISTR\]. This will get you a menu of probability distributions. Arrow down to #strong[Geometric Pdf] and press \[ENTER\]. Enter the values for p and x into each cell. Press \[ENTER\]. This gives the probability density function and will return you the probability of exactly x successes. #figure(figph[TI-89 screens for the geometric distribution: the Distr menu with Geometric Pdf highlighted, the Geometric Pdf dialog with Prob Success p = .65 and X Value = 6, and a result window showing Pdf = .003414.], alt: "TI-89 screens for the geometric distribution: the Distr menu with Geometric Pdf highlighted, the Geometric Pdf dialog with Prob Success p = .65 and X Value = 6, and a result window showing Pdf = .003414.", caption: none) #examplebox("Example 2")[][ Flip a fair coin until you get a tail. What is the probability of flipping the coin exactly 8 times until you get a tail? #solutionbox[ In this case the probability of a success is getting a tail on any one toss which is p = ½ = 0.5. We are interested in a success on the eighth flip so x = 8. P(X = 8) = 0.5 ∙ 0.5#super[7] = 0.00391. Figure 5-5 shows a graph of the discrete probability distribution. #figure(figph[Bar chart titled Geometric Distribution p = 0.5, with P(x) plotted against x = 1 to 8; the bars halve each step, labeled 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.01563, 0.00781, and 0.00391.], alt: "Bar chart titled Geometric Distribution p = 0.5, with P(x) plotted against x = 1 to 8; the bars halve each step, labeled 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.01563, 0.00781, and 0.00391.", caption: none) Figure 5-5 ] ] #examplebox("Example 3")[][ When looking at a person’s eye color, it turns out that only 2% of people in the world have green eyes (not to be confused with hazel colored eyes). Randomly select people and look at their eye color. What is the probability that you get someone with green eyes on the 5#super[th] person? #figure(figph[TI-84 home screen showing the command geometpdf(.02,5) returning .0184473632.], alt: "TI-84 home screen showing the command geometpdf(.02,5) returning .0184473632.", caption: none) #solutionbox[ The probability of a success is 0.02. We are looking for P(X = 5) = 0.02 ∙ 0.98#super[4] = 0.0184. ] ] #strong[Mean, Variance & Standard Deviation of a Geometric Distribution] For a geometric distribution, μ, the expected number of successes, σ#super[2] , the variance, and σ, the standard deviation for the number of success are given by the formulas, where p is the probability of success and q = 1 – p. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #math.equation(block: true, alt: "μ equals the fraction 1 over p σ squared equals the fraction 1 minus p over p squared σ equals the square root of the fraction 1 minus p over p squared")[$μ = frac(1, p) #h(1em) σ^(2) = frac(1 − p, p^(2)) #h(1em) σ = sqrt(frac(1 − p, p^(2)))$] ] #examplebox("Example 4")[][ ]