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, and factorial examples, including a homework that is not a pmf.
دەکات بە ژمارە. گۆڕاوی پچڕاو و بەردەوام، و دوو یاساکەی، وێنەی ستوونی باریک و نموونەکانی دراو، و کۆرسەکە، لەگەڵ ڕاهێنانێک کە نییە.
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 (: heads, : 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 . Then , , , , so can be 0, 1 or 2.
دوو دراو هەڵبدە. بریتییە لە ( بۆ شێر و بۆ خەت). زۆر جار گرنگیمان بە خودی نییە، تەنها بە ژمارەیەک کە لێیەوە دێت: چەند شێرمان هێنا؟ ناوی ئەو ژمارەیە بنێ . ئەوسا ، ، ، ، بۆیە دەتوانێت 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.
ڕێک ئەمەیە: یاسایەک کە دەدات بە هەر . «هەڕەمەکی»ـیە چونکە پێشوەختە نازانین، کەواتە ژمارەکەش نازانین.
A rule that gives a number to every of a ; it is a from the to the real numbers.
یاسایەکە کە ژمارەیەک دەدات بە هەر ؛ لە بۆ ژمارە ڕاستییەکان.
From outcomes to numbersلە ئەنجامەکانەوە بۆ ژمارە
Capital , small ـی گەورە و ـی بچووک
Notation: a capital letter () names the random variable; a small letter () is one of its values. is an event: “exactly one head”, which is .
نیشانەکان: پیتی گەورە () ناوی ؛ پیتی بچووک () یەکێکە لە بەهاکانی. : «ڕێک یەک شێر»، کە ـە.
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.
لە یەک تاقیکردنەوە دەتوانیت چەندین دروست بکەیت: کێش، ژمارەی تەماتەکان، نرخ. هەر یەکەیان یاسایەکی جیاوازە.
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.
بە پێچەوانەی ناوەکەیەوە، نە و نە هەڕەمەکییە: . و ئەو ژمارانەیە کە دەیاندات. هەموو ڕێک یەک ژمارە وەردەگرێت، بەڵام چەند دەتوانن یەک ژمارە بەش بکەن، ڕێک وەک پێناسەی نەخشە.
For three coins the domain is the set of 8 outcomes and the range is . You can read more about these two sets in Domain, Range and Image.
بۆ سێ دراو هەشت و ـە. دەتوانیت لە بوار، مەودا و وێنە زیاتر دەربارەی ئەم دوو بخوێنیتەوە.
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 بێت: تەنها وردیی پێوەرەکە بڕیار دەدات چەند ژمارە دوای فاریزە بنووسین.
| 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.
ئەم وانەیە دەربارەی . لە جیاتی لیست پێویستیان بە ڕووبەرە: بڕوانە گۆڕاوە هەڕەمەکییە بەردەوامەکان و نەخشەی چڕیی ئەگەر.
The probability mass functionنەخشەی بارستەی ئەگەر
For a discrete random variable with values , the probability mass function (pmf) gives the probability of each value. The course writes it or ; both mean . For any number that is not one of the values, .
بۆ بە بەهاکانی ، هەر بەهایەک دەدات. کۆرسەکە بە یان دەینووسێت؛ هەردووکیان واتە . بۆ هەر ژمارەیەک کە یەکێک لە بەهاکان نەبێت، .
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) دەڵێت گۆڕاوەکە بە دڵنیاییەوە یەکێک لە بەهاکانی وەردەگرێت.
For a , the : each value is between 0 and 1 and they add up to 1.
بۆ ، : هەر نرخێکی لە نێوان 0 و 1دایە و کۆیان دەکاتە 1.
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 بێت (پچڕاو)ـە. وانەکە هەروەها بە دەڵێت نەخشەی یان نەخشەی .
Think of the probability as 1 kg of sugar shared out among small bags labelled with the values of . 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.
وەک یەک کیلۆ شەکر بهێنە بەرچاو کە دابەش کراوە بەسەر چەند کیسەیەکی بچووکدا کە بەهاکانی ـیان لەسەر نووسراوە. دەڵێت چەند شەکر لە هەر کیسەیەکدایە. هیچ کیسەیەک بڕی نەرێنی تێدا نییە و هەموو کیسەکان پێکەوە ڕێک 1 کیلۆیان تێدایە. لەبەر ئەمە پێی دەڵێن نەخشەی بارستە.
Where the analogy stops workingسنووری ئەم نموونەیە
Sugar can be split into any amounts; a pmf sits only on the separate values of , never between them.
شەکر دەکرێت بە هەر بڕێک دابەش بکرێت؛ تەنها لەسەر بەها جیاجیاکانی دادەنیشێت، هەرگیز لە نێوانیاندا نا.
Example 1: a coin tossed twiceنموونەی 1: دراوێک دوو جار هەڵدەدرێت
A coin is tossed twice; is the number of heads. The four outcomes are equally likely, each. Group them by their value of :
دراوێک دوو جار هەڵدەدرێت؛ ژمارەی شێرەکانە. چوار ، هەر یەکە . بەپێی بەهای کۆیان بکەرەوە:
| Outcomes | ||
|---|---|---|
| 0 | TT | |
| 1 | HT, TH | |
| 2 | HH | |
| Sumکۆ |
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 can never be 0.5 or 1.3.
هەردوو یاساکە دروستن: هەموو بەهایەک لە نێوان 0 و 1دایە و کۆکە 1ـە. وەک ستوونی باریک بکێشە: هێڵێکی ستوونی لە سەر هەر بەهایەک کە بەرزییەکەی و لە نێوانیاندا هیچ نییە. هیچ هێڵێکی چەماوە نییە کە بیانبەستێتەوە، چونکە هەرگیز ناتوانێت 0.5 یان 1.3 بێت.
Three coins: building a pmfسێ دراو: دروستکردنی نەخشەی بارستەی ئەگەر
Lecture 3, Example 1: three coins are tossed and is the number of heads. There are equally likely outcomes, each. Drop every outcome into the bin of its value and count:
وانەی 3، نموونەی 1: سێ دراو هەڵدەدرێن و ژمارەی شێرەکانە. هەیە کە ، هەر یەکە . هەر بخە ناو سندووقی بەهاکەی خۆی و بژمێرە:


| 0 | 1 | 2 | 3 | |
|---|---|---|---|---|
| Outcomes | TTT | HTT, THT, TTH | HHT, HTH, THH | HHH |
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:
لە پۆلدا مامۆستاکە ئەم خشتەیەی هەنگاو بە هەنگاو لە سەر تەختە پشکنی. ئەو دوو پشکنینەی گرنگن ئەمانەن:
- No negative valuesهیچ بەهایەکی نەرێنی نییە
are all (here even ). ✓
هەموویان ـن (لێرە تەنانەت ). ✓
- The total is 1کۆکە 1ـە
. ✓
. ✓
Example 2: a pmf given by a formulaنموونەی 2: نەخشەی بارستەی ئەگەر بە فۆرمولە
A pmf can be a formula: for . Is it a pmf? Every value is positive, and . ✓
دەکرێت بێت: بۆ . ئایا ؟ هەموو بەهایەک ئەرێنییە و . ✓
Two roads to the same answer: add the values you want, or subtract the values you do not want from 1.
دوو ڕێگا بۆ هەمان وەڵام: ئەو بەهایانەی دەتەوێت کۆ بکەرەوە، یان ئەوانەی ناتەوێت لە 1 کەم بکەرەوە.
Homework: a pmf with factorialsڕاهێنانی ماڵەوە: نەخشەی بارستەی ئەگەر بە فاکتۆریێل
Let for . Sketch and find .
با بێت بۆ . وێنەی بکێشە و بدۆزەوە.
Hintئاماژە
Work out , , and first.
سەرەتا ، ، و بدۆزەوە.
Show answerوەڵامەکە پیشان بدە
Remember . The sum is , so it is a pmf.
لەبیرت بێت . کۆکە ـە، بۆیە .
These are exactly the three-coin probabilities , so the sketch is the same four stems. That is no accident: , and counts the outcomes with heads.
ئەمانە ڕێک سێ دراوەکەن ، بۆیە وێنەکە هەمان چوار ستوونە. ئەمە ڕێکەوت نییە: و ئەو دەژمێرێت کە شێریان هەیە.
The binomial coefficient comes from Combinations, and this pattern grows into the binomial distribution: every coin pmf in this lesson is a binomial one.
لە گونجێنەکانـەوە دێت و ئەم شێوەیە گەشە دەکات بۆ دابەشبوونی دووڕادەیی: لە هەموو نموونەکانی دراوی ئەم وانەیەدا دووڕادەییە.
Is it a pmf? A trick homeworkنەخشەی بارستەی ئەگەرە؟ ڕاهێنانێکی فێڵاوی
H.W 3 in both lectures says: let for . Check it before you use it. Each value is , but count the values: there are seven of them.
ڕاهێنانی ماڵەوەی 3 لە هەردوو وانەکەدا دەڵێت: با بێت بۆ . پێش بەکارهێنان بیپشکنە. هەموو بەهایەک ـە، بەڵام بەهاکان بژمێرە: حەوت دانەن.
So, as printed, is NOT a pmf: the total mass is more than 1.
کەواتە، وەک چاپکراوە، نییە: کۆی بارستەکە لە 1 زیاترە.
With (a fair die) it is a pmf: six values of add to 1. The course notes quietly made this change. The rest of the homework, the CDF and , is solved in the CDF lesson.
بە (بەردەزارێکی دادپەروەر) : شەش بەهای کۆیان 1ـە. تێبینییەکانی کۆرسەکە بێدەنگ ئەم گۆڕانکارییەیان کردووە. بەشەکەی تری ڕاهێنانەکە، و ، لە وانەی نەخشەی دابەشبوونی کەڵەکەبوو چارەسەر کراوە.
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 is the sum of the pmf over the values in that event:
کاتێک هەبوو، چیتر پێویستت بە نییە. هەر دەربارەی کۆی لە سەر بەهاکانی ناو ئەو :
Lecture 4, property 4. Example, three coins: the probability of at least two heads is , and the probability that is odd is .
وانەی 4، تایبەتمەندیی 4. نموونە، سێ دراو: لانیکەم دوو شێر ـە و ئەوەی تاک بێت ـە.
Common mistakesهەڵە باوەکان
- Joining the stems with a curve. A discrete 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 (), not the running totals .
- Skipping the check. A formula is not a pmf until its values are and add to 1 (the homework with adds to ).
- Writing as a rule. Zero is allowed; only negative values are forbidden.
- Confusing and . is the rule (the random variable); is one number it can give. asks how likely that number is.
- بەستنەوەی ستوونەکان بە هێڵێکی چەماوە. ـی پچڕاو هیچ بەهایەکی لە نێوان ستوونەکانیدا نییە، بۆیە هیچ شتێک لەوێ ناکێشرێت.
- کێشانی کۆی ڕۆیشتوو و ناونانی بە . بەرزییەکانی تاکە ()، نەک کۆ ڕۆیشتووەکانی .
- تێپەڕاندنی پشکنین. نییە تا بەهاکانی نەبن و کۆیان 1 نەبێت (ڕاهێنانەکەی کۆی ـە).
- نووسینی وەک یاسا. سفر ڕێگە پێدراوە؛ تەنها بەهای نەرێنی قەدەغەیە.
- تێکەڵکردنی و . یاساکەیە ()؛ ژمارەیەکە کە دەتوانێت بیدات. دەپرسێت ئەو ژمارەیە چەندە دەگونجێت.
Exercisesڕاهێنانەکان
A bag holds 2 red and 3 blue balls. You take out 2 balls together. Let be the number of red balls you get. Find the pmf of and check it.
توورەکەیەک 2 تۆپی سوور و 3 تۆپی شینی تێدایە. 2 تۆپ پێکەوە دەردەهێنیت. با ژمارەی ئەو تۆپە سوورانە بێت کە دەریان دەهێنیت. بدۆزەوە و بیپشکنە.
Hintئاماژە
List or count the pairs of balls.
جووتە تۆپەکان لیست بکە یان بیانژمێرە.
Show answerوەڵامەکە پیشان بدە
There are equally likely pairs. No red: pairs. One red: pairs. Two red: 1 pair.
جووتی هەیە. هیچ سوور: جووت. یەک سوور: جووت. دوو سوور: 1 جووت.
for is a pmf. Find and .
بۆ . و بدۆزەوە.
Show answerوەڵامەکە پیشان بدە
The total must be 1, and that one equation fixes .
کۆکە دەبێت 1 بێت و ئەو یەک هاوکێشەیە دیاری دەکات.
A student writes the pmf . Is it a pmf?
قوتابییەک ئەم دەنووسێت . ئایا ؟
Show answerوەڵامەکە پیشان بدە
No. All values are between 0 and 1, but .
نەخێر. هەموو بەهاکان لە نێوان 0 و 1دان، بەڵام .
Summaryکورتە
- A random variable 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 satisfies and ; it is drawn as stems.
- Two coins: . Three coins: (the same as ). For , : .
- for is not a pmf (the sum is ). The probability of an event is the sum of the pmf over its values.
- لە بۆ : هەر یەک ژمارە وەردەگرێت.
- گۆڕاوە پچڕاوەکان دەژمێردرێن (منداڵ، شێر)؛ بەردەوامەکان دەپێورێن (باڵا، کات).
- مەرجەکانی و دەپارێزێت؛ وەک ستوونی باریک دەکێشرێت.
- دوو دراو: . سێ دراو: (هەمان ). بۆ ، : .
- بۆ نییە (کۆکەی ـە). کۆی لە سەر بەهاکانی.
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.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
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زاراوە سەرەکییەکان
The Cumulative Distribution Function (CDF)نەخشەی دابەشبوونی کەڵەکەبوو (CDF)
Related lecturesوانە پەیوەندیدارەکان
- Domain, Range and Imageبوار، مەودا و وێنە
- The Cumulative Distribution Function (CDF)نەخشەی دابەشبوونی کەڵەکەبوو (CDF)
- Continuous Random Variables and Density Functionsگۆڕاوە هەڕەمەکییە بەردەوامەکان و نەخشەی چڕیی ئەگەر
- Expected Value (Mathematical Expectation)نرخی پێشبینیکراو (چاوەڕوانیی بیرکاری)
- The Binomial 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 ن.