Chapterبەش 5 · Lectureوانە 5.6

The Binomial Distribution (Supplementary)دابەشبوونی دووڕادەیی (زیادە)

Counting successes in repeated independent trials: Bernoulli trials, the binomial setting, the formula (nx)pxqn−x\binom{n}{x}p^x q^{n-x} built from penalty kicks, the course's coin pmfs as binomial, how the shape changes with pp, mean npnp and variance npqnpq, "at least" questions, Python, and the contrast with drawing without replacement (hypergeometric).

ژماردنی سەرکەوتنەکان لە کاری دووبارە و سەربەخۆدا: ، بارودۆخی دووڕادەیی، فۆرمولەی (nx)pxqn−x\binom{n}{x}p^x q^{n-x} کە لە لێدانی پەنالتی دروست دەکرێت، دراوەکانی کۆرسەکە وەک دووڕادەیی، چۆنێتیی گۆڕانی شێوە لەگەڵ pp، npnp و npqnpq، پرسیارەکانی «لانیکەم»، Python و بەراورد لەگەڵ دەرهێنان ().

13 min read13 خولەک خوێندنەوە · 14 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Decide whether a situation is binomial (fixed nn, two outcomes, same pp, independent trials).
  • Compute binomial probabilities with (nx)pxqn−x\binom{n}{x}p^x q^{n-x} and the complement rule.
  • Use μ=np\mu = np, σ2=npq\sigma^2 = npq and σ=npq\sigma = \sqrt{npq}, and describe the shape for different pp.
  • Explain when drawing without replacement is hypergeometric instead of binomial.
  • بڕیار بدەیت کە بارودۆخێک دووڕادەییە یان نا (nnـی جێگیر، دوو ، هەمان pp، سەربەخۆ).
  • دووڕادەیی بە (nx)pxqn−x\binom{n}{x}p^x q^{n-x} و بژمێریت.
  • μ=np\mu = np، σ2=npq\sigma^2 = npq و σ=npq\sigma = \sqrt{npq} بەکاربهێنیت و شێوەکە بۆ ppـی جیاواز وەسف بکەیت.
  • ڕوون بکەیتەوە کەی دەرهێنان نەک دووڕادەیی.

Trials with two outcomesکارە هەڕەمەکییەکان بە دوو ئەنجام

Many random experiments have only two outcomes that matter to us. A penalty kick is a goal or a miss. A coin shows heads or not. A die shows a six or not. A light bulb from a factory works or is faulty. Call the outcome you are counting a success and the other a failure, even when the "success" is a faulty bulb.

زۆر تەنها دوو هەیە کە بۆمان گرنگن. لێدانی پەنالتی یان گۆڵە یان نا. دراو یان شێر نیشان دەدات یان نا. بەردەزار یان 6 نیشان دەدات یان نا. گڵۆپێکی کارگە یان کار دەکات یان تێکچووە. ئەو دەیژمێریت ناوی بنێ سەرکەوتن و ئەوی تر شکست، تەنانەت گەر «سەرکەوتن»ەکە گڵۆپێکی تێکچوو بێت.

One such trial is a Bernoulli trial. Its success probability is written pp and its failure probability q=1−pq = 1 - p. If you write 1 for a success and 0 for a failure, you get the simplest random variable there is:

یەک کاری لەم جۆرە . سەرکەوتنەکەی بە pp دەنووسرێت و شکستەکەی بە q=1−pq = 1 - p. گەر بۆ سەرکەوتن 1 و بۆ شکست 0 بنووسیت، سادەترین بەدەست دێت کە هەیە:

Definitionپێناسە

A with only two outcomes, “success” (probability pp) and “failure” (q=1−pq = 1 - p).

کە تەنها دوو ئەنجامی هەیە: «سەرکەوتن» (ئەگەری pp) و «شکست» (q=1−pq = 1 - p).

One Bernoulli trial: mean pp, variance p−p2=pqp - p^2 = pqیەک : pp، p−p2=pqp - p^2 = pq
xxP(x)P(x)x P(x)x\,P(x)x2P(x)x^2 P(x)
00q=1−pq = 1 - p0000
11pppppp
Sumکۆ11E(X)=pE(X) = pE(X2)=pE(X^2) = p

So one trial has mean pp and, by the shortcut for the variance, variance p−p2=pqp - p^2 = pq. For a penalty taker who scores 80% of the time, p=0.8p = 0.8, q=0.2q = 0.2, mean 0.8 goals per kick and variance 0.8×0.2=0.160.8 \times 0.2 = 0.16.

کەواتە یەک کار ppـە و بە ڕێگا کورتەکەی لێکنەچوون p−p2=pqp - p^2 = pqـە. بۆ یاریزانێک کە لە ⁦80%⁩ی پەنالتییەکاندا گۆڵ دەکات، p=0.8p = 0.8، q=0.2q = 0.2، ⁦0.8⁩ گۆڵ بۆ هەر لێدانێک و 0.8×0.2=0.160.8 \times 0.2 = 0.16.

Quick checkپشکنینی خێراA fair die is rolled once and "success" means a six. What are pp and qq?بەردەزارێکی دادپەروەر یەک جار فڕێ دەدرێت و «سەرکەوتن» واتە 6. pp و qq چەندن؟

Counting successes: the binomial settingژماردنی سەرکەوتنەکان: بارودۆخی دووڕادەیی

Now repeat the trial nn times and count the successes. The count X follows the binomial distribution when four conditions hold:

ئێستا کارەکە nn جار دووبارە بکەرەوە و سەرکەوتنەکان بژمێرە. ژمارەی X هەیە کاتێک ئەم چوار مەرجە هەبن:

  1. A fixed number nn of trials, decided before you start.
  2. Two outcomes in each trial: success or failure.
  3. The same pp in every trial.
  4. Independent trials: one result does not change the chances of another.
  1. ژمارەیەکی جێگیری nn کار، کە پێش دەستپێکردن دیاری کراوە.
  2. دوو لە هەر کارێکدا: سەرکەوتن یان شکست.
  3. هەمان pp لە هەموو کارێکدا.
  4. کاری سەربەخۆ: ئەنجامی یەکێکیان چانسی ئەوی تر ناگۆڕێت.

Then we write X∼B(n,p)X \sim B(n, p), read "X is binomial with nn trials and success probability pp". The values of X are 0,1,2,…,n0, 1, 2, \dots, n. The name binomial ("two terms") comes from the two outcomes, and from the binomial coefficients in its formula.

پاشان دەنووسین X∼B(n,p)X \sim B(n, p)، بەم شێوەیە دەخوێنرێتەوە: «X هەیە بە nn کار و سەرکەوتنی pp». نرخەکانی X بریتین لە 0,1,2,…,n0, 1, 2, \dots, n. ناوی «دووڕادەیی» لە دوو دێت و لە هاوکۆلکە دووڕادەییەکانی ناو فۆرمولەکەی.

Quick checkپشکنینی خێراWhich of these counts is binomial?کام لەم ژماردنانە دووڕادەییە؟

A binomial model for penaltiesمۆدێلێکی دووڕادەیی بۆ پەنالتی

Penalties at the end of a matchپەنالتییەکانی کۆتایی یاری

A player takes 5 penalties in training. Each kick is a goal or a miss (two outcomes), he always takes exactly 5 (fixed n), he is equally good every time (same p=0.8p = 0.8), and one kick does not affect the next (independent). The number of goals is B(5,0.8)B(5, 0.8).

یاریزانێک لە ڕاهێناندا 5 پەنالتی لێ دەدات. هەر لێدانێک یان گۆڵە یان نا (دوو )، هەمیشە ڕێک 5 لێدەدات (nnـی جێگیر)، هەموو جارێک بە هەمان ئاست باشە (هەمان p=0.8p = 0.8) و لێدانێک کار لە لێدانی داهاتوو ناکات (سەربەخۆ). ژمارەی گۆڵەکان B(5,0.8)B(5, 0.8)ـە.

Where the analogy stops workingسنووری ئەم نموونەیە

Real players get tired or nervous, so pp may change from kick to kick. The binomial model is an idealisation; it works well when those effects are small.

یاریزانی ڕاستەقینە ماندوو یان دڵەڕاوکێ دەبێت، بۆیە لەوانەیە pp لە لێدانێکەوە بۆ لێدانێکی تر بگۆڕێت. مۆدێلی دووڕادەیی وێنەیەکی ئایدیاڵە؛ کاتێک ئەو کاریگەرییانە بچووکن باش کار دەکات.

Quick checkپشکنینی خێراWhich binomial condition is the weakest for a real penalty taker?کام مەرجی دووڕادەیی بۆ لێدەری پەنالتیی ڕاستەقینە لاوازترە؟

The binomial formulaفۆرمولەی دووڕادەیی

What is the chance that the player scores exactly 4 of the 5 penalties? One way is goal, goal, goal, goal, miss. Because the kicks are independent, its probability is a product: 0.8×0.8×0.8×0.8×0.2=0.84×0.2=0.081920.8 \times 0.8 \times 0.8 \times 0.8 \times 0.2 = 0.8^4 \times 0.2 = 0.08192. But the miss can be any one of the 5 kicks:

چانسی ئەوە چەندە کە یاریزانەکە ڕێک 4 لە 5 پەنالتییەکە بکاتە گۆڵ؟ یەک ڕێگا ئەمەیە: گۆڵ، گۆڵ، گۆڵ، گۆڵ، بەفیڕۆچوون. لەبەر ئەوەی لێدانەکان سەربەخۆن، لێکدانە: 0.8×0.8×0.8×0.8×0.2=0.84×0.2=0.081920.8 \times 0.8 \times 0.8 \times 0.8 \times 0.2 = 0.8^4 \times 0.2 = 0.08192. بەڵام لێدانە بەفیڕۆچووەکە دەکرێت هەر یەکێک لە 5 لێدانەکە بێت:

Five rows of five circles. In each row four circles hold a tick (goal) and one holds a cross (miss); the cross moves from kick 1 in the first row to kick 5 in the last row. Next to every row: 0.8 × 0.8 × 0.8 × 0.8 × 0.2 = 0.08192. Below: C(5, 4) = 5 and 5 × 0.08192 = 0.4096.پێنج ڕیز، هەر ڕیزێک پێنج بازنە. لە هەر ڕیزێکدا چوار بازنە نیشانەی ✓ (گۆڵ) و یەکێک ✗ (بەفیڕۆچوون)ی تێدایە؛ ✗ لە ڕیزی یەکەمدا لە لێدانی 1ـە و لە دوایین ڕیزدا لە لێدانی 5. لە تەنیشت هەر ڕیزێک: 0.8 × 0.8 × 0.8 × 0.8 × 0.2 = 0.08192. لە خوارەوە: C(5, 4) = 5 و 5 × 0.08192 = 0.4096.
Every order of 4 goals and 1 miss has the same probability; there are (54)=5\binom54 = 5 orders.هەموو ڕیزبەندییەکی 4 گۆڵ و 1 بەفیڕۆچوون هەمان هەیە؛ (54)=5\binom54 = 5 ڕیزبەندی هەیە.CêIT

Each order has the same probability, and the number of orders is the number of ways to choose which 4 kicks are goals, (54)=5\binom54 = 5. So P(X=4)=5×0.08192=0.4096P(X = 4) = 5 \times 0.08192 = 0.4096. The same reasoning for any nn, pp and xx gives the binomial formula:

هەموو ڕیزبەندییەک هەمان هەیە و ژمارەی ڕیزبەندییەکان ژمارەی ڕێگاکانی هەڵبژاردنی ئەو 4 لێدانەیە کە گۆڵن، (54)=5\binom54 = 5. کەواتە P(X=4)=5×0.08192=0.4096P(X = 4) = 5 \times 0.08192 = 0.4096. هەمان بیرکردنەوە بۆ هەر nn، pp و xx فۆرمولەی دووڕادەیی دەدات:

P(X=x)=(nx) px q n−x,x=0,1,…,n,q=1−pP(X = x) = \binom{n}{x}\,p^{x}\,q^{\,n-x}, \qquad x = 0, 1, \dots, n, \qquad q = 1 - p

pxqn−xp^x q^{n-x}: the probability of one particular order with xx successes. (nx)\binom{n}{x}: how many such orders there are.

pxqn−xp^x q^{n-x}: یەک ڕیزبەندیی دیاریکراو بە xx سەرکەوتن. (nx)\binom{n}{x}: چەند ڕیزبەندیی لەو جۆرە هەیە.

The probabilities add up to 1, because by the binomial theorem ∑x=0n(nx)pxqn−x=(p+q)n=1n=1\sum_{x=0}^{n} \binom{n}{x} p^x q^{n-x} = (p + q)^n = 1^n = 1. The coefficients (nx)\binom{n}{x} are the rows of Pascal's triangle: 1, 5, 10, 10, 5, 1 for n=5n = 5.

کۆی 1ـە، چونکە بە دووڕادەیی ∑x=0n(nx)pxqn−x=(p+q)n=1n=1\sum_{x=0}^{n} \binom{n}{x} p^x q^{n-x} = (p + q)^n = 1^n = 1. (nx)\binom{n}{x} ڕیزەکانی سێگۆشەی پاسکاڵـن: بۆ n=5n = 5، 1، 5، ⁦10⁩، ⁦10⁩، 5، 1.

Quick checkپشکنینی خێراSame player, 5 penalties, p=0.8p = 0.8. What is the probability that all 5 are goals?هەمان یاریزان، 5 پەنالتی، p=0.8p = 0.8. ئەوە چەندە کە هەر 5ـیان گۆڵ بن؟

Overexplaining the binomial distributionPrimer · Englishئینگلیزی · 1.6M viewsبینین · 60K likesلایک

Builds the binomial formula from coin flips: list the orders, multiply the probabilities, count the orders with Pascal's triangle and n choose k.

لە هەڵدانی دراوەوە دروست دەکات: ڕیزبەندییەکان بنووسە، لێک بدە، ڕیزبەندییەکان بە و (nk)\binom{n}{k} بژمێرە.

Whole video: small cases by hand (0:41), independence (5:54), Pascal's triangle (6:50), the binomial coefficient (9:03) and a simulation check (13:27).

هەموو ڤیدیۆکە: حاڵەتی بچووک بە دەست ⁦(0:41)⁩، ⁦(5:54)⁩، ⁦(6:50)⁩، ⁦(9:03)⁩ و پشکنین بە لاساییکردنەوە ⁦(13:27)⁩.

Coins: the course's pmfs were binomialدراوەکان: نەخشەی بارستەی ئەگەری کۆرسەکە دووڕادەیی بوو

You have met binomial distributions already. The number of heads in two fair coins (14,24,14\tfrac14, \tfrac24, \tfrac14) is B(2,12)B(2, \tfrac12), and in three coins (18,38,38,18\tfrac18, \tfrac38, \tfrac38, \tfrac18) it is B(3,12)B(3, \tfrac12). The homework pmf P(x)=0.75x! (3−x)!P(x) = \frac{0.75}{x!\,(3-x)!} in Random Variables is the same B(3,12)B(3, \tfrac12) in disguise:

پێشتر بینیوە. ژمارەی شێرەکان لە دوو دراوی دادپەروەردا (14,24,14\tfrac14, \tfrac24, \tfrac14) B(2,12)B(2, \tfrac12)ـە و لە سێ دراودا (18,38,38,18\tfrac18, \tfrac38, \tfrac38, \tfrac18) B(3,12)B(3, \tfrac12)ـە. ئەرکی ماڵەوە P(x)=0.75x! (3−x)!P(x) = \frac{0.75}{x!\,(3-x)!} لە گۆڕاوە هەڕەمەکییەکان هەمان B(3,12)B(3, \tfrac12)ـە بە شێوەیەکی تر:

(3x)(12)x(12)3−x=3!x! (3−x)!⋅18=6/8x! (3−x)!=0.75x! (3−x)!\binom{3}{x}\left(\tfrac12\right)^{x}\left(\tfrac12\right)^{3-x} = \frac{3!}{x!\,(3-x)!}\cdot\frac18 = \frac{6/8}{x!\,(3-x)!} = \frac{0.75}{x!\,(3-x)!}

With p=q=12p = q = \tfrac12 every order has probability (12)3=18(\tfrac12)^3 = \tfrac18, and 3!×18=0.753! \times \tfrac18 = 0.75.

بە p=q=12p = q = \tfrac12 هەموو ڕیزبەندییەک (12)3=18(\tfrac12)^3 = \tfrac18ـە و 3!×18=0.753! \times \tfrac18 = 0.75.

With 10 coins the shape becomes clearer. The (10x)\binom{10}{x} ways are the 11th row of Pascal's triangle, each divided by 210=10242^{10} = 1024:

بە ⁦10⁩ دراو شێوەکە ڕوونتر دەبێت. (10x)\binom{10}{x} ڕێگاکان ڕیزی ⁦11⁩ی ، هەریەکە دابەش بە 210=10242^{10} = 1024:

A bar chart of the number of heads in 10 fair coin tosses, x from 0 to 10. The bars are symmetric around 5. Their counts out of 1024 are 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1. The tallest bar is at 5 with probability 252/1024, about 0.246.هێڵکارییەکی ستوونی بۆ ژمارەی شێرەکان لە 10 جار هەڵدانی دراوێکی دادپەروەر، x لە 0 تا 10. ستوونەکان لە دەوری 5 هاوجێن. ژمارەکانیان لە 1024: 1، 10، 45، 120، 210، 252، 210، 120، 45، 10، 1. بەرزترین ستوون لە 5ـە بە ئەگەری 252/1024، نزیکەی 0.246.
B(10,0.5)B(10, 0.5): symmetric, with its peak at 5. Exactly 5 heads happens only about one time in four.B(10,0.5)B(10, 0.5): هاوجێیە و لووتکەکەی لە 5ـە. ڕێک 5 شێر تەنها نزیکەی یەک جار لە چوار جار ڕوو دەدات.CêIT
Quick checkپشکنینی خێراToss 10 fair coins. What is the probability of 4, 5 or 6 heads?⁦10⁩ دراوی دادپەروەر هەڵبدە. 4، 5 یان 6 شێر چەندە؟

How the shape depends on ppشێوەکە چۆن پشت بە pp دەبەستێت

Keep n=10n = 10 and change the success probability from 0.1 to 0.9. Watch the bars move:

n=10n = 10 وەک خۆی بهێڵەرەوە و سەرکەوتن لە ⁦0.1⁩ـەوە بۆ ⁦0.9⁩ بگۆڕە. سەیری جووڵەی ستوونەکان بکە:

Animation in nine frames: the bar chart of B(10, p) for p = 0.1, 0.2, up to 0.9. At p = 0.1 the tallest bars are at 0 and 1 and a long tail runs to the right. As p grows the bars slide right; at p = 0.5 they are symmetric around 5; at p = 0.9 the tallest bars are at 9 and 10 with a tail to the left. A triangle under the axis marks the mean np, and the text shows μ = np and σ = √(npq), largest (1.58) at p = 0.5.
Animation in nine frames: the bar chart of B(10, p) for p = 0.1, 0.2, up to 0.9. At p = 0.1 the tallest bars are at 0 and 1 and a long tail runs to the right. As p grows the bars slide right; at p = 0.5 they are symmetric around 5; at p = 0.9 the tallest bars are at 9 and 10 with a tail to the left. A triangle under the axis marks the mean np, and the text shows μ = np and σ = √(npq), largest (1.58) at p = 0.5.
B(10,p)B(10, p) as pp goes from 0.1 to 0.9: right-skewed, then symmetric, then left-skewed. The mean npnp moves with pp.B(10,p)B(10, p) کاتێک pp لە ⁦0.1⁩ـەوە بۆ ⁦0.9⁩ دەچێت: لار بەرەو ڕاست، پاشان هاوجێ، پاشان لار بەرەو چەپ. npnp لەگەڵ pp دەجووڵێت.CêIT
  • p<0.5p < 0.5: most bars are on the left and the tail points right (positive skewness).
  • p=0.5p = 0.5: the bars are symmetric around n/2n/2.
  • p>0.5p > 0.5: the mirror image. Counting failures instead of successes turns B(10,0.8)B(10, 0.8) into B(10,0.2)B(10, 0.2).
  • The tallest bar is always near the mean npnp.
  • p<0.5p < 0.5: زۆربەی ستوونەکان لە چەپن و کلکەکە بەرەو ڕاستە (ناهاوجێبوونی موجەب).
  • p=0.5p = 0.5: ستوونەکان لە دەوری n/2n/2 هاوجێن.
  • p>0.5p > 0.5: وێنەی ئاوێنەیی. ژماردنی شکستەکان لە جیاتی سەرکەوتنەکان B(10,0.8)B(10, 0.8) دەکات بە B(10,0.2)B(10, 0.2).
  • بەرزترین ستوون هەمیشە لە نزیک npnpـە.
Quick checkپشکنینی خێراFor B(10,0.3)B(10, 0.3), where is the tallest bar?بۆ B(10,0.3)B(10, 0.3)، بەرزترین ستوون لە کوێیە؟

Mean npnp and variance npqnpqناوەندی npnp و لێکنەچوونی npqnpq

You could find the mean of B(n,p)B(n, p) by adding x P(x)x\,P(x) over n+1n + 1 values. There is a much shorter way. X is a sum of nn Bernoulli variables, one per trial (1 for a success, 0 for a failure). Each has mean pp and variance pqpq, so:

دەتوانیت B(n,p)B(n, p) بە کۆکردنەوەی x P(x)x\,P(x) بەسەر n+1n + 1 نرخدا بدۆزیتەوە. ڕێگایەکی زۆر کورتتر هەیە. XX کۆی nn گۆڕاوی بێرنۆلییە، یەک بۆ هەر کارێک (⁦1⁩ بۆ سەرکەوتن، 0 بۆ شکست). هەریەکەیان pp و pqpqـی هەیە، بۆیە:

μ=E(X)=np,σ2=Var⁡(X)=npq,σ=npq\mu = E(X) = np, \qquad \sigma^2 = \operatorname{Var}(X) = npq, \qquad \sigma = \sqrt{npq}

Means always add (rule 3 of expectation). Variances add because the trials are independent (variance rules).

هەمیشە کۆ دەکرێنەوە (یاسای 3ی نرخی پێشبینیکراو). کۆ دەکرێتەوە چونکە کارەکان سەربەخۆن (یاساکانی لێکنەچوون).

Mean and spread of some binomial counts و بڵاوبوونەوەی چەند ژماردنێکی دووڕادەیی
Situationبارودۆخn, pn,\ pμ=np\mu = npσ2=npq\sigma^2 = npqσ\sigma
Heads in 3 fair coinsشێر لە 3 دراوی دادپەروەردا3, 0.53,\ 0.51.51.50.750.750.8660.866
Goals from 5 penaltiesگۆڵ لە 5 پەنالتیدا5, 0.85,\ 0.8440.80.80.8940.894
Right answers when guessing 10 questions with 4 optionsوەڵامی ڕاست کاتێک تەخمینی ⁦10⁩ پرسیاری 4 وەڵامی دەکەیت10, 0.2510,\ 0.252.52.51.8751.8751.3691.369
Heads in 10 fair coinsشێر لە ⁦10⁩ دراوی دادپەروەردا10, 0.510,\ 0.5552.52.51.5811.581

Check the first row the long way: E(X)=0⋅18+1⋅38+2⋅38+3⋅18=128=1.5=3×0.5E(X) = 0\cdot\tfrac18 + 1\cdot\tfrac38 + 2\cdot\tfrac38 + 3\cdot\tfrac18 = \tfrac{12}{8} = 1.5 = 3 \times 0.5.

ڕیزی یەکەم بە ڕێگا درێژەکە بپشکنە: E(X)=0⋅18+1⋅38+2⋅38+3⋅18=128=1.5=3×0.5E(X) = 0\cdot\tfrac18 + 1\cdot\tfrac38 + 2\cdot\tfrac38 + 3\cdot\tfrac18 = \tfrac{12}{8} = 1.5 = 3 \times 0.5.

Quick checkپشکنینی خێراA factory makes bulbs with 5% faulty. A box holds 20 bulbs (independent). What are the mean and standard deviation of the number of faulty bulbs?کارگەیەک گڵۆپ دروست دەکات کە ⁦5%⁩یان تێکچوون. سندووقێک ⁦20⁩ گڵۆپی تێدایە (سەربەخۆ). و ژمارەی گڵۆپە تێکچووەکان چەندە؟

"At least" and "at most"«لانیکەم» و «لانیزۆر»

Questions often ask about several values at once. Add their bars, or, when that is long, use the complement rule: P(X≥1)=1−P(X=0)P(X \ge 1) = 1 - P(X = 0).

پرسیارەکان زۆر جار چەند نرخێکی پێکەوە داوا دەکەن. ستوونەکانی ئەو نرخانە کۆ بکەرەوە، یان کاتێک درێژە، یاسای تەواوکەر بەکاربهێنە: P(X≥1)=1−P(X=0)P(X \ge 1) = 1 - P(X = 0).

  1. Guessing a whole testتەخمینکردنی تاقیکردنەوەیەکی تەواو

    A test has 10 questions with 4 options each; Dilan guesses every answer, so X∼B(10,0.25)X \sim B(10, 0.25). To pass she needs at least 5 right:

    تاقیکردنەوەیەک ⁦10⁩ پرسیاری هەیە، هەریەکە 4 وەڵام؛ دیلان هەموو وەڵامەکان تەخمین دەکات، بۆیە X∼B(10,0.25)X \sim B(10, 0.25). بۆ دەرچوون لانیکەم 5 وەڵامی ڕاستی پێویستە:

    P(X≥5)=P(5)+P(6)+⋯+P(10)≈0.0584+0.0162+0.0031+0.0004+0.0000+0.0000≈0.078P(X \ge 5) = P(5) + P(6) + \cdots + P(10) \approx 0.0584 + 0.0162 + 0.0031 + 0.0004 + 0.0000 + 0.0000 \approx 0.078
  2. At least one six in four rollsلانیکەم یەک 6 لە چوار فڕێداندا

    Roll a die 4 times: X∼B(4,16)X \sim B(4, \tfrac16). "At least one" is everything except "none":

    بەردەزارێک 4 جار فڕێ بدە: X∼B(4,16)X \sim B(4, \tfrac16). «لانیکەم یەک» هەموو شتێکە جگە لە «هیچ»:

    P(X≥1)=1−(56)4=1−6251296=6711296≈0.518P(X \ge 1) = 1 - \left(\tfrac56\right)^4 = 1 - \tfrac{625}{1296} = \tfrac{671}{1296} \approx 0.518
  3. A box of bulbsسندووقێکی گڵۆپ

    20 bulbs, each faulty with probability 0.05: X∼B(20,0.05)X \sim B(20, 0.05). A shop accepts the box if at most one bulb is faulty:

    ⁦20⁩ گڵۆپ، هەریەکە بە ⁦0.05⁩ تێکچووە: X∼B(20,0.05)X \sim B(20, 0.05). دوکانێک سندووقەکە قبووڵ دەکات گەر لانیزۆر یەک گڵۆپ تێکچوو بێت:

    P(X≤1)=0.9520+20(0.05)(0.95)19≈0.3585+0.3774=0.7358P(X \le 1) = 0.95^{20} + 20(0.05)(0.95)^{19} \approx 0.3585 + 0.3774 = 0.7358
Quick checkپشکنینی خێراWith X∼B(10,0.25)X \sim B(10, 0.25), what is the chance of getting at least one answer right by guessing?بە X∼B(10,0.25)X \sim B(10, 0.25)، چانسی ئەوە چەندە کە بە تەخمین لانیکەم یەک وەڵام ڕاست بێت؟

Binomial Distribution EXPLAINED in UNDER 15 MINUTES!zedstatistics · Englishئینگلیزی · 386K viewsبینین · 7.6K likesلایک · Partبەشی 2:36–8:56 (ofلە 13:29)

A worked binomial example by hand: 10 men, 8% colour-blind; exactly 2, none, all, and at least 2 of them.

نموونەیەکی بە دەست: ⁦10⁩ پیاو، ⁦8%⁩ـیان کوێری ڕەنگن؛ ڕێک 2، هیچیان، هەموویان و لانیکەم 2 لەوان.

Chapter 'Calculating by hand' (2:36-8:56): (a) all 10, (b) none, (c) exactly 2, (d) at least 2.

بەشی «ژماردن بە دەست» (⁦2:36⁩ تا ⁦8:56): (a⁩) هەر ⁦10⁩ کەسەکە، ⁦(b)⁩ هیچیان، ⁦(c)⁩ ڕێک 2، ⁦(d)⁩ لانیکەم 2.

The binomial distribution in Pythonدابەشبوونی دووڕادەیی لە Pythonـدا

math.comb(n, x) gives (nx)\binom{n}{x}, so the whole formula fits in one line. This program prints the guessing-test distribution and checks the mean against npnp:

math.comb(n, x) ژمارەی (nx)\binom{n}{x} دەدات، بۆیە هەموو فۆرمولەکە لە یەک دێڕدا جێی دەبێتەوە. ئەم دابەشبوونی تاقیکردنەوەی تەخمین چاپ دەکات و لەگەڵ npnp بەراورد دەکات:

Binomial probabilities for a guessed testئەگەرەکانی دووڕادەیی بۆ تاقیکردنەوەیەکی تەخمینکراوbinomial.pyPYTHONType in a terminalلە تێرمیناڵدا بینووسە
from math import comb

def binom_pmf(x, n, p):
    """P(X = x) when X ~ B(n, p)."""
    return comb(n, x) * p**x * (1 - p)**(n - x)

n, p = 10, 0.25            # 10 questions, 4 options each, pure guessing
probs = [binom_pmf(x, n, p) for x in range(n + 1)]
for x, pr in enumerate(probs):
    print(f"P(X = {x:2}) = {pr:.4f}")

print("sum of P(x) =", round(sum(probs), 10))
print("mean        =", round(sum(x * pr for x, pr in enumerate(probs)), 10), "  np  =", n * p)
print("P(X >= 5)   =", round(sum(probs[5:]), 4))
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 3-5

The binomial formula: (nx)px(1−p)n−x\binom{n}{x} p^x (1 - p)^{n-x}.

فۆرمولەی دووڕادەیی: (nx)px(1−p)n−x\binom{n}{x} p^x (1 - p)^{n-x}.

Lineدێڕی 8

A list comprehension builds all n+1n + 1 probabilities at once.

لیستێک هەموو n+1n + 1 پێکەوە دروست دەکات.

Lineدێڕی 12-14

Checks: the probabilities total 1, the mean equals npnp, and the tail from 5 upwards is about 0.078.

پشکنینەکان: کۆی 1ـە، یەکسانە بە npnp و کلکەکە لە 5 بەرەو سەرەوە نزیکەی ⁦0.078⁩ـە.

Putting back or not: binomial vs hypergeometricگەڕاندنەوە یان نا: دووڕادەیی بەرامبەر هایپەرجیۆمەتری

Go back to H.W 10: a box of 12 items, 3 defective, and you take 3. The course takes them without replacement, so X is hypergeometric. If you put each item back before the next draw, every draw has the same p=312=14p = \tfrac{3}{12} = \tfrac14 and the draws are independent: then X∼B(3,14)X \sim B(3, \tfrac14).

بگەڕێوە بۆ ئەرکی ماڵەوەی ⁦10⁩: سندووقێکی ⁦12⁩ کەرەستە کە 3یان بێکەڵکن و 3 دانە دەردەهێنیت. کۆرسەکە دەریان دەهێنێت، بۆیە X . گەر هەر کەرەستەیەک پێش دەرهێنانی داهاتوو بگەڕێنیتەوە، هەموو دەرهێنانێک هەمان p=312=14p = \tfrac{3}{12} = \tfrac14ـی هەیە و دەرهێنانەکان سەربەخۆن: ئەو کاتە X∼B(3,14)X \sim B(3, \tfrac14).

The defective-items box, both waysسندووقی کەرەستە بێکەڵکەکان، بە هەردوو ڕێگا
xxWithout replacement (hypergeometric) ()With replacement (binomial) (دووڕادەیی)
0084220=0.3818\tfrac{84}{220} = 0.38182764=0.4219\tfrac{27}{64} = 0.4219
11108220=0.4909\tfrac{108}{220} = 0.49092764=0.4219\tfrac{27}{64} = 0.4219
2227220=0.1227\tfrac{27}{220} = 0.1227964=0.1406\tfrac{9}{64} = 0.1406
331220=0.0045\tfrac{1}{220} = 0.0045164=0.0156\tfrac{1}{64} = 0.0156
Mean0.750.750.750.75
Variance81176≈0.460\tfrac{81}{176} \approx 0.460916=0.5625\tfrac{9}{16} = 0.5625

The means agree, 3×14=0.753 \times \tfrac14 = 0.75, because each single draw is defective with probability 14\tfrac14 either way. The spread does not: without replacement the box "remembers" what is gone, extreme results become less likely and the variance is smaller. When the box is huge compared with the sample the difference disappears. With 1,200 items of which 300 are defective, taking 3 without replacement gives 0.4215, 0.4225, 0.1405, 0.0155, almost the binomial 0.4219, 0.4219, 0.1406, 0.0156.

یەک دەگرنەوە، 3×14=0.753 \times \tfrac14 = 0.75، چونکە هەر دەرهێنانێک بە تەنها بە هەردوو ڕێگا بە 14\tfrac14 بێکەڵکە. بڵاوبوونەوە یەک ناگرێتەوە: سندووقەکە «لەبیری دەمێنێت» چی ڕۆیشتووە، ئەنجامە توندەکان کەمتر دەبێت و بچووکترە. کاتێک سندووقەکە بە بەراورد بە نموونەکە زۆر گەورەیە، جیاوازییەکە نامێنێت. بە ⁦1,200⁩ کەرەستە کە ⁦300⁩یان بێکەڵکن، دەرهێنانی 3 دانە دەدات ⁦0.4215⁩، ⁦0.4225⁩، ⁦0.1405⁩، ⁦0.0155⁩، نزیکەی هەمان ژمارەکانی دووڕادەیی ⁦0.4219⁩، ⁦0.4219⁩، ⁦0.1406⁩، ⁦0.0156⁩.

Quick checkپشکنینی خێراWhy is the number of defective items in H.W 10 not binomial?بۆچی ژمارەی کەرەستە بێکەڵکەکان لە ئەرکی ماڵەوەی ⁦10⁩ دووڕادەیی نییە؟

Common mistakesهەڵە باوەکان

MistakeهەڵەWhy it is wrongبۆچی هەڵەیەCorrectڕاست
Forgetting (nx)\binom{n}{x}لەبیرکردنی (nx)\binom{n}{x}pxqn−xp^x q^{n-x} is one order onlypxqn−xp^x q^{n-x} تەنها یەک ڕیزبەندییە(nx)pxqn−x\binom{n}{x}p^x q^{n-x}
Using the binomial without replacementبەکارهێنانی دووڕادەیی pp changes, draws are dependentpp دەگۆڕێت، دەرهێنانەکان سەربەخۆ نینHypergeometric (unless the population is huge) (مەگەر زۆر گەورە بێت)
Thinking two outcomes means p=12p = \tfrac12وابزانیت دوو واتە p=12p = \tfrac12A six on a die has p=16p = \tfrac16بۆ 6 لە بەردەزاردا p=16p = \tfrac16ـەFind pp from the situationpp لە بارودۆخەکەوە بدۆزەرەوە
Writing σ=npq\sigma = npqنووسینی σ=npq\sigma = npqnpqnpq is the variancenpqnpq σ=npq\sigma = \sqrt{npq}
Adding the bars for "at least one"کۆکردنەوەی ستوونەکان بۆ «لانیکەم یەک»Slow and easy to miss a termهێواشە و ئاسانە بەشێک لەبیر بچێت1−P(X=0)1 - P(X = 0)
Treating x>nx > n as possiblex>nx > n وەک شتێکی ڕوودەرYou cannot have more successes than trialsناتوانیت لە ژمارەی کارەکان زیاتر سەرکەوتنت هەبێتx=0,1,…,nx = 0, 1, \dots, n
Quick checkپشکنینی خێراKarwan says: "The chance of exactly 2 heads in 4 coin tosses is 0.52×0.52=0.06250.5^2 \times 0.5^2 = 0.0625." What did he forget?کاروان دەڵێت: «چانسی ڕێک 2 شێر لە 4 هەڵدانی دراودا 0.52×0.52=0.06250.5^2 \times 0.5^2 = 0.0625ـە.» چی لەبیر کرد؟

Exercisesڕاهێنانەکان

ExerciseڕاهێنانBinomial or not?دووڕادەییە یان نا؟

Which of these are binomial? (a) The number of goals from 8 penalties, p=0.7p = 0.7 each, independent. (b) The number of cards drawn from a deck until the first ace. (c) The number of red cards among 5 cards dealt from one deck. (d) The number of sixes in 12 rolls of a die.

کامیان دووڕادەیین؟ (أ) ژمارەی گۆڵەکان لە 8 پەنالتیدا، هەریەکە p=0.7p = 0.7، سەربەخۆ. (ب) ژمارەی ئەو کارتانەی لە دەستەیەک دەردەهێنرێن تا یەکەم ئاس. (ج) ژمارەی کارتە سوورەکان لە 5 کارتدا کە لە یەک دەستە دابەش دەکرێن. (د) ژمارەی 6ـەکان لە ⁦12⁩ فڕێدانی بەردەزاردا.

Show answerوەڵامەکە پیشان بدە
  • (a) Yes: B(8,0.7)B(8, 0.7).
  • (b) No: the number of trials is not fixed.
  • (c) No: dealing is without replacement (hypergeometric).
  • (d) Yes: B(12,16)B(12, \tfrac16).
  • (أ) بەڵێ: B(8,0.7)B(8, 0.7).
  • (ب) نەخێر: ژمارەی کارەکان جێگیر نییە.
  • (ج) نەخێر: دابەشکردن ().
  • (د) بەڵێ: B(12,16)B(12, \tfrac16).
ExerciseڕاهێنانPenalties againدیسان پەنالتی

For 5 penalties with p=0.8p = 0.8, find P(X≥4)P(X \ge 4) and P(X≤3)P(X \le 3).

بۆ 5 پەنالتی بە p=0.8p = 0.8، P(X≥4)P(X \ge 4) و P(X≤3)P(X \le 3) بدۆزەرەوە.

Show answerوەڵامەکە پیشان بدە
P(X≥4)=0.4096+0.32768=0.73728,P(X≤3)=1−0.73728=0.26272P(X \ge 4) = 0.4096 + 0.32768 = 0.73728, \qquad P(X \le 3) = 1 - 0.73728 = 0.26272
ExerciseڕاهێنانSixes in four rolls6 لە چوار فڕێداندا

Write the whole distribution of the number of sixes in 4 rolls of a fair die, and its mean and variance.

هەموو دابەشبوونی ژمارەی 6ـەکان لە 4 فڕێدانی بەردەزارێکی دادپەروەردا بنووسە، لەگەڵ و .

Hintئاماژە

Use (4x)(1/6)x(5/6)4−x\binom4x (1/6)^x (5/6)^{4-x}; the numerators are (4x)54−x\binom4x 5^{4-x}.

(4x)(1/6)x(5/6)4−x\binom4x (1/6)^x (5/6)^{4-x} بەکاربهێنە؛ (4x)54−x\binom4x 5^{4-x}ـن.

Show answerوەڵامەکە پیشان بدە
xx0011223344
P(x)P(x)6251296\tfrac{625}{1296}5001296\tfrac{500}{1296}1501296\tfrac{150}{1296}201296\tfrac{20}{1296}11296\tfrac{1}{1296}
μ=4×16=23≈0.667,σ2=4×16×56=59≈0.556\mu = 4 \times \tfrac16 = \tfrac23 \approx 0.667, \qquad \sigma^2 = 4 \times \tfrac16 \times \tfrac56 = \tfrac59 \approx 0.556
ExerciseڕاهێنانA quality checkپشکنینی جۆری

A machine makes 5% faulty bulbs. In a box of 20, what is the probability that more than one bulb is faulty?

ئامێرێک ⁦5%⁩ گڵۆپی تێکچوو دروست دەکات. لە سندووقێکی ⁦20⁩ دانەییدا، ئەوە چەندە کە زیاتر لە یەک گڵۆپ تێکچوو بێت؟

Show answerوەڵامەکە پیشان بدە
P(X>1)=1−P(X≤1)=1−0.7358=0.2642P(X > 1) = 1 - P(X \le 1) = 1 - 0.7358 = 0.2642

Summaryپوختە

  • A Bernoulli trial has two outcomes: success with probability pp, failure with q=1−pq = 1 - p. Mean pp, variance pqpq.
  • Binomial setting: fixed nn, two outcomes, same pp, independent trials. XX is the number of successes, X∼B(n,p)X \sim B(n, p).
  • P(X=x)=(nx)pxqn−xP(X = x) = \binom{n}{x}p^x q^{n-x}: one order's probability times the number of orders.
  • μ=np\mu = np, σ2=npq\sigma^2 = npq, σ=npq\sigma = \sqrt{npq}. Right-skewed for p<12p < \tfrac12, symmetric at p=12p = \tfrac12, left-skewed for p>12p > \tfrac12.
  • "At least one" is 1−P(X=0)1 - P(X = 0). The course's coin pmfs and 0.75/(x!(3−x)!)0.75/(x!(3 - x)!) are B(n,12)B(n, \tfrac12); the defective-items box is hypergeometric (no replacement), with the same mean as B(3,14)B(3, \tfrac14) but a smaller variance.
  • دوو هەیە: سەرکەوتن بە pp، شکست بە q=1−pq = 1 - p. pp، pqpq.
  • بارودۆخی دووڕادەیی: nnـی جێگیر، دوو ، هەمان pp، کاری سەربەخۆ. XX ژمارەی سەرکەوتنەکانە، X∼B(n,p)X \sim B(n, p).
  • P(X=x)=(nx)pxqn−xP(X = x) = \binom{n}{x}p^x q^{n-x}: لێکدانی یەک ڕیزبەندی لە ژمارەی ڕیزبەندییەکان.
  • μ=np\mu = np، σ2=npq\sigma^2 = npq، σ=npq\sigma = \sqrt{npq}. بۆ p<12p < \tfrac12 لار بەرەو ڕاست، لە p=12p = \tfrac12 هاوجێ، بۆ p>12p > \tfrac12 لار بەرەو چەپ.
  • «لانیکەم یەک» دەکاتە 1−P(X=0)1 - P(X = 0). دراوەکانی کۆرسەکە و 0.75/(x!(3−x)!)0.75/(x!(3 - x)!) بریتین لە B(n,12)B(n, \tfrac12)؛ سندووقی کەرەستە بێکەڵکەکان (بێ گەڕاندنەوە)، بە هەمان B(3,14)B(3, \tfrac14) بەڵام بچووکتر.

Next: when nn is large the bars of B(n,p)B(n, p) line up along a smooth bell-shaped curve, the normal distribution.

داهاتوو: کاتێک nn گەورەیە، ستوونەکانی B(n,p)B(n, p) بە درێژایی چەماوەیەکی لووس و زەنگوڵەئاسا ڕیز دەبن، دابەشبوونی ئاسایی.

Videoڤیدیۆ

Watch a videoسەیری ڤیدیۆیەک بکە

A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.

Binomial Distribution EXPLAINED with ExamplesAce Tutors · Englishئینگلیزی · 597K viewsبینین · 12K likesلایک

When a count is binomial (two outcomes, independent trials, fixed n, same p), the binomial formula, and its mean and standard deviation.

کەی ژمارەی سەرکەوتنەکان پەیڕەو دەکات (دوو ، سەربەخۆ، nn جێگیر، هەمان pp)، ، هەروەها و .

Whole video: the idea, the four conditions as 'BINS' (2:12), the formula, and the mean np and standard deviation (7:30).

هەموو ڤیدیۆکە: بیرۆکەکە، چوار مەرجەکە بە ناوی «BINS» ⁦(2:12)⁩، ، هەروەها npnp و ⁦(7:30)⁩.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

The Normal Distribution (Supplementary)دابەشبوونی ئاسایی (زیادە)

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.