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

Random Variables and Probability Mass Functionsگۆڕاوە هەڕەمەکییەکان و نەخشەی بارستەی ئەگەر

A random variable turns outcomes into numbers. Discrete and continuous variables, the probability mass function and its two rules, stem graphs, and the course's coin, x15\frac{x}{15} and factorial examples, including a homework that is not a pmf.

دەکات بە ژمارە. گۆڕاوی پچڕاو و بەردەوام، و دوو یاساکەی، وێنەی ستوونی باریک و نموونەکانی دراو، x15\frac{x}{15} و کۆرسەکە، لەگەڵ ڕاهێنانێک کە نییە.

13 min read14 خولەک خوێندنەوە · 17 stepsهەنگاو

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

  • Explain a random variable as a function from outcomes to numbers.
  • Tell discrete from continuous random variables.
  • Build a pmf from a sample space, check its two rules and draw it as stems.
  • Find probabilities of events by adding pmf values.
  • وەک لە بۆ ژمارە ڕوون بکەیتەوە.
  • لە جیا بکەیتەوە.
  • لە دروست بکەیت، دوو یاساکەی بپشکنیت و وەک ستوونی باریک بیکێشیت.
  • بە کۆکردنەوەی بەهاکانی بدۆزیتەوە.

From outcomes to numbersلە ئەنجامەکانەوە بۆ ژمارە

Toss two coins. The sample space is S={HH,HT,TH,TT}S = \{HH, HT, TH, TT\} (HH: heads, TT: tails). Often we do not care about the exact outcome, only about a number that comes from it: how many heads did we get? Call that number XX. Then HH→2HH \to 2, HT→1HT \to 1, TH→1TH \to 1, TT→0TT \to 0, so XX can be 0, 1 or 2.

دوو دراو هەڵبدە. بریتییە لە S={HH,HT,TH,TT}S = \{HH, HT, TH, TT\} (HH بۆ شێر و TT بۆ خەت). زۆر جار گرنگیمان بە خودی نییە، تەنها بە ژمارەیەک کە لێیەوە دێت: چەند شێرمان هێنا؟ ناوی ئەو ژمارەیە بنێ XX. ئەوسا HH→2HH \to 2، HT→1HT \to 1، TH→1TH \to 1، TT→0TT \to 0، بۆیە XX دەتوانێت 0، 1 یان 2 بێت.

A random variable is exactly this: a rule that gives a real number to every outcome of a random experiment. It is “random” because we do not know the outcome in advance, so we do not know the number either.

ڕێک ئەمەیە: یاسایەک کە دەدات بە هەر . «هەڕەمەکی»ـیە چونکە پێشوەختە نازانین، کەواتە ژمارەکەش نازانین.

Definitionپێناسە

A rule that gives a number to every of a ; it is a from the to the real numbers.

یاسایەکە کە ژمارەیەک دەدات بە هەر ؛ لە بۆ ژمارە ڕاستییەکان.

Quick checkپشکنینی خێراTwo coins are tossed and XX = the number of tails. What is XX for the outcome HTHT?دوو دراو هەڵدەدرێن و XX = ژمارەی خەتەکان. XX بۆ HTHT چەندە؟

From outcomes to numbersلە ئەنجامەکانەوە بۆ ژمارە

Capital XX, small xxXXـی گەورە و xxـی بچووک

Notation: a capital letter (XX) names the random variable; a small letter (xx) is one of its values. X=1X = 1 is an event: “exactly one head”, which is {HT,TH}\{HT, TH\}.

نیشانەکان: پیتی گەورە (XX) ناوی ؛ پیتی بچووک (xx) یەکێکە لە بەهاکانی. X=1X = 1 : «ڕێک یەک شێر»، کە {HT,TH}\{HT, TH\}ـە.

Weighing bags at the bazaarکێشانی توورەکە لە بازاڕدا

A greengrocer fills bags of tomatoes without counting. Each bag is an outcome; the scale turns every bag into one number, its weight. The weight is a random variable: you only know it after the bag is filled and weighed.

سەوزەفرۆشێک توورەکەی تەماتە پڕ دەکات بێ ئەوەی بیانژمێرێت. هەر توورەکەیەک ؛ تەرازووەکە هەر توورەکەیەک دەکات بە یەک ژمارە، کێشەکەی. کێشەکە : تەنها دوای پڕکردن و کێشانی توورەکەکە دەیزانیت.

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

From one experiment you can make many random variables: the weight, the number of tomatoes, the price. Each is a different rule.

لە یەک تاقیکردنەوە دەتوانیت چەندین دروست بکەیت: کێش، ژمارەی تەماتەکان، نرخ. هەر یەکەیان یاسایەکی جیاوازە.

Quick checkپشکنینی خێراThree coins are tossed and XX is the number of heads. Which set of outcomes is the event X=2X = 2?سێ دراو هەڵدەدرێن و XX ژمارەی شێرەکانە. کام X=2X = 2ـە؟

A random variable is a functionگۆڕاوی هەڕەمەکی نەخشەیەکە

Despite its name, a random variable is not a variable and not random: it is a function. Its domain is the sample space and its range is the set of numbers it can give. Every outcome gets exactly one number, but several outcomes may share a number, just as in the definition of a function.

بە پێچەوانەی ناوەکەیەوە، نە و نە هەڕەمەکییە: . و ئەو ژمارانەیە کە دەیاندات. هەموو ڕێک یەک ژمارە وەردەگرێت، بەڵام چەند دەتوانن یەک ژمارە بەش بکەن، ڕێک وەک پێناسەی نەخشە.

Arrow diagram: the eight outcomes of three coin tosses (TTT, HTT, THT, TTH, HHT, HTH, THH, HHH) on the left, each with one arrow to a value of X on the right: TTT to 0; HTT, THT, TTH to 1; HHT, HTH, THH to 2; HHH to 3.هێڵکاریی تیر: هەشت ئەنجامەکەی هەڵدانی سێ دراو (TTT، HTT، THT، TTH، HHT، HTH، THH، HHH) لە چەپ، هەر یەکەیان یەک تیری هەیە بۆ بەهایەکی X لە ڕاست: TTT بۆ 0؛ HTT، THT، TTH بۆ 1؛ HHT، HTH، THH بۆ 2؛ HHH بۆ 3.
Three coins, XX is the number of heads. One arrow leaves every outcome.سێ دراو، XX ژمارەی شێرەکانە. لە هەر یەک تیر دەردەچێت.CêIT

For three coins the domain is the set of 8 outcomes and the range is {0,1,2,3}\{0, 1, 2, 3\}. You can read more about these two sets in Domain, Range and Image.

بۆ سێ دراو هەشت و {0,1,2,3}\{0, 1, 2, 3\}ـە. دەتوانیت لە بوار، مەودا و وێنە زیاتر دەربارەی ئەم دوو بخوێنیتەوە.

Quick checkپشکنینی خێراWhich of these could NOT be a random variable on the three-coin experiment?کامیان ناتوانێت بێت لە سەر تاقیکردنەوەی سێ دراوەکە؟

"A Random Variable is NOT Random and NOT a Variable"Prof Mihai Nica · Englishئینگلیزی · 72K viewsبینین · 3.1K likesلایک · Partبەشی 0:00–8:49 (ofلە 29:03)

Why a random variable is "not random and not a variable": it is a function that gives every outcome (two dice) one number.

بۆچی «نە هەڕەمەکییە و نە »: کە بە هەر (دوو بەردەزار) یەک ژمارە دەدات.

Plays 0:00-8:49: the sum of two dice as a function on the 36 outcomes; each value collects a set of outcomes (an event).

لە ⁦0:00⁩ تا ⁦8:49⁩ پەخش دەبێت: کۆی دوو بەردەزار وەک لەسەر ⁦36⁩ ؛ هەر نرخێک لە کۆ دەکاتەوە ().

Discrete and continuous random variablesگۆڕاوی هەڕەمەکیی پچڕاو و گۆڕاوی هەڕەمەکیی بەردەوام

A discrete random variable takes separate values that you can list (a countable set), usually by counting. The number of children in a family can be 0, 1, 2, 3, … but never 2.5 or 3.421.

بەهای جیاجیا وەردەگرێت کە دەتوانیت لیستیان بکەیت ( ژمێردراو)، بە زۆری بە ژماردن. ژمارەی منداڵانی خێزانێک دەتوانێت 0، 1، 2، 3، … بێت، بەڵام هەرگیز ⁦2.5⁩ یان ⁦3.421⁩ نا.

A continuous random variable can take any value in an interval, usually by measuring. A person's height can be 157 cm, 157.8 cm or 157.83 cm: only the accuracy of the ruler decides how many digits we write.

دەتوانێت هەر بەهایەک لە وەربگرێت، بە زۆری بە پێوان. باڵای کەسێک دەتوانێت ⁦157 cm⁩، ⁦157.8 cm⁩ یان ⁦157.83 cm⁩ بێت: تەنها وردیی پێوەرەکە بڕیار دەدات چەند ژمارە دوای فاریزە بنووسین.

Count or measure?بژمێریت یان بیپێویت؟
Discrete (count)پچڕاو (ژماردن)Continuous (measure)بەردەوام (پێوان)
number of heads in 3 tosses: 0–3ژمارەی شێر لە 3 هەڵداندا: ⁦0–3⁩waiting time for a minibus: any time from 0 to 12 minutesکاتی چاوەڕوانیی پاس: هەر کاتێک لە 0 تا ⁦12⁩ خولەک
children in a family: 0, 1, 2, …منداڵانی خێزانێک: 0، 1، 2، …a person's heightباڵای کەسێک
emails received in an hourئیمەیڵی وەرگیراو لە کاتژمێرێکداthe temperature in Erbil at noonپلەی گەرمیی هەولێر لە نیوەڕۆدا

This lesson is about discrete random variables. Continuous ones need areas instead of lists: see Continuous Random Variables and Density Functions.

ئەم وانەیە دەربارەی . لە جیاتی لیست پێویستیان بە ڕووبەرە: بڕوانە گۆڕاوە هەڕەمەکییە بەردەوامەکان و نەخشەی چڕیی ئەگەر.

Quick checkپشکنینی خێراWhich random variable is continuous?کام بەردەوامە؟

The probability mass functionنەخشەی بارستەی ئەگەر

For a discrete random variable with values x1,x2,x3,…x_1, x_2, x_3, \dots, the probability mass function (pmf) gives the probability of each value. The course writes it P(x)P(x) or f(x)f(x); both mean P(X=x)P(X = x). For any number that is not one of the values, P(x)=0P(x) = 0.

بۆ بە بەهاکانی x1,x2,x3,…x_1, x_2, x_3, \dots، هەر بەهایەک دەدات. کۆرسەکە بە P(x)P(x) یان f(x)f(x) دەینووسێت؛ هەردووکیان واتە P(X=x)P(X = x). بۆ هەر ژمارەیەک کە یەکێک لە بەهاکان نەبێت، P(x)=0P(x) = 0.

(1)  0≤P(x)≤1(2)  ∑iP(xi)=1\text{(1)}\ \ 0 \le P(x) \le 1 \qquad\qquad \text{(2)}\ \ \sum_{i} P(x_i) = 1

Every pmf obeys these two rules. Rule (1) also follows from the axioms of probability; rule (2) says the variable surely takes one of its values.

هەموو پەیڕەوی ئەم دوو یاسایە دەکات. یاسای ⁦(1)⁩ لە بەڵگەنەویستەکانی ئەگەرـەوە دێت؛ یاسای ⁦(2)⁩ دەڵێت گۆڕاوەکە بە دڵنیاییەوە یەکێک لە بەهاکانی وەردەگرێت.

Definitionپێناسە

For a , the P(x)=P(X=x)P(x) = P(X = x): each value is between 0 and 1 and they add up to 1.

بۆ ، P(x)=P(X=x)P(x) = P(X = x): هەر نرخێکی لە نێوان 0 و 1دایە و کۆیان دەکاتە 1.

Quick checkپشکنینی خێراWhich number can NOT be a value of a pmf?کام ژمارە ناتوانێت بەهایەکی بێت؟

The probability mass functionنەخشەی بارستەی ئەگەر

Why “mass”? A probability distributionبۆچی «بارستە»؟ دابەشبوونێکی ئەگەر

A list of values with their probabilities that add to 1 is a (discrete) probability distribution. The lecture also calls the pmf the probability function or frequency function.

لیستێکی بەهاکان لەگەڵ کە کۆیان 1 بێت (پچڕاو)ـە. وانەکە هەروەها بە دەڵێت نەخشەی یان نەخشەی .

One kilogram of sugarیەک کیلۆ شەکر

Think of the probability as 1 kg of sugar shared out among small bags labelled with the values of XX. The pmf tells how much sugar sits in each bag. No bag holds a negative amount, and all the bags together hold exactly 1 kg. That is why it is called a mass function.

وەک یەک کیلۆ شەکر بهێنە بەرچاو کە دابەش کراوە بەسەر چەند کیسەیەکی بچووکدا کە بەهاکانی XXـیان لەسەر نووسراوە. دەڵێت چەند شەکر لە هەر کیسەیەکدایە. هیچ کیسەیەک بڕی نەرێنی تێدا نییە و هەموو کیسەکان پێکەوە ڕێک 1 کیلۆیان تێدایە. لەبەر ئەمە پێی دەڵێن نەخشەی بارستە.

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

Sugar can be split into any amounts; a pmf sits only on the separate values of XX, never between them.

شەکر دەکرێت بە هەر بڕێک دابەش بکرێت؛ تەنها لەسەر بەها جیاجیاکانی XX دادەنیشێت، هەرگیز لە نێوانیاندا نا.

Quick checkپشکنینی خێراXX takes only the values 1, 2 and 3, with P(1)=0.2P(1) = 0.2 and P(2)=0.5P(2) = 0.5. What is P(3)P(3)?XX تەنها بەهاکانی 1، 2 و 3 وەردەگرێت، بە P(1)=0.2P(1) = 0.2 و P(2)=0.5P(2) = 0.5. P(3)P(3) چەندە؟

Example 1: a coin tossed twiceنموونەی 1: دراوێک دوو جار هەڵدەدرێت

A coin is tossed twice; XX is the number of heads. The four outcomes are equally likely, 14\frac14 each. Group them by their value of XX:

دراوێک دوو جار هەڵدەدرێت؛ XX ژمارەی شێرەکانە. چوار ، هەر یەکە 14\frac14. بەپێی بەهای XX کۆیان بکەرەوە:

The pmf of XX, the number of heads in two tosses بۆ XX، ژمارەی شێر لە دوو هەڵداندا
xxOutcomesP(x)P(x)
0TT14\frac14
1HT, TH24=12\frac24 = \frac12
2HH14\frac14
Sumکۆ14+24+14=44=1\frac14 + \frac24 + \frac14 = \frac44 = 1

Both rules hold: every value is between 0 and 1, and the sum is 1. Draw a pmf as stems: a vertical line at each value whose height is the probability, with nothing in between. There is no curve to join, because XX can never be 0.5 or 1.3.

هەردوو یاساکە دروستن: هەموو بەهایەک لە نێوان 0 و 1دایە و کۆکە 1ـە. وەک ستوونی باریک بکێشە: هێڵێکی ستوونی لە سەر هەر بەهایەک کە بەرزییەکەی و لە نێوانیاندا هیچ نییە. هیچ هێڵێکی چەماوە نییە کە بیانبەستێتەوە، چونکە XX هەرگیز ناتوانێت ⁦0.5⁩ یان ⁦1.3⁩ بێت.

Stem graph: vertical lines at x = 0, 1, 2 with heights 1/4, 2/4 and 1/4, each topped by a dot; dashed guide lines mark 1/4 and 1/2 on the P(x) axis.وێنەی ستوونی باریک: هێڵی ستوونی لە x = 0، 1، 2 بە بەرزیی 1/4، 2/4 و 1/4، هەر یەکە خاڵێکی لە سەرە؛ هێڵی پچڕپچڕ 1/4 و 1/2 لە سەر تەوەرەی P(x) نیشان دەدەن.
Two coins: the pmf drawn as stems.دوو دراو: وەک ستوونی باریک.CêIT
Quick checkپشکنینی خێراTwo coins: what is P(X≥1)P(X \ge 1), the probability of at least one head?دوو دراو: P(X≥1)P(X \ge 1) چەندە، واتە لانیکەم یەک شێر؟

Three coins: building a pmfسێ دراو: دروستکردنی نەخشەی بارستەی ئەگەر

Lecture 3, Example 1: three coins are tossed and XX is the number of heads. There are 23=82^3 = 8 equally likely outcomes, 18\frac18 each. Drop every outcome into the bin of its value and count:

وانەی 3، نموونەی 1: سێ دراو هەڵدەدرێن و XX ژمارەی شێرەکانە. 23=82^3 = 8 هەیە کە ، هەر یەکە 18\frac18. هەر بخە ناو سندووقی بەهاکەی خۆی و بژمێرە:

Animation: the eight outcomes TTT … HHH drop one value at a time into bins 0, 1, 2, 3 on an axis; a stem grows over each bin to 1/8, 3/8, 3/8 and 1/8; the last frame shows 1/8 + 3/8 + 3/8 + 1/8 = 1.
Animation: the eight outcomes TTT … HHH drop one value at a time into bins 0, 1, 2, 3 on an axis; a stem grows over each bin to 1/8, 3/8, 3/8 and 1/8; the last frame shows 1/8 + 3/8 + 3/8 + 1/8 = 1.
Outcomes fall into the bins of XX; the stems are the pmf. دەکەونە سندووقەکانی XX؛ ستوونەکان پێک دەهێنن.CêIT
Three coins: the pmf of the number of headsسێ دراو: بۆ ژمارەی شێرەکان
xx0123
OutcomesTTTHTT, THT, TTHHHT, HTH, THHHHH
P(x)P(x)18\frac1838\frac3838\frac3818\frac18

Three coins: building a pmfسێ دراو: دروستکردنی نەخشەی بارستەی ئەگەر

Checking the pmf, as on the boardپشکنینی نەخشەی بارستەی ئەگەر، وەک سەر تەختەکە

In class the lecturer checked this table step by step on the board. The two checks that matter are:

لە پۆلدا مامۆستاکە ئەم خشتەیەی هەنگاو بە هەنگاو لە سەر تەختە پشکنی. ئەو دوو پشکنینەی گرنگن ئەمانەن:

  1. No negative valuesهیچ بەهایەکی نەرێنی نییە

    18,38,38,18\frac18, \frac38, \frac38, \frac18 are all ≥0\ge 0 (here even >0> 0). ✓

    18,38,38,18\frac18, \frac38, \frac38, \frac18 هەموویان ≥0\ge 0ـن (لێرە تەنانەت >0> 0). ✓

  2. The total is 1کۆکە 1ـە

    18+38+38+18=88=1\frac18 + \frac38 + \frac38 + \frac18 = \frac88 = 1. ✓

    18+38+38+18=88=1\frac18 + \frac38 + \frac38 + \frac18 = \frac88 = 1. ✓

Quick checkپشکنینی خێراFor three coins, what is P(X=2)P(X = 2)?بۆ سێ دراو، P(X=2)P(X = 2) چەندە؟

Example 2: a pmf given by a formulaنموونەی 2: نەخشەی بارستەی ئەگەر بە فۆرمولە

A pmf can be a formula: P(x)=x15P(x) = \frac{x}{15} for x=1,2,3,4,5x = 1, 2, 3, 4, 5. Is it a pmf? Every value is positive, and 1+2+3+4+515=1515=1\frac{1 + 2 + 3 + 4 + 5}{15} = \frac{15}{15} = 1. ✓

دەکرێت بێت: P(x)=x15P(x) = \frac{x}{15} بۆ x=1,2,3,4,5x = 1, 2, 3, 4, 5. ئایا ؟ هەموو بەهایەک ئەرێنییە و 1+2+3+4+515=1515=1\frac{1 + 2 + 3 + 4 + 5}{15} = \frac{15}{15} = 1. ✓

Stem graph of P(x) = x/15: stems at x = 1 to 5 with heights 1/15, 2/15, 3/15, 4/15, 5/15. The first three stems are green; below: P(x ≤ 3) = 1/15 + 2/15 + 3/15 = 6/15 = 0.4.وێنەی ستوونی باریکی P(x) = x/15: ستوون لە x = 1 تا 5 بە بەرزیی 1/15، 2/15، 3/15، 4/15، 5/15. سێ ستوونی یەکەم سەوزن؛ لە خوارەوە: P(x ≤ 3) = 1/15 + 2/15 + 3/15 = 6/15 = 0.4.
The three green stems together are P(X≤3)P(X \le 3).سێ ستوونە سەوزەکە پێکەوە P(X≤3)P(X \le 3)ـن.CêIT
P(X≤3)=P(1)+P(2)+P(3)=115+215+315=615=0.4=1−P(X>3)=1−[415+515]=1−915=615\begin{aligned} P(X \le 3) &= P(1) + P(2) + P(3) = \tfrac{1}{15} + \tfrac{2}{15} + \tfrac{3}{15} = \tfrac{6}{15} = 0.4 \\ &= 1 - P(X > 3) = 1 - \left[\tfrac{4}{15} + \tfrac{5}{15}\right] = 1 - \tfrac{9}{15} = \tfrac{6}{15} \end{aligned}

Two roads to the same answer: add the values you want, or subtract the values you do not want from 1.

دوو ڕێگا بۆ هەمان وەڵام: ئەو بەهایانەی دەتەوێت کۆ بکەرەوە، یان ئەوانەی ناتەوێت لە 1 کەم بکەرەوە.

Quick checkپشکنینی خێراWith P(x)=x15P(x) = \frac{x}{15}, x=1,…,5x = 1, \dots, 5, what is P(X≥4)P(X \ge 4)?بە P(x)=x15P(x) = \frac{x}{15}، x=1,…,5x = 1, \dots, 5، P(X≥4)P(X \ge 4) چەندە؟

Homework: a pmf with factorialsڕاهێنانی ماڵەوە: نەخشەی بارستەی ئەگەر بە فاکتۆریێل

ExerciseڕاهێنانH.W (Lecture 4)ڕاهێنانی ماڵەوە (وانەی ⁦4⁩)

Let P(x)=0.75x! (3−x)!P(x) = \frac{0.75}{x!\,(3 - x)!} for x=0,1,2,3x = 0, 1, 2, 3. Sketch P(x)P(x) and find P(X≤2)P(X \le 2).

با P(x)=0.75x! (3−x)!P(x) = \frac{0.75}{x!\,(3 - x)!} بێت بۆ x=0,1,2,3x = 0, 1, 2, 3. وێنەی P(x)P(x) بکێشە و P(X≤2)P(X \le 2) بدۆزەوە.

Hintئاماژە

Work out 0!0!, 1!1!, 2!2! and 3!3! first.

سەرەتا 0!0!، 1!1!، 2!2! و 3!3! بدۆزەوە.

Show answerوەڵامەکە پیشان بدە
P(0)=0.750! 3!=0.756=0.125,P(1)=0.751! 2!=0.752=0.375,P(2)=0.752! 1!=0.375,P(3)=0.753! 0!=0.125\begin{aligned} P(0) &= \tfrac{0.75}{0!\,3!} = \tfrac{0.75}{6} = 0.125, & P(1) &= \tfrac{0.75}{1!\,2!} = \tfrac{0.75}{2} = 0.375, \\ P(2) &= \tfrac{0.75}{2!\,1!} = 0.375, & P(3) &= \tfrac{0.75}{3!\,0!} = 0.125 \end{aligned}

Remember 0!=10! = 1. The sum is 0.125+0.375+0.375+0.125=10.125 + 0.375 + 0.375 + 0.125 = 1, so it is a pmf.

لەبیرت بێت 0!=10! = 1. کۆکە 0.125+0.375+0.375+0.125=10.125 + 0.375 + 0.375 + 0.125 = 1ـە، بۆیە .

P(X≤2)=0.125+0.375+0.375=0.875=1−P(3)P(X \le 2) = 0.125 + 0.375 + 0.375 = 0.875 = 1 - P(3)

These are exactly the three-coin probabilities 18,38,38,18\frac18, \frac38, \frac38, \frac18, so the sketch is the same four stems. That is no accident: 0.75x!(3−x)!=18⋅3!x!(3−x)!=18(3x)\frac{0.75}{x!(3-x)!} = \frac{1}{8}\cdot\frac{3!}{x!(3-x)!} = \frac{1}{8}\binom{3}{x}, and (3x)\binom{3}{x} counts the outcomes with xx heads.

ئەمانە ڕێک سێ دراوەکەن 18,38,38,18\frac18, \frac38, \frac38, \frac18، بۆیە وێنەکە هەمان چوار ستوونە. ئەمە ڕێکەوت نییە: 0.75x!(3−x)!=18⋅3!x!(3−x)!=18(3x)\frac{0.75}{x!(3-x)!} = \frac{1}{8}\cdot\frac{3!}{x!(3-x)!} = \frac{1}{8}\binom{3}{x} و (3x)\binom{3}{x} ئەو دەژمێرێت کە xx شێریان هەیە.

The binomial coefficient (3x)\binom{3}{x} comes from Combinations, and this pattern grows into the binomial distribution: every coin pmf in this lesson is a binomial one.

(3x)\binom{3}{x} لە گونجێنەکانـەوە دێت و ئەم شێوەیە گەشە دەکات بۆ دابەشبوونی دووڕادەیی: لە هەموو نموونەکانی دراوی ئەم وانەیەدا دووڕادەییە.

Is it a pmf? A trick homeworkنەخشەی بارستەی ئەگەرە؟ ڕاهێنانێکی فێڵاوی

H.W 3 in both lectures says: let P(x)=16P(x) = \frac16 for x=0,1,2,3,4,5,6x = 0, 1, 2, 3, 4, 5, 6. Check it before you use it. Each value is ≥0\ge 0, but count the values: there are seven of them.

ڕاهێنانی ماڵەوەی 3 لە هەردوو وانەکەدا دەڵێت: با P(x)=16P(x) = \frac16 بێت بۆ x=0,1,2,3,4,5,6x = 0, 1, 2, 3, 4, 5, 6. پێش بەکارهێنان بیپشکنە. هەموو بەهایەک ≥0\ge 0ـە، بەڵام بەهاکان بژمێرە: حەوت دانەن.

∑x=06P(x)=7⋅16=76≠1\sum_{x=0}^{6} P(x) = 7 \cdot \frac16 = \frac76 \ne 1

So, as printed, P(x)P(x) is NOT a pmf: the total mass is more than 1.

کەواتە، وەک چاپکراوە، P(x)P(x) نییە: کۆی بارستەکە لە 1 زیاترە.

With x=1,2,…,6x = 1, 2, \dots, 6 (a fair die) it is a pmf: six values of 16\frac16 add to 1. The course notes quietly made this change. The rest of the homework, the CDF and P(2<X≤4)=26P(2 < X \le 4) = \frac26, is solved in the CDF lesson.

بە x=1,2,…,6x = 1, 2, \dots, 6 (بەردەزارێکی دادپەروەر) : شەش بەهای 16\frac16 کۆیان 1ـە. تێبینییەکانی کۆرسەکە بێدەنگ ئەم گۆڕانکارییەیان کردووە. بەشەکەی تری ڕاهێنانەکە، و P(2<X≤4)=26P(2 < X \le 4) = \frac26، لە وانەی نەخشەی دابەشبوونی کەڵەکەبوو چارەسەر کراوە.

Quick checkپشکنینی خێراWhich table is a pmf?کام خشتە ؟

Probabilities of events: add the massesئەگەری ڕووداوەکان: بارستەکان کۆ بکەرەوە

Once you have the pmf you do not need the outcomes any more. The probability of any event about XX is the sum of the pmf over the values in that event:

کاتێک هەبوو، چیتر پێویستت بە نییە. هەر دەربارەی XX کۆی لە سەر بەهاکانی ناو ئەو :

P(X∈E)=∑xi∈EP(xi)P(X \in E) = \sum_{x_i \in E} P(x_i)

Lecture 4, property 4. Example, three coins: the probability of at least two heads is P(2)+P(3)=38+18=12P(2) + P(3) = \frac38 + \frac18 = \frac12, and the probability that XX is odd is P(1)+P(3)=38+18=12P(1) + P(3) = \frac38 + \frac18 = \frac12.

وانەی 4، تایبەتمەندیی 4. نموونە، سێ دراو: لانیکەم دوو شێر P(2)+P(3)=38+18=12P(2) + P(3) = \frac38 + \frac18 = \frac12ـە و ئەوەی XX تاک بێت P(1)+P(3)=38+18=12P(1) + P(3) = \frac38 + \frac18 = \frac12ـە.

Quick checkپشکنینی خێراThree coins. What is P(X≠0)P(X \ne 0)?سێ دراو. P(X≠0)P(X \ne 0) چەندە؟

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

  • Joining the stems with a curve. A discrete XX has no values between its stems, so nothing may be drawn there.
  • Plotting running totals and calling it a pmf. The heights of a pmf are the single probabilities (18,38,38,18\frac18, \frac38, \frac38, \frac18), not the running totals 18,48,78,1\frac18, \frac48, \frac78, 1.
  • Skipping the check. A formula is not a pmf until its values are ≥0\ge 0 and add to 1 (the homework with x=0,…,6x = 0, \dots, 6 adds to 76\frac76).
  • Writing P(x)>0P(x) > 0 as a rule. Zero is allowed; only negative values are forbidden.
  • Confusing XX and xx. XX is the rule (the random variable); xx is one number it can give. P(X=x)P(X = x) asks how likely that number is.
  • بەستنەوەی ستوونەکان بە هێڵێکی چەماوە. XXـی پچڕاو هیچ بەهایەکی لە نێوان ستوونەکانیدا نییە، بۆیە هیچ شتێک لەوێ ناکێشرێت.
  • کێشانی کۆی ڕۆیشتوو و ناونانی بە . بەرزییەکانی تاکە (18,38,38,18\frac18, \frac38, \frac38, \frac18)، نەک کۆ ڕۆیشتووەکانی 18,48,78,1\frac18, \frac48, \frac78, 1.
  • تێپەڕاندنی پشکنین. نییە تا بەهاکانی ≥0\ge 0 نەبن و کۆیان 1 نەبێت (ڕاهێنانەکەی x=0,…,6x = 0, \dots, 6 کۆی 76\frac76ـە).
  • نووسینی P(x)>0P(x) > 0 وەک یاسا. سفر ڕێگە پێدراوە؛ تەنها بەهای نەرێنی قەدەغەیە.
  • تێکەڵکردنی XX و xx. XX یاساکەیە ()؛ xx ژمارەیەکە کە دەتوانێت بیدات. P(X=x)P(X = x) دەپرسێت ئەو ژمارەیە چەندە دەگونجێت.

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

ExerciseڕاهێنانTwo balls from a bagدوو تۆپ لە توورەکەیەک

A bag holds 2 red and 3 blue balls. You take out 2 balls together. Let XX be the number of red balls you get. Find the pmf of XX and check it.

توورەکەیەک 2 تۆپی سوور و 3 تۆپی شینی تێدایە. 2 تۆپ پێکەوە دەردەهێنیت. با XX ژمارەی ئەو تۆپە سوورانە بێت کە دەریان دەهێنیت. XX بدۆزەوە و بیپشکنە.

Hintئاماژە

List or count the pairs of balls.

جووتە تۆپەکان لیست بکە یان بیانژمێرە.

Show answerوەڵامەکە پیشان بدە

There are (52)=10\binom52 = 10 equally likely pairs. No red: (32)=3\binom32 = 3 pairs. One red: 2⋅3=62 \cdot 3 = 6 pairs. Two red: 1 pair.

(52)=10\binom52 = 10 جووتی هەیە. هیچ سوور: (32)=3\binom32 = 3 جووت. یەک سوور: 2⋅3=62 \cdot 3 = 6 جووت. دوو سوور: 1 جووت.

P(0)=310,P(1)=610,P(2)=110,3+6+110=1 ✓P(0) = \frac{3}{10},\quad P(1) = \frac{6}{10},\quad P(2) = \frac{1}{10},\qquad \frac{3 + 6 + 1}{10} = 1 \ \checkmark
ExerciseڕاهێنانFind the constantنەگۆڕەکە بدۆزەوە

P(x)=kx2P(x) = kx^2 for x=1,2,3x = 1, 2, 3 is a pmf. Find kk and P(X=3)P(X = 3).

P(x)=kx2P(x) = kx^2 بۆ x=1,2,3x = 1, 2, 3 . kk و P(X=3)P(X = 3) بدۆزەوە.

Show answerوەڵامەکە پیشان بدە
k(1+4+9)=1  ⇒  k=114,P(3)=914k(1 + 4 + 9) = 1 \;\Rightarrow\; k = \frac{1}{14}, \qquad P(3) = \frac{9}{14}

The total must be 1, and that one equation fixes kk.

کۆکە دەبێت 1 بێت و ئەو یەک هاوکێشەیە kk دیاری دەکات.

ExerciseڕاهێنانSpot the problemکێشەکە بدۆزەوە

A student writes the pmf P(1)=0.5, P(2)=0.4, P(3)=0.2P(1) = 0.5,\ P(2) = 0.4,\ P(3) = 0.2. Is it a pmf?

قوتابییەک ئەم دەنووسێت P(1)=0.5, P(2)=0.4, P(3)=0.2P(1) = 0.5,\ P(2) = 0.4,\ P(3) = 0.2. ئایا ؟

Show answerوەڵامەکە پیشان بدە

No. All values are between 0 and 1, but 0.5+0.4+0.2=1.1≠10.5 + 0.4 + 0.2 = 1.1 \ne 1.

نەخێر. هەموو بەهاکان لە نێوان 0 و 1دان، بەڵام 0.5+0.4+0.2=1.1≠10.5 + 0.4 + 0.2 = 1.1 \ne 1.

Summaryکورتە

  • A random variable XX is a function from the sample space to the real numbers: every outcome gets one number.
  • Discrete variables are counted (children, heads); continuous ones are measured (height, time).
  • The pmf P(x)=P(X=x)P(x) = P(X = x) satisfies 0≤P(x)≤10 \le P(x) \le 1 and ∑P(x)=1\sum P(x) = 1; it is drawn as stems.
  • Two coins: 14,12,14\frac14, \frac12, \frac14. Three coins: 18,38,38,18\frac18, \frac38, \frac38, \frac18 (the same as 0.75x! (3−x)!\frac{0.75}{x!\,(3-x)!}). For x15\frac{x}{15}, x=1,…,5x = 1, \dots, 5: P(X≤3)=0.4P(X \le 3) = 0.4.
  • P(x)=16P(x) = \frac16 for x=0,…,6x = 0, \dots, 6 is not a pmf (the sum is 76\frac76). The probability of an event is the sum of the pmf over its values.
  • XX لە بۆ : هەر یەک ژمارە وەردەگرێت.
  • گۆڕاوە پچڕاوەکان دەژمێردرێن (منداڵ، شێر)؛ بەردەوامەکان دەپێورێن (باڵا، کات).
  • P(x)=P(X=x)P(x) = P(X = x) مەرجەکانی 0≤P(x)≤10 \le P(x) \le 1 و ∑P(x)=1\sum P(x) = 1 دەپارێزێت؛ وەک ستوونی باریک دەکێشرێت.
  • دوو دراو: 14,12,14\frac14, \frac12, \frac14. سێ دراو: 18,38,38,18\frac18, \frac38, \frac38, \frac18 (هەمان 0.75x! (3−x)!\frac{0.75}{x!\,(3-x)!}). بۆ x15\frac{x}{15}، x=1,…,5x = 1, \dots, 5: P(X≤3)=0.4P(X \le 3) = 0.4.
  • P(x)=16P(x) = \frac16 بۆ x=0,…,6x = 0, \dots, 6 نییە (کۆکەی 76\frac76ـە). کۆی لە سەر بەهاکانی.

Next: the cumulative distribution function keeps a running total of the pmf.

دواتر: نەخشەی دابەشبوونی کەڵەکەبوو کۆیەکی ڕۆیشتووی هەڵدەگرێت.

Videoڤیدیۆ

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

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

02 - Random Variables and Discrete Probability DistributionsMath and Science · Englishئینگلیزی · 2.1M viewsبینین · 33K likesلایک · Partبەشی 0:53–11:14 (ofلە 29:54)

What a random variable is and how a table of its values and probabilities makes a discrete probability distribution, with coin-toss examples.

چییە و چۆن خشتەیەک بە نرخەکانی و دەبێتە پچڕاو، بە نموونەی هەڵدانی دراو.

Plays 0:53-11:14: random variables, discrete probability distributions and a worked example.

لە ⁦0:53⁩ تا ⁦11:14⁩ پەخش دەبێت: ، پچڕاو و نموونەیەکی چارەسەرکراو.

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

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

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

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

The Cumulative Distribution Function (CDF)نەخشەی دابەشبوونی کەڵەکەبوو ⁦(CDF)⁩

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

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