Chapterبەش 2 · Lectureوانە 2.7

The Arithmetic Mean and the Weighted Meanناوەند و ناوەندی قورسکراو

The everyday average, taught properly: the mean of a list and of a frequency table (with class midpoints), why the mean is the balance point of the data, the weighted mean for marks and course hours (how a GPA works), the corrected Example (3), and the same calculations in Python.

ئەو تێکڕایەی ڕۆژانە، بە شێوەیەکی دروست: لیستێک و (بە )، بۆچی خاڵی هاوسەنگیی ، بۆ نمرە و کاتژمێری وانەکان (تێکڕای نمرەی زانکۆ چۆن کار دەکات)، نموونەی ⁦(3)⁩ی ڕاستکراوە و هەمان ژماردن لە Pythonـدا.

14 min read14 خولەک خوێندنەوە · 16 stepsهەنگاو

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

  • Compute the mean of ungrouped data and of a frequency table using class midpoints.
  • Explain why the mean is the balance point and why the deviations from it add up to zero.
  • Compute a weighted mean for ungrouped and grouped data, for example a semester average from marks and course hours.
  • Check your results with Python's statistics.mean and statistics.fmean.
  • و بە بەکارهێنانی بدۆزیتەوە.
  • ڕوونی بکەیتەوە بۆچی خاڵی هاوسەنگییە و بۆچی کۆی لێیەوە سفرە.
  • بۆ و بدۆزیتەوە، بۆ نموونە تێکڕای وەرزێک لە نمرە و کاتژمێری وانەکانەوە.
  • ئەنجامەکانت بە statistics.mean و statistics.fmeanـی Python بپشکنیت.

One number for the centre of the dataیەک ژمارە بۆ ناوەڕاستی دراوەکە

When a teacher says “the class average was 72”, one number describes thirty marks. A shop says “we sell about 40 glasses of tea an hour”. In both cases a long list of values is summed up by a single typical value. Statistics calls such a value a measure of central tendency.

کاتێک مامۆستایەک دەڵێت «تێکڕای پۆلەکە ⁦72⁩ بوو»، یەک ژمارە سی نمرە وەسف دەکات. چایخانەیەک دەڵێت «لە هەر کاتژمێرێکدا نزیکەی ⁦40⁩ پیاڵە چا دەفرۆشین». لە هەردوو حاڵەتەکەدا لیستێکی درێژی نرخ بە یەک نرخی ئاسایی کورت دەکرێتەوە. بە نرخێکی وا دەڵێت .

Definitionپێناسە

A single number that describes the centre of the data. The best known are the , the and the .

یەک ژمارەیە کە ناوەڕاستی دراوەکە وەسف دەکات. ناسراوترینەکانیان و و .

This lesson teaches the best-known one, the arithmetic mean (the everyday “average”), and its cousin the weighted mean. Both can be found for raw, ungrouped data and for grouped data in a frequency table. Later lessons add the geometric, harmonic and quadratic means, the median and the mode.

ئەم وانەیە ناسراوترینیان فێر دەکات، (ئەو «تێکڕا»یەی ڕۆژانە بەکاری دەهێنین)، لەگەڵ خزمە نزیکەکەی . هەردووکیان بۆ دراوەی پۆلێننەکراو و بۆ لە دەدۆزرێنەوە. وانەکانی دواتر ناوەندی ئەندازەیی، ناوەندی هارمۆنیک، ناوەندی دووجایی، ناوەڕاستە و باو زیاد دەکەن.

Quick checkپشکنینی خێراWhich of these is a measure of central tendency?کامیان ؟

The mean of ungrouped dataناوەندی دراوەی پۆلێننەکراو

To find the arithmetic mean of a list, add all the values and divide by how many there are. With the sigma notation you already know:

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

Xˉ=∑i=1nXin=X1+X2+⋯+Xnn\bar X = \frac{\sum_{i=1}^{n} X_i}{n} = \frac{X_1 + X_2 + \cdots + X_n}{n}

Read Xˉ\bar X as “X bar”. The top adds every value once; nn is the number of values.

Xˉ\bar X بەم شێوەیە دەخوێنرێتەوە: «X بار». بەشی سەرەوە هەموو نرخێک یەک جار کۆ دەکاتەوە؛ nn ژمارەی نرخەکانە.

Example (2)نموونەی ⁦(2)⁩
  1. Add the valuesنرخەکان کۆ بکەرەوە

    Example (2): the values are 8, 3, 5, 12, 10. Their sum is 8+3+5+12+10=388+3+5+12+10 = 38.

    نموونەی ⁦(2)⁩: نرخەکان 8، 3، 5، ⁦12⁩، ⁦10⁩ن. کۆکەیان 8+3+5+12+10=388+3+5+12+10 = 38ـە.

  2. Count themبیانژمێرە

    There are n=5n = 5 values.

    n=5n = 5 نرخ هەیە.

  3. Divideدابەش بکە

    Xˉ=385=7.6\bar X = \frac{38}{5} = 7.6

    Xˉ=385=7.6\bar X = \frac{38}{5} = 7.6

Quick checkپشکنینی خێراWhat is the mean of 4, 6 and 11? 4، 6 و ⁦11⁩ چەندە؟

بیرکاری پۆلی ۷ وانەی (٤-۷) ناوەند ، مەودا ، باو ، ناوەراست //berkare poli 7 wanaye (4-7)م / شهاب بیرکاری · Kurdish (Sorani)کوردی (سۆرانی) · 19K viewsبینین · 548 likesلایک · Partبەشی 3:10–8:15 (ofلە 27:19)

In Kurdish: the mean of a list is the sum of the numbers divided by how many there are, with a worked example.

بە کوردی: لیستێک کۆی ژمارەکانە دابەش بە ژمارەی دانەکان، لەگەڵ نموونەیەکی چارەسەرکراو.

In Kurdish; watch 3:10–8:15, the mean (ناوەند). The rest of the video does range, mode and median.

بە کوردی؛ لە ⁦3:10⁩ تا ⁦8:15⁩ سەیر بکە: . ئەوانی تری ڤیدیۆکە ، و باس دەکات.

Why it works: the mean is the balance pointبۆچی کار دەکات: ناوەند خاڵی هاوسەنگییە

Put each value as an equal block on a long ruler and try to hold the ruler on one finger. Under 10 it falls to the left, under 5 it falls to the right. It stays level only under 7.6, the mean.

هەر نرخێک وەک بلۆکێکی یەکسان لەسەر ڕاستەیەکی درێژ دابنێ و هەوڵ بدە ڕاستەکە لەسەر یەک پەنجە ڕابگریت. لە ژێر ⁦10⁩ـدا بەلای چەپدا دەکەوێت، لە ژێر 5ـدا بەلای ڕاستدا. تەنها لە ژێر ⁦7.6⁩ـدا، واتە ، ڕێک دەوەستێت.

A ruler marked 0 to 14 carries five blocks at 3, 5, 8, 10 and 12. Held at 10 it tips left, held at 5 it tips right, held at 6.5 it still tips right a little. Held at 7.6 it is level, and arrows show the distances −4.6, −2.6, +0.4, +2.4, +4.4, which add up to 0.
A ruler marked 0 to 14 carries five blocks at 3, 5, 8, 10 and 12. Held at 10 it tips left, held at 5 it tips right, held at 6.5 it still tips right a little. Held at 7.6 it is level, and arrows show the distances −4.6, −2.6, +0.4, +2.4, +4.4, which add up to 0.
The support moves until the ruler balances — exactly at the mean.خاڵی ڕاگرتن دەجووڵێت تا ڕاستەکە هاوسەنگ دەبێت — ڕێک لە .CêIT
Quick checkپشکنینی خێراThe values 2, 4 and 9 stand as equal blocks on a ruler. Under which point does the ruler balance?نرخەکانی 2، 4 و 9 وەک بلۆکی یەکسان لەسەر ڕاستەیەک وەستاون. ڕاستەکە لە ژێر کام خاڵدا هاوسەنگ دەبێت؟

Why it works: the mean is the balance pointبۆچی کار دەکات: ناوەند خاڵی هاوسەنگییە

The deviations always add up to zeroکۆی لادانەکان هەمیشە سفرە

The distance of a value from the mean is its deviation, Xi−XˉX_i - \bar X. The deviations on the left (−4.6-4.6 and −2.6-2.6) weigh exactly as much as those on the right (+0.4+0.4, +2.4+2.4 and +4.4+4.4). This is true for every data set:

دووریی نرخێک لە ، Xi−XˉX_i - \bar X. لای چەپ (−4.6-4.6 و −2.6-2.6) ڕێک هێندەی ئەوانەی لای ڕاست (+0.4+0.4، +2.4+2.4 و +4.4+4.4) قورسن. ئەمە بۆ هەموو کۆمەڵە ڕاستە:

∑i=1n(Xi−Xˉ)=∑Xi−nXˉ=∑Xi−∑Xi=0\sum_{i=1}^{n} (X_i - \bar X) = \sum X_i - n\bar X = \sum X_i - \sum X_i = 0

Because nXˉ=∑Xin\bar X = \sum X_i, the deviations from the mean always add up to zero. That is what “balance point” means. Because they cancel, measuring spread needs their signs removed first: see Deviations, and why they add up to zero.

چونکە nXˉ=∑Xin\bar X = \sum X_i، کۆی لە هەمیشە سفرە. «خاڵی هاوسەنگی» واتای ئەمەیە. لەبەر ئەوەی یەکتر لادەبەن، بۆ پێوانی دەبێت سەرەتا نیشانەکانیان لاببەین: بڕوانە لادانەکان و بۆچی کۆیان سفرە.

A tray of tea glassesسینییەکی پیاڵە چا

A waiter in a tea house carries a tray of glasses on one hand. If the glasses stand at 3, 5, 8, 10 and 12 cm from the edge, his hand must be under 7.6 cm, or the tray tips.

چایچییەک لە چایخانەیەکدا سینییەکی پیاڵە چا لەسەر یەک دەست هەڵدەگرێت. ئەگەر پیاڵەکان لە 3، 5، 8، ⁦10⁩ و ⁦12⁩ سانتیمەتری لێوارەکەوە بن، دەبێت دەستی لە ژێر ⁦7.6⁩ سانتیمەتردا بێت، دەنا سینییەکە لار دەبێتەوە.

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

This works because every glass weighs the same. If one glass were heavier, the balance point would move towards it — that is the weighted mean later in this lesson.

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

Quick checkپشکنینی خێراFor any data set, the sum of the deviations from the mean, ∑(Xi−Xˉ)\sum (X_i - \bar X), is…بۆ هەر کۆمەڵە ، کۆی لە ، ∑(Xi−Xˉ)\sum (X_i - \bar X)، دەکاتە…

The mean of grouped data: midpoints stand inناوەندی دراوەی پۆلێنکراو: خاڵە ناوەڕاستەکانی کلاس جێگە دەگرنەوە

In a frequency table the single values are gone. We only know how many values fall in each class. So we let the class midpoint (class mark) stand for every value of its class, and we count it as many times as the class frequency says.

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

Xˉ=∑i=1mXiFi∑i=1mFi\bar X = \frac{\sum_{i=1}^{m} X_i F_i}{\sum_{i=1}^{m} F_i}

Here XiX_i is the midpoint of class ii, FiF_i is its frequency and mm is the number of classes. The bottom, ∑Fi\sum F_i, is the number of values nn — not the number of classes.

لێرەدا XiX_i iiـیە، FiF_i و mm ژمارەی . بەشی خوارەوە، ∑Fi\sum F_i، ژمارەی نرخەکانە، nn — نەک ژمارەی .

Multiplying by FiF_i is the same idea as adding repeated values: in 1, 1, 1, 2, 2 you can add 1⋅3+2⋅2=71 \cdot 3 + 2 \cdot 2 = 7 and divide by 5. A class with 30 values must count 30 times, not once.

لێکدان لە FiF_i هەمان بیرۆکەی کۆکردنەوەی نرخە دووبارەکانە: لە 1، 1، 1، 2، 2ـدا دەتوانیت 1⋅3+2⋅2=71 \cdot 3 + 2 \cdot 2 = 7 کۆ بکەیتەوە و دابەشی 5ی بکەیت. کە ⁦30⁩ نرخی تێدایە دەبێت ⁦30⁩ جار هەژمار بکرێت، نەک یەک جار.

Quick checkپشکنینی خێراWhich value stands for every value of the class 30–40?کام نرخ جێگەی هەموو نرخەکانی ⁦30–40⁩ دەگرێتەوە؟

Mean, Median & Mode for a Grouped Frequency Data Table | StatisticsBrain Station · Englishئینگلیزی · 654K viewsبینین · 12K likesلایک · Partبەشی 0:34–3:56 (ofلە 9:47)

The mean of a grouped frequency table: find each class midpoint, multiply by its frequency, add the products and divide by the total frequency.

پۆلێنکراو: بۆ هەر ، لە بدە، لێکدراوەکان کۆ بکەرەوە و دابەشی کۆی بکە.

Watch 0:34–3:56, the mean; the rest of the video does the median and mode of grouped data.

لە ⁦0:34⁩ تا ⁦3:56⁩ سەیر بکە: ؛ ئەوانی تری ڤیدیۆکە و دەدۆزێتەوە.

Example (3): the mean of a frequency tableنموونەی ⁦(3)⁩: ناوەندی خشتەیەکی دووبارەبوونەوە

Example (3) asks for the arithmetic mean of Table (5): five classes of width 10 with frequencies 8, 26, 30, 20 and 16. Add a midpoint column XiX_i and a product column XiFiX_iF_i:

نموونەی ⁦(3)⁩ داوای خشتەی ⁦(5)⁩ دەکات: پێنج بە پانیی ⁦10⁩ و 8، ⁦26⁩، ⁦30⁩، ⁦20⁩ و ⁦16⁩. ستوونێک بۆ XiX_i و ستوونێک بۆ لێکدانەکان XiFiX_iF_i زیاد بکە:

Table (6), corrected: the first product is 8⋅25=2008 \cdot 25 = 200خشتەی ⁦(6)⁩، ڕاستکراوە: یەکەم لێکدان 8⋅25=2008 \cdot 25 = 200ـە
ClassFiF_iXiX_iXiFiX_iF_i
20–30825200
30–402635910
40–5030451350
50–6020551100
60–7016651040
Totalکۆ∑Fi=100\sum F_i = 100∑XiFi=4600\sum X_iF_i = 4600
Xˉ=∑XiFi∑Fi=4600100=46\bar X = \frac{\sum X_iF_i}{\sum F_i} = \frac{4600}{100} = 46
Quick checkپشکنینی خێراWhich number do you divide ∑XiFi\sum X_iF_i by?∑XiFi\sum X_iF_i دابەشی کام ژمارە دەکەیت؟

Example (3): the mean of a frequency tableنموونەی ⁦(3)⁩: ناوەندی خشتەیەکی دووبارەبوونەوە

Example (3) as a picture, and a correctionنموونەی ⁦(3)⁩ وەک وێنە و ڕاستکردنەوەیەک

Histogram of Table (5) with classes 20–30 to 60–70 and heights 8, 26, 30, 20, 16. A dot marks each class midpoint 25, 35, 45, 55, 65 at the top of its bar. A support triangle under the axis at 46 shows the mean 4600 ÷ 100 = 46.هیستۆگرامی خشتەی (5) بە کلاسەکانی 20–30 تا 60–70 و بەرزیی 8، 26، 30، 20، 16. لە سەری هەر ستوونێک خاڵێک خاڵی ناوەڕاستی کلاسەکەی (25، 35، 45، 55، 65) دیاری دەکات. سێگۆشەیەکی ڕاگرتن لە ژێر تەوەرەکە لە 46 ناوەندەکە پیشان دەدات: 4600 ÷ 100 = 46.
Every class counts as its midpoint, F times; the histogram balances at 46.هەر وەک F جار هەژمار دەکرێت؛ لە ⁦46⁩ هاوسەنگ دەبێت.CêIT
Quick checkپشکنینی خێراA quick check: the mean of a frequency table must lie…پشکنینێکی خێرا: دەبێت…

The weighted mean: when some values count moreناوەندی قورسکراو: کاتێک هەندێک نرخ زیاتر هەژمار دەکرێن

In the arithmetic mean every value counts once. Sometimes values deserve different importance: a course with 3 hours a week should count more in a student's average than a course with 2 hours. The importance of each value is a number WiW_i, its weight.

لە هەر نرخێک یەک جار هەژمار دەکرێت. هەندێک جار نرخەکان گرنگیی جیاوازیان هەیە: وانەیەک کە هەفتانە 3 کاتژمێرە دەبێت لە تێکڕای قوتابیدا زیاتر هەژمار بکرێت لە وانەیەکی 2 کاتژمێری. گرنگیی هەر نرخێک ژمارەیەکە WiW_i، .

Definitionپێناسە

A in which some values count more than others: xˉw=∑wixi∑wi\bar{x}_w = \frac{\sum w_i x_i}{\sum w_i}, where wiw_i is each value's .

کە تێیدا هەندێک نرخ لە هەندێکی تر زیاتر هەژمار دەکرێن: xˉw=∑wixi∑wi\bar{x}_w = \frac{\sum w_i x_i}{\sum w_i}، کە wiw_i هەر نرخێکە.

XˉW=∑i=1nXiWi∑i=1nWi\bar X_W = \frac{\sum_{i=1}^{n} X_i W_i}{\sum_{i=1}^{n} W_i}

Multiply each value by its weight, add, and divide by the sum of the weights. If all weights are equal, they cancel and you get the ordinary mean.

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

Buying tomatoes in the bazaarکڕینی تەماتە لە بازاڕ

You buy 2 kg of tomatoes at 1000 dinars a kilo and 1 kg at 1500 dinars. The average price per kilo is not (1000+1500)/2=1250(1000+1500)/2 = 1250: you paid 2⋅1000+1⋅1500=35002 \cdot 1000 + 1 \cdot 1500 = 3500 for 3 kg, which is about 1167 dinars a kilo. The kilos are the weights.

2 کیلۆ تەماتە بە کیلۆی ⁦1000⁩ دینار و 1 کیلۆ بە ⁦1500⁩ دینار دەکڕیت. تێکڕای نرخی کیلۆیەک (1000+1500)/2=1250(1000+1500)/2 = 1250 نییە: 2⋅1000+1⋅1500=35002 \cdot 1000 + 1 \cdot 1500 = 3500 دینارت بۆ 3 کیلۆ داوە، واتە نزیکەی ⁦1167⁩ دینار بۆ هەر کیلۆیەک. کیلۆکان .

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

Here the weights are real amounts. In other uses, such as marks and hours, the weights are a decision about importance that someone has to make.

لێرەدا بڕی ڕاستەقینەن. لە بەکارهێنانی تردا، وەک نمرە و کاتژمێر، بڕیارێکن دەربارەی گرنگی کە کەسێک دەبێت بیدات.

Quick checkپشکنینی خێرا3 kg of apples cost 2000 dinars a kilo and 1 kg costs 1000 dinars. What is the mean price per kilo?3 کیلۆ سێو کیلۆی بە ⁦2000⁩ دینار و 1 کیلۆ بە ⁦1000⁩ دینار. تێکڕای نرخی کیلۆیەک چەندە؟

Example (4): marks and course hoursنموونەی ⁦(4)⁩: نمرە و کاتژمێری وانەکان

A student has seven marks: 62, 80, 75, 88, 84, 86 and 90. The first three courses have 2 hours a week and the last four have 3 hours. Find the weighted mean with the hours as weights.

قوتابییەک حەوت نمرەی هەیە: ⁦62⁩، ⁦80⁩، ⁦75⁩، ⁦88⁩، ⁦84⁩، ⁦86⁩ و ⁦90⁩. سێ وانەی یەکەم هەفتانە 2 کاتژمێرن و چوار وانەی کۆتایی 3 کاتژمێر. بدۆزەرەوە، کاتژمێرەکان .

Table (8)خشتەی ⁦(8)⁩
CourseوانەMark XiX_iنمرە XiX_iHours WiW_iکاتژمێر WiW_iXiWiX_iW_i
Course 1وانەی 1622124
Course 2وانەی 2802160
Course 3وانەی 3752150
Course 4وانەی 4883264
Course 5وانەی 5843252
Course 6وانەی 6863258
Course 7وانەی 7903270
Totalکۆ∑Wi=18\sum W_i = 18∑XiWi=1478\sum X_iW_i = 1478
XˉW=147818=82.111Xˉ=5657=80.714\bar X_W = \frac{1478}{18} = 82.111 \qquad\qquad \bar X = \frac{565}{7} = 80.714

The weighted mean XˉW\bar X_W (82.111) is higher than the plain mean Xˉ\bar X of the seven marks (80.714).

XˉW\bar X_W ⁦(82.111)⁩ لە ئاسایی حەوت نمرەکە Xˉ\bar X ⁦(80.714)⁩ بەرزترە.

Quick checkپشکنینی خێراWhy is the weighted mean higher than the plain mean here?بۆچی لێرەدا لە ئاسایی بەرزترە؟

Example (4): marks and course hoursنموونەی ⁦(4)⁩: نمرە و کاتژمێری وانەکان

Seeing the weightsبینینی کێشەکان

Seven bars: widths 2, 2, 2, 3, 3, 3, 3 hours and heights 62, 80, 75, 88, 84, 86, 90. A dashed line at 80.71 marks the plain mean and a solid green line at 82.11 marks the weighted mean, which is higher because the wide 3-hour bars are tall.حەوت ستوون: پانییان 2، 2، 2، 3، 3، 3، 3 کاتژمێر و بەرزییان 62، 80، 75، 88، 84، 86، 90. هێڵێکی پچڕپچڕ لە 80.71 ناوەندی ئاسایی پیشان دەدات و هێڵێکی سەوزی تەواو لە 82.11 ناوەندی قورسکراو پیشان دەدات، کە بەرزترە چونکە ستوونە پانە 3 کاتژمێرییەکان بەرزن.
Area = mark × hours. The weighted mean is the height of one bar with the same total area.ڕووبەر = نمرە × کاتژمێر. بەرزیی یەک ستوونە کە هەمان کۆی ڕووبەری هەبێت.CêIT

The weighted mean of grouped dataناوەندی قورسکراوی دراوەی پۆلێنکراو

In a frequency table each class already counts FiF_i times. If each class also has a weight WiW_i, its midpoint counts Fi×WiF_i \times W_i times:

لە هەر پێشتر FiF_i جار هەژمار دەکرێت. ئەگەر هەر WiW_iـیشی هەبێت، Fi×WiF_i \times W_i جار هەژمار دەکرێت:

XˉW=∑XiFiWi∑FiWi\bar X_W = \frac{\sum X_i F_i W_i}{\sum F_i W_i}
Example (5): Tables (9) and (10)نموونەی ⁦(5)⁩: خشتەکانی ⁦(9)⁩ و ⁦(10)⁩
ClassXiX_iFiF_iWiW_iFiWiF_iW_iXiFiWiX_iF_iW_i
2–43462472
4–655525125
6–876636252
8–1093412108
10–121124888
Totalکۆ∑FiWi=105\sum F_iW_i = 105∑XiFiWi=645\sum X_iF_iW_i = 645
XˉW=645105=6.1429\bar X_W = \frac{645}{105} = 6.1429

The notes write 6.142, cutting off the last digit; to four decimal places it is 6.1429. Without the weights the grouped mean would be 128/20=6.4128/20 = 6.4.

تێبینییەکان ⁦6.142⁩ دەنووسن و دوایین ژمارە دەبڕن؛ بە چوار دەکاتە ⁦6.1429⁩. بەبێ پۆلێنکراو دەبوو بە 128/20=6.4128/20 = 6.4.

Quick checkپشکنینی خێراIn Example (5), what does the class 6–8 add to the bottom of the fraction?لە نموونەی ⁦(5)⁩دا، ⁦6–8⁩ چەند دەخاتە سەر بەشی خوارەوەی کەرتەکە؟

Means in Pythonناوەندەکان لە Pythonـدا

Python's statistics module has mean() for ordinary data and fmean(), which accepts weights (Python 3.11 and later). The same function gives the grouped mean (weights = frequencies) and the weighted mean (weights = hours, or Fi×WiF_i \times W_i).

statisticsـی Python mean()ـی بۆ ئاسایی هەیە و fmean() کە weights وەردەگرێت (⁦Python 3.11⁩ و دواتر). هەمان پۆلێنکراو دەدات ( = ) و ( = کاتژمێرەکان، یان Fi×WiF_i \times W_i).

PYTHONType in a terminalلە تێرمیناڵدا بینووسە
import statistics as st

values = [8, 3, 5, 12, 10]                 # Example 2
print(st.mean(values))

midpoints = [25, 35, 45, 55, 65]           # Example 3
freq = [8, 26, 30, 20, 16]
print(st.fmean(midpoints, weights=freq))

marks = [62, 80, 75, 88, 84, 86, 90]       # Example 4
hours = [2, 2, 2, 3, 3, 3, 3]
print(round(st.fmean(marks, weights=hours), 4))
print(round(st.mean(marks), 4))            # no weights

X = [3, 5, 7, 9, 11]                       # Example 5
F = [4, 5, 6, 3, 2]
W = [6, 5, 6, 4, 4]
FW = [f * w for f, w in zip(F, W)]
print(FW)
print(round(st.fmean(X, weights=FW), 4))
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 4

mean() adds and divides by the number of values: 7.6.

mean() کۆ دەکاتەوە و دابەشی ژمارەی نرخەکان دەکات: ⁦7.6⁩.

Lineدێڕی 6-8

Midpoints with frequencies as weights give the grouped mean of Example (3): 46, not 44.

لەگەڵ وەک پۆلێنکراوی نموونەی ⁦(3)⁩ دەدەن: ⁦46⁩، نەک ⁦44⁩.

Lineدێڕی 10-13

Hours as weights: 82.1111; without weights: 80.7143.

کاتژمێرەکان وەک : ⁦82.1111⁩؛ بەبێ : ⁦80.7143⁩.

Lineدێڕی 15-20

For Example (5) the weight of each midpoint is Fi×WiF_i \times W_i.

بۆ نموونەی ⁦(5)⁩ هەر Fi×WiF_i \times W_iـە.

Quick checkپشکنینی خێراWhich call gives the weighted mean of marks with hours as weights?کام بانگکردن marks بە hours وەک دەدات؟

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

MistakeهەڵەWhat goes wrongچی تێک دەچێتDo this insteadلە جیاتی ئەوە
Dividing by the number of classesدابەشکردن بەسەر ژمارەی Example (3) gives 4600÷5=9204600 \div 5 = 920 — outside the dataنموونەی ⁦(3)⁩ دەبێتە 4600÷5=9204600 \div 5 = 920 — لە دەرەوەی Divide by ∑Fi\sum F_iدابەشی ∑Fi\sum F_i بکە
Averaging the midpoints without FiF_iتێکڕای بەبێ FiF_i(25+35+45+55+65)÷5=45(25 + 35 + 45 + 55 + 65) \div 5 = 45: every class counts once(25+35+45+55+65)÷5=45(25 + 35 + 45 + 55 + 65) \div 5 = 45: هەر یەک جار هەژمار دەکرێتMultiply each midpoint by its frequencyهەر لە بدە
Using a class limit instead of the midpointبەکارهێنانی لە جیاتی Every value is pushed to one end of its classهەموو نرخەکان بۆ یەک لێواری پاڵ دەنرێنXi=(LL+UL)/2X_i = (LL + UL)/2Xi=(LL+UL)/2X_i = (LL + UL)/2
Weighted mean divided by nn دابەش بە nnExample (4): 1478÷7=211.11478 \div 7 = 211.1, more than any markنموونەی ⁦(4)⁩: 1478÷7=211.11478 \div 7 = 211.1، لە هەموو نمرەیەک زیاترDivide by ∑Wi=18\sum W_i = 18دابەشی ∑Wi=18\sum W_i = 18 بکە
Averaging two averagesتێکڕای دوو تێکڕاGroups of 20 (mean 70) and 30 (mean 80) give 76, not 75گرووپی ⁦20⁩ کەسی ( ⁦70⁩) و ⁦30⁩ کەسی ( ⁦80) 76⁩ دەدەن، نەک ⁦75⁩Weight each mean by its group sizeهەر بە قەبارەی گرووپەکەی قورس بکە
Trusting one multiplicationمتمانەکردن بە یەک لێکدانThe 44 instead of 46 in Example (3)⁦44⁩ لە جیاتی ⁦46⁩ لە نموونەی ⁦(3)⁩داRedo the products, or check with Pythonلێکدانەکان دووبارە بکەرەوە، یان بە Python بیپشکنە
Quick checkپشکنینی خێراTwo classes take the same quiz. Class A has 20 students with mean 70; class B has 30 students with mean 80. What is the mean of all 50 students?دوو پۆل هەمان تاقیکردنەوە دەکەن. پۆلی ⁦A 20⁩ قوتابیی هەیە بە ⁦70⁩؛ پۆلی ⁦B 30⁩ قوتابیی هەیە بە ⁦80⁩. هەر ⁦50⁩ قوتابییەکە چەندە؟

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

The mean and extreme valuesناوەند و نرخە زۆر دوورەکان

Quick checkپشکنینی خێراFive friends earn 400, 450, 500, 550 and 600 thousand dinars a month (mean 500). A sixth friend earns 5000. What happens to the mean of the six?پێنج هاوڕێ مانگانە ⁦400⁩، ⁦450⁩، ⁦500⁩، ⁦550⁩ و ⁦600⁩ هەزار دینار وەردەگرن ( ⁦500⁩). هاوڕێیەکی شەشەم ⁦5000⁩ وەردەگرێت. شەش کەسەکە چی بەسەر دێت؟

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

ExerciseڕاهێنانA missing valueنرخێکی ون

The mean of five numbers is 9. Four of them are 7, 12, 5 and 10. What is the fifth number?

پێنج ژمارە 9ـە. چواریان 7، ⁦12⁩، 5 و ⁦10⁩ن. ژمارەی پێنجەم چەندە؟

Hintئاماژە

Xˉ×n=∑Xi\bar X \times n = \sum X_i: the mean times the number of values gives the sum.

Xˉ×n=∑Xi\bar X \times n = \sum X_i: جارانی ژمارەی نرخەکان کۆکە دەدات.

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

The five numbers must add up to 5⋅9=455 \cdot 9 = 45. The four known ones add up to 34, so the fifth is 45−34=1145 - 34 = 11.

پێنج ژمارەکە دەبێت کۆکەیان 5⋅9=455 \cdot 9 = 45 بێت. کۆی چوار ژمارە زانراوەکە ⁦34⁩ـە، کەواتە پێنجەم 45−34=1145 - 34 = 11ـە.

ExerciseڕاهێنانThe grouped mean of H.W (2)ناوەندی پۆلێنکراوی ڕاهێنانی ⁦(2)⁩

Table (4) of H.W (2) in the graphs lesson has eight classes 0–10, 10–20, …, 70–80 with frequencies 2, 8, 12, 18, 28, 22, 6, 4. Find its arithmetic mean.

خشتەی ⁦(4)⁩ی ڕاهێنانی ⁦(2)⁩ لە وانەی هێڵکارییەکان هەشت هەیە: ⁦0–10⁩، ⁦10–20⁩، …، ⁦70–80⁩، بە 2، 8، ⁦12⁩، ⁦18⁩، ⁦28⁩، ⁦22⁩، 6، 4. بدۆزەرەوە.

Hintئاماژە

Make the columns XiX_i and XiFiX_iF_i first.

سەرەتا ستوونەکانی XiX_i و XiFiX_iF_i دروست بکە.

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

Midpoints 5, 15, …, 75. ∑XiFi=10+120+300+630+1260+1210+390+300=4220\sum X_iF_i = 10 + 120 + 300 + 630 + 1260 + 1210 + 390 + 300 = 4220 and ∑Fi=100\sum F_i = 100, so Xˉ=4220/100=42.2\bar X = 4220/100 = 42.2.

5، ⁦15⁩، …، ⁦75⁩. ∑XiFi=10+120+300+630+1260+1210+390+300=4220\sum X_iF_i = 10 + 120 + 300 + 630 + 1260 + 1210 + 390 + 300 = 4220 و ∑Fi=100\sum F_i = 100، کەواتە Xˉ=4220/100=42.2\bar X = 4220/100 = 42.2.

ExerciseڕاهێنانA semester averageتێکڕای وەرزێک

Hana's marks this semester: Mathematics 65 (4 units), Programming 92 (4 units), English 80 (2 units), Kurdish 95 (1 unit). Find her weighted average and compare it with the plain average.

نمرەکانی هانا لەم وەرزەدا: بیرکاری ⁦65 (4⁩ یەکە)، ⁦92 (4⁩ یەکە)، ئینگلیزی ⁦80 (2⁩ یەکە)، کوردی ⁦95 (1⁩ یەکە). بدۆزەرەوە و بەراوردی بکە بە تێکڕا ئاساییەکەی.

Show answerوەڵامەکە پیشان بدە
XˉW=65⋅4+92⋅4+80⋅2+95⋅14+4+2+1=88311=80.27Xˉ=3324=83\bar X_W = \frac{65\cdot4 + 92\cdot4 + 80\cdot2 + 95\cdot1}{4+4+2+1} = \frac{883}{11} = 80.27 \qquad \bar X = \frac{332}{4} = 83

The plain average (83) treats the 1-unit course like the 4-unit ones. The weighted average (80.27) is lower because the 4-unit Mathematics mark is low.

تێکڕا ئاساییەکە ⁦(83)⁩ وانە 1 یەکەییەکە وەک وانە 4 یەکەییەکان هەژمار دەکات. ⁦(80.27)⁩ نزمترە چونکە نمرەی بیرکاریی 4 یەکەیی نزمە.

ExerciseڕاهێنانSpot the slipهەڵەکە بدۆزەرەوە

A solution to Example (3) writes ∑XiFi=4400\sum X_iF_i = 4400 and Xˉ=44\bar X = 44. Without redoing the whole table, how can you find the slip?

چارەسەرێکی نموونەی ⁦(3)⁩ ∑XiFi=4400\sum X_iF_i = 4400 و Xˉ=44\bar X = 44 دەنووسێت. بەبێ دووبارەکردنەوەی هەموو خشتەکە، چۆن هەڵەکە دەدۆزیتەوە؟

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

Check each product: 910, 1350, 1100 and 1040 are right, but the first row is 8⋅25=2008 \cdot 25 = 200. With it the sum is 4600 and the mean 46. Python's fmean([25, 35, 45, 55, 65], weights=[8, 26, 30, 20, 16]) also gives 46.0.

هەر لێکدانێک بپشکنە: ⁦910⁩، ⁦1350⁩، ⁦1100⁩ و ⁦1040⁩ ڕاستن، بەڵام ڕیزی یەکەم 8⋅25=2008 \cdot 25 = 200ـە. لەگەڵ ئەودا کۆکە ⁦4600⁩ و ⁦46⁩ـە. fmean([25, 35, 45, 55, 65], weights=[8, 26, 30, 20, 16])ـی Pythonـیش ⁦46.0⁩ دەدات.

ExerciseڕاهێنانBalance checkپشکنینی هاوسەنگی

Dilan's quiz marks are 12, 15, 11, 18 and 14. Find the mean and check that the deviations add up to zero.

نمرەکانی تاقیکردنەوەی دیلان ⁦12⁩، ⁦15⁩، ⁦11⁩، ⁦18⁩ و ⁦14⁩ن. بدۆزەرەوە و بپشکنە کە کۆی سفرە.

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

Xˉ=70/5=14\bar X = 70/5 = 14. Deviations: −2,+1,−3,+4,0-2, +1, -3, +4, 0; their sum is −2+1−3+4+0=0-2 + 1 - 3 + 4 + 0 = 0.

Xˉ=70/5=14\bar X = 70/5 = 14. : −2,+1,−3,+4,0-2, +1, -3, +4, 0؛ کۆکەیان −2+1−3+4+0=0-2 + 1 - 3 + 4 + 0 = 0ـە.

Summaryپوختە

  • Ungrouped mean: Xˉ=∑Xi/n\bar X = \sum X_i / n. It is the balance point: ∑(Xi−Xˉ)=0\sum (X_i - \bar X) = 0.
  • Grouped mean: midpoints stand for their classes, Xˉ=∑XiFi/∑Fi\bar X = \sum X_iF_i / \sum F_i. It is an estimate.
  • Weighted mean: XˉW=∑XiWi/∑Wi\bar X_W = \sum X_iW_i / \sum W_i; grouped: ∑XiFiWi/∑FiWi\sum X_iF_iW_i / \sum F_iW_i. A GPA is a weighted mean.
  • Example (3)'s correct mean is 46 (the notes' 44 comes from a wrong product).
  • In Python: statistics.mean() and statistics.fmean(data, weights=...).
  • : Xˉ=∑Xi/n\bar X = \sum X_i / n. خاڵی هاوسەنگییە: ∑(Xi−Xˉ)=0\sum (X_i - \bar X) = 0.
  • : جێگەی دەگرنەوە، Xˉ=∑XiFi/∑Fi\bar X = \sum X_iF_i / \sum F_i. نزیکەییە.
  • : XˉW=∑XiWi/∑Wi\bar X_W = \sum X_iW_i / \sum W_i؛ بۆ : ∑XiFiWi/∑FiWi\sum X_iF_iW_i / \sum F_iW_i. تێکڕای نمرەی زانکۆ .
  • ڕاستی نموونەی ⁦(3) 46⁩ـە (⁦44⁩ـی تێبینییەکان لە لێکدانێکی هەڵەوە هاتووە).
  • لە Pythonـدا: statistics.mean() و statistics.fmean(data, weights=...).
Review questionsپرسیارەکانی پێداچوونەوە
Why do we multiply each midpoint by its frequency?بۆچی هەر خاڵێکی ناوەڕاستی کلاس لە دووبارەبوونەوەکەی دەدەین؟

Because the midpoint stands for all FiF_i values of its class, so it must be counted FiF_i times.

چونکە جێگەی هەموو FiF_i نرخەکەی دەگرێتەوە، بۆیە دەبێت FiF_i جار هەژمار بکرێت.

When does the weighted mean equal the ordinary mean?ناوەندی قورسکراو کەی یەکسانە بە ناوەندی ئاسایی؟

When all weights are equal: they cancel from the top and the bottom.

کاتێک هەموو یەکسان بن: لە سەرەوە و خوارەوە لادەچن.

A list has mean 20. What is the sum of the deviations from 20?لیستێک ناوەندەکەی ⁦20⁩ـە. کۆی لادانەکان لە ⁦20⁩ چەندە؟

0 — always, for any list.

0 — هەمیشە، بۆ هەر لیستێک.

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

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

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

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

Geometric, Harmonic and Quadratic Meansناوەندی ئەندازەیی، ناوەندی هارمۆنیک و ناوەندی دووجایی

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

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