Chapterبەش 2 · Lectureوانە 2.3
Product (Π) Notationنیشانەی پی (Π)
Π is to multiplication what Σ is to addition. Learn to read and expand Π, the ten rules (constants become powers, roots and fractions move over the whole product, logarithms turn Π into Σ), the course's full worked example, the classic mistake, and Π in Python with math.prod().
Π بۆ لێکدان وەک Σـە بۆ کۆکردنەوە. فێر دەبیت Π بخوێنیتەوە و بیکەیتەوە، دە یاساکە ( دەبنە ، ڕەگ و بەسەر هەموو لێکدانەکەدا دەڕۆن، Π دەکاتە Σ)، نموونە شیکراوە تەواوەکەی کۆرسەکە، هەڵە باوەکەی و Π لە Pythonـدا بە math.prod().
What you will learnچی فێر دەبیت
- Read and expand a product written with Π.
- Use the ten product rules, and explain why a constant becomes .
- Turn a product into a sum with logarithms.
- Compute products in Python with
math.prod()or a loop that starts at 1.
- لێکدانێک کە بە Π نووسراوە بخوێنیتەوە و بیکەیتەوە.
- دە یاسای لێکدان بەکار بهێنیت و ڕوونی بکەیتەوە بۆچی دەبێتە .
- بە لێکدانێک بکەیتە کۆ.
- لە Pythonـدا بە
math.prod()یان کە لە 1 دەست پێدەکات لێکدان بژمێریت.
From Σ to Π: a short way to write a long multiplicationلە Σـەوە بۆ Π: ڕێگایەکی کورت بۆ نووسینی لێکدانێکی درێژ
In Sigma notation you met Σ, a short way to write a long sum. Statistics also needs long products. For example, the geometric mean in a later lesson multiplies all the values together. For a long product we use the Greek capital letter Π (pi). Think of it as the letter P for product.
لە نیشانەی سیگما Σـت ناسی، ڕێگایەکی کورت بۆ نووسینی کۆکردنەوەیەکی درێژ. پێویستی بە لێکدانی درێژیش هەیە. بۆ نموونە ناوەندی ئەندازەیی لە وانەیەکی داهاتوودا هەموو نرخەکان پێکەوە لێک دەدات. بۆ لێکدانێکی درێژ پیتی گەورەی گریکیی Π (پی) بەکار دەهێنین. وەک پیتی Pـی وشەی ئینگلیزیی product (لێکدان) بیری لێ بکەرەوە.
A short way to write a long multiplication with the Greek capital (pi): .
ڕێگایەکی کورتە بۆ نووسینی لێکدانێکی درێژ بە پیتی گەورەی گریکیی (پی): .
Read it as “the product of X sub i, for i from 1 to n”. The subscript i starts at the number under Π and stops at the number on top. For every value of i you write one factor, and then you multiply all the factors.
بەم شێوەیە بیخوێنەرەوە: «لێکدانی X ژێر i، بۆ i لە 1 تا n». i لەو ژمارەیەوە دەست پێدەکات کە لە ژێر Πـەوەیە و لەو ژمارەیەدا دەوەستێت کە لە سەرییەتی. بۆ هەر نرخێکی i یەک بەش دەنووسیت، پاشان هەموو بەشەکان لێک دەدەیت.
Σ and Π work the same way. The only difference is the operation: Σ adds, Π multiplies. Because of that, they also start from different numbers:
Σ و Π بە هەمان شێوە کار دەکەن. تاکە جیاوازی ئەو ژمێریارییەیە کە دەیکەن: Σ کۆ دەکاتەوە و Π لێک دەدات. لەبەر ئەمە لە دوو ژمارەی جیاوازیشەوە دەست پێدەکەن:
Reading Π step by stepخوێندنەوەی Π هەنگاو بە هەنگاو
- Write one factor for each iبۆ هەر iـیەک یەک بەش بنووسە
With : .
بە : .
- Put in the valuesنرخەکان دابنێ
If , the product is .
ئەگەر بێت، بەدەست دێت.
- Multiplyلێکیان بدە
, , . So .
، ، . کەواتە .
Reading Π step by stepخوێندنەوەی Π هەنگاو بە هەنگاو
Products in daily life: price changesلێکدان لە ژیانی ڕۆژانەدا: گۆڕانی نرخ
A phone in the Sulaimani bazaar gets 10% more expensive in one month (), 5% more the next month (), and then 10% cheaper (). The total change is a product: , so the price went up by 3.95% — not by . Changes that multiply are combined with Π, not with Σ.
مۆبایلێک لە بازاڕی سلێمانی لە مانگێکدا 10% گران دەبێت ()، مانگی دواتر 5% () و پاشان 10% هەرزان دەبێت (). کۆی گۆڕانەکە لێکدانێکە: ، کەواتە نرخەکە 3.95% بەرز بووەتەوە — نەک . گۆڕانە لێکدراوەکان بە Π پێکەوە دەبەسترێن، نەک بە Σ.
Where the analogy stops workingسنووری ئەم نموونەیە
This works only for changes in per cent (factors). If the shop simply adds 5,000 dinars each month, the changes add up and Σ is the right tool.
ئەمە تەنها بۆ گۆڕانی لە سەدا (لێکدەر) ڕاستە. ئەگەر دوکانەکە هەموو مانگێک تەنها 5,000 دینار زیاد بکات، گۆڕانەکان کۆ دەبنەوە و Σ ئامرازی دروستە.
Π in Python: math.prod() and a loopΠ لە Pythonـدا: math.prod() و خولێک
A Π is a loop that multiplies, just as a Σ is a loop that adds. Python can do it in two ways: the ready-made math.prod() (Python 3.8 and later) or your own for loop.
Π کە لێک دەدات، هەروەک چۆن Σ کە کۆ دەکاتەوە. Python دەتوانێت بە دوو ڕێگا بیکات: math.prod()ـی ئامادە (Python 3.8 و دواتر) یان کە خۆت دەینووسیت.
import math
X = [2, 3, 4, 5]
print(math.prod(X)) # built-in product (Python 3.8+)
product = 1 # start at 1, not 0
for x in X:
product = product * x
print(product)
print(math.prod([])) # empty product
print(sum([])) # empty sum120 120 1 0
Explain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 4
math.prod()multiplies every item of the list.math.prod()هەموو ئەندامێکی لیستەکە لێک دەدات.- Lineدێڕی 6-8
The loop version. The running product must start at 1: starting at 0 would make every result 0.
وەشانی خول. لێکدانە بەردەوامەکە دەبێت لە 1 دەست پێبکات: دەستپێکردن لە 0 هەموو ئەنجامێک دەکاتە 0.
- Lineدێڕی 11-12
With no factors at all, a product is 1 and a sum is 0 — the two starting values.
کاتێک هیچ بەشێک نییە، لێکدان دەکاتە 1 و کۆ دەکاتە 0 — هەمان دوو نرخی دەستپێک.
Rules 1–3: a constant becomes a powerیاساکانی 1–3: نەگۆڕ دەبێتە توان
In the rules of this lesson, and are two lists of values, and and are two constants (numbers that do not change with i).
لە یاساکانی ئەم وانەیەدا، و دوو لیستی نرخن و و دوو (ژمارەگەلێک کە بە گۆڕانی i ناگۆڕێن).
Rule 1: n copies of the same number a multiply to a to the power n.
یاسای 1: n دانە لە هەمان ژمارەی a لێک بدەیت، دەکاتە a بە n.
Why rule 2 has and not : write the product out. With it is . Every factor brings its own a, so there are four a's: . Rule 3 is the same idea twice: n copies of a and n copies of b, so , which is also .
بۆچی یاسای 2 ـی تێدایە نەک : لێکدانەکە بە درێژی بنووسە. بە دەکاتە . هەر بەشێک aـی خۆی لەگەڵ خۆیدا دەهێنێت، بۆیە چوار a هەیە: . یاسای 3 هەمان بیرۆکەیە دوو جار: n دانە a و n دانە b، کەواتە کە هەمان ـیشە.


| Σ (sum)Σ (کۆ) | Π (product)Π (لێکدان) |
|---|---|
Rules 4, 5, 7, 8 and 10: fractions, roots and powersیاساکانی 4، 5، 7، 8 و 10: کەرت، ڕەگ و توان
All five rules come from one fact: in a multiplication you may change the order of the factors and group them as you like. So you can multiply all the tops together and all the bottoms together (rules 4, 5, 10), or all the roots or powers together (rules 7, 8). Rule 5 is rule 4 with an a on every top, so the 's collect into , as in rule 2.
هەر پێنج یاساکە لە یەک ڕاستییەوە دێن: لە لێکداندا دەتوانیت ڕیزبەندیی بەشەکان بگۆڕیت و چۆنت پێ خۆشە گرووپیان بکەیت. بۆیە دەتوانیت هەموو پێکەوە و هەموو پێکەوە لێک بدەیت (یاساکانی 4، 5، 10)، یان هەموو ڕەگەکان یان پێکەوە (یاساکانی 7، 8). یاسای 5 هەمان یاسای 4ـە، بەڵام لە هەموو a هەیە، بۆیە ـەکان کۆ دەبنەوە بۆ ، وەک یاسای 2.
Quick check of rule 7 with : and .
پشکنینێکی خێرای یاسای 7 بە : و .
Rules 6 and 9: a logarithm turns Π into Σیاساکانی 6 و 9: لۆگاریتم Π دەکاتە Σ
In this course means the base-10 logarithm, . The values must be positive.
لەم کۆرسەدا واتە بە 10، واتە . نرخەکانی دەبێت بن.
Both rules come from two laws of logarithms: the log of a product is the sum of the logs, , and a power comes down in front, . Rule 9 uses both: each factor gives , and the product turns into a sum. These laws are explained in Logarithmic functions.
هەردوو یاسا لە دوو یاسای دێن. لێکدانێک کۆی : . هەروەها دێتە پێشەوە: . یاسای 9 هەردووکیان بەکار دەهێنێت: هەر بەشێکی دەبێتە و لێکدانەکە دەبێتە کۆ. ئەم یاسایانە لە نەخشە لۆگاریتمییەکان ڕوون کراونەتەوە.
Check rule 6 with : , and .
پشکنینی یاسای 6 بە : و .
Worked example: the ten rules on one data setنموونەی شیکراوە: دە یاساکە لەسەر یەک کۆمەڵە نرخ
The course's product example uses four values of three lists and two constants:
نموونەی لێکدانی کۆرسەکە چوار نرخی سێ لیست و دوو بەکار دەهێنێت:
First find the three basic products once: , , . Every rule then needs only one or two more steps.
سەرەتا سێ لێکدانە سەرەکییەکە یەک جار بدۆزەرەوە: ، ، . پاشان هەر یاسایەک تەنها پێویستی بە یەک یان دوو هەنگاوی ترە.
Worked example: the ten rules on one data setنموونەی شیکراوە: دە یاساکە لەسەر یەک کۆمەڵە نرخ
Rules 1–5 workedیاساکانی 1–5 بە شیکردنەوە
- Rule 1یاسای 1
- Rule 2یاسای 2
- Rule 3یاسای 3
. Here and .
. لێرەدا و .
- Rule 4یاسای 4
- Rule 5یاسای 5
Worked example: the ten rules on one data setنموونەی شیکراوە: دە یاساکە لەسەر یەک کۆمەڵە نرخ
Rules 6–10 workedیاساکانی 6–10 بە شیکردنەوە
- Rule 6یاسای 6
- Rule 7یاسای 7
- Rule 8یاسای 8
- Rule 9یاسای 9
. With rule 9 directly: . Keep extra digits in the middle steps: with logs rounded to 4 places first you would get 8.2200.
. ڕاستەوخۆ بە یاسای 9: . لە هەنگاوەکانی ناوەڕاستدا ژمارەی زیاتر بهێڵەرەوە: ئەگەر سەرەتا بۆ 4 خانە نزیک بکەیتەوە، 8.2200 بەدەست دێت.
- Rule 10یاسای 10
import math
X = [2, 3, 4, 5]
Y = [1, 2, 3, 4]
A = [2, 4, 6, 3]
a, b, n = 2, 3, 4
print(math.prod(a * x for x in X)) # rule 2
print(a ** n * math.prod(X)) # a^n * prod X
print(math.prod(a * x * b * y for x, y in zip(X, Y))) # rule 3
print(round(math.log10(math.prod(X)), 4)) # rule 6, left side
print(round(sum(math.log10(x) for x in X), 4)) # rule 6, right side
print(round(sum(k * math.log10(x) for x, k in zip(X, A)), 4)) # rule 91920 1920 3732480 2.0792 2.0792 8.2198
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | Why it is wrongبۆچی هەڵەیە | Correctدروست |
|---|---|---|
| Each of the n factors has its own a.هەر یەک لە n بەشەکە aـی خۆی هەیە. | ||
| Starting a product loop at 0دەستپێکردنی لێکدان لە 0 | 0 times anything is 0.0 جارانی هەر شتێک 0ـە. | Start at 1لە 1 دەست پێبکە |
| Π has no rule for a sum inside it ().Π هیچ یاسایەکی بۆ کۆ لە ناو خۆیدا نییە (). | Multiply the sums one by oneکۆکان یەک بە یەک لێک بدە | |
| The log of a product is a sum of logs. لێکدان کۆی . | ||
| Rounding each log early () هەر logـێک زوو () | Small errors add up in the sum.هەڵە بچووکەکان لە کۆکەدا کەڵەکە دەبن. | Keep 4 decimal places, round at the end4 بهێڵەرەوە و لە کۆتاییدا نزیکی بکەرەوە |
Rounding to 4 decimal places is explained in the next lesson, Rounding and decimal places.
بۆ 4 لە وانەی داهاتوودا ڕوون کراوەتەوە: نزیککردنەوە و خانە دەییەکان.
Exercisesڕاهێنانەکان
A solution page says: and (; ). Find the mistake and correct both answers.
لاپەڕەیەکی چارەسەر دەڵێت: و (؛ ). هەڵەکە بدۆزەرەوە و هەردوو وەڵامەکە ڕاست بکەرەوە.
Hintئاماژە
Write the product out factor by factor.
لێکدانەکە بەش بە بەش بە درێژی بنووسە.
Show answerوەڵامەکە پیشان بدە
The constant must appear once in each of the four factors. and .
دەبێت لە هەر یەک لە چوار بەشەکەدا یەک جار دەربکەوێت. و .
With and , find , and . Give decimals to 4 places.
بە و ، ، و بدۆزەرەوە. ژمارە دەییەکان بە 4 بنووسە.
Show answerوەڵامەکە پیشان بدە
Exercisesڕاهێنانەکان
More exercisesڕاهێنانی زیاتر
Compute . Which well-known number is it?
بدۆزەرەوە. ئەمە کام ژمارەی ناسراوە؟
Show answerوەڵامەکە پیشان بدە
. This is (5 factorial). In general ; factorials are used for counting in Counting and permutations.
. ئەمە ـە ( 5). بە گشتی ؛ لە ژماردن و گۆڕینەکان بۆ ژماردن بەکار دێت.
A very short code has 2 lowercase English letters followed by 2 digits, for example ka47. Write the number of possible codes as a product and compute it.
کۆدێکی زۆر کورت 2 پیتی بچووکی ئینگلیزی و دوای ئەوان 2 ژمارەی هەیە، بۆ نموونە ka47. ژمارەی کۆدە گونجاوەکان وەک لێکدانێک بنووسە و بیدۆزەرەوە.
Show answerوەڵامەکە پیشان بدە
. That is far too few for a real password: a computer can try them all in a moment. Counting like this is taught in Counting passwords; what makes a password safe today is in Why length beats complexity.
. ئەمە بۆ ڕاستەقینە زۆر کەمە: کۆمپیوتەرێک لە ساتێکدا هەموویان تاقی دەکاتەوە. ژماردنی لەم جۆرە لە ژماردنی تێپەڕەوشەکان فێر دەبیت؛ ئەوەی ئەمڕۆ سەلامەت دەکات لە بۆچی درێژی لە ئاڵۆزی بەهێزترەدایە.
Write a short Python program that prints for , then checks rule 6 by printing both and to 4 decimal places.
بەرنامەیەکی کورتی Python بنووسە کە بۆ چاپ بکات، پاشان یاسای 6 بپشکنێت بە چاپکردنی و بە 4 .
Show answerوەڵامەکە پیشان بدە
import math
X = [2, 3, 4, 5]
p = math.prod(X)
print(p)
print(round(math.log10(p), 4))
print(round(sum(math.log10(x) for x in X), 4))120 2.0792 2.0792
Summaryپوختە
- : one factor for each i, all multiplied. A product starts at 1.
- A constant comes out of Π as a power: , .
- Fractions, roots and powers can be taken over the whole product (rules 4, 5, 7, 8, 10).
- A logarithm turns Π into Σ: (rules 6 and 9).
- In Python:
math.prod(), or a loop that starts at 1.
- : بۆ هەر iـیەک یەک بەش و هەموویان لێک دەدرێن. لێکدان لە 1 دەست پێدەکات.
- لە Π وەک دێتە دەرەوە: ، .
- ، ڕەگ و دەکرێت بەسەر هەموو لێکدانەکەدا وەربگیرێن (یاساکانی 4، 5، 7، 8، 10).
- Π دەکاتە Σ: (یاساکانی 6 و 9).
- لە Pythonـدا:
math.prod()، یان کە لە 1 دەست پێدەکات.
What is ? چەندە؟
(rule 1).
(یاسای 1).
Why does a product loop start at 1?بۆچی خولی لێکدان لە 1 دەست پێدەکات؟
Because multiplying by 1 changes nothing; starting at 0 would make the result 0.
چونکە لێکدان لە 1 هیچ ناگۆڕێت؛ دەستپێکردن لە 0 ئەنجامەکە دەکاتە 0.
Which mean in this course is built on Π?کام ناوەند لەم کۆرسەدا لەسەر Π بنیات نراوە؟
The geometric mean, , usually found with logs (rule 6).
ناوەندی ئەندازەیی، ، کە زۆرجار بە log دەدۆزرێتەوە (یاسای 6).
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Rounding and Decimal Placesنزیککردنەوە و خانە دەییەکان
Related lecturesوانە پەیوەندیدارەکان
- Geometric, Harmonic and Quadratic Meansناوەندی ئەندازەیی، ناوەندی هارمۆنیک و ناوەندی دووجایی
- Exponential Functions and the Number eنەخشە توانییەکان و ژمارەی e
- Operators and Expressionsکارپێکەرەکان و دەربڕینەکان
- Logarithms and Their Rulesلۆگاریتمەکان و یاساکانیان
- Counting and Permutationsژماردن و گۆڕینەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.