Chapterبەش 4 · Lectureوانە 4.3
Counting and Permutationsژماردن و گۆڕینەکان
How to count outcomes without listing them: the multiplication principle (with tree diagrams and dependent choices), factorials and why zero factorial is 1, permutations with and without repetition, round tables, repeated letters such as STATISTICS, and what counting says about passwords and transposition ciphers.
چۆن بژمێریت بێ ئەوەی بیاننووسیت: (لەگەڵ و هەڵبژاردنی گرێدراو)، و بۆچی سفر 1ـە، بە دووبارەبوونەوە و بەبێ دووبارەبوونەوە، مێزی خڕ و پیتی دووبارەی وەک STATISTICS. لە کۆتاییدا دەبینیت ژماردن چی دەربارەی و دەڵێت.
What you will learnچی فێر دەبیت
- Use the multiplication principle, and add separate cases when one choice limits another.
- Compute , explain why , and count arrangements with and .
- Count seatings around a round table and arrangements of objects that look the same.
- Explain, with counting, why long random passwords are strong and why a transposition cipher alone is weak.
- بەکار بهێنیت و کاتێک هەڵبژاردنێک هەڵبژاردنێکی تر سنووردار دەکات حاڵەتە جیاکان کۆ بکەیتەوە.
- حیساب بکەیت، ڕوون بکەیتەوە بۆچی و ڕیزکردنەکان بە و بژمێریت.
- دانیشتن لە دەوری مێزی خڕ و ڕیزکردنی شتی وەک یەک بژمێریت.
- بە ژماردن ڕوون بکەیتەوە بۆچی درێژ و هەڕەمەکی بەهێزن و بۆچی بە تەنها لاوازە.
The multiplication principleیاسای بنەڕەتی ژماردن
A probability is a count divided by a count: . Listing every outcome works for a coin or a die, but 7 people can stand in a queue in 5,040 different orders, and nobody wants to write those down. Counting rules give the number without listing. The first one, and the base of all the others, is the multiplication principle:
ژمارەیەکە دابەشکراو بە ژمارەیەکی تر: . نووسینی هەموو بۆ دراوێک یان بەردەزارێک کار دەکات، بەڵام 7 کەس بە 5,040 ڕیزبەندیی جیاواز دەتوانن لە ڕیزێکدا ڕابوەستن و کەس نایەوێت ئەوانە بنووسێت. یاساکانی ژماردن ژمارەکە دەدەن بێ نووسینی هەموو حاڵەتەکان. یەکەمیان، کە بنەمای هەموو ئەوانی ترە، :
If a first choice can be made in ways and, after it, a second choice in ways, then the two choices together can be made in ways. With more steps, keep multiplying.
گەر هەڵبژاردنی یەکەم بە ڕێگا بکرێت و دوای ئەو هەڵبژاردنی دووەم بە ڕێگا، ئەوا هەردوو هەڵبژاردنەکە پێکەوە بە ڕێگا دەکرێن. گەر هەنگاوی زیاتر هەبوو، هەر لێکیان بدە.
Example. You have 3 shirts and 4 pairs of trousers. Each shirt goes with each pair of trousers, so there are outfits. Picture a grid with one row for each shirt and one column for each pair of trousers: it has squares, one for every outfit.
نموونە. 3 کراس و 4 پانتۆڵت هەیە. هەر کراسێک لەگەڵ هەر پانتۆڵێک دەگونجێت، بۆیە جۆرە جلوبەرگت هەیە. تۆڕێک بهێنە بەرچاوت کە بۆ هەر کراسێک ڕیزێک و بۆ هەر پانتۆڵێک ستوونێکی هەیە: چوارگۆشەی تێدایە، بۆ هەر جلوبەرگێک یەکێک.
The multiplication principleیاسای بنەڕەتی ژماردن
More steps: a tree diagramهەنگاوی زیاتر: هێڵکاریی درەختی
A buyer chooses a new car in three steps: 2 body styles (sedan or hatchback), then 5 colours, then 3 models (GL, SS, SL). A tree diagram shows every possible choice as one path from the start to a leaf:
کڕیارێک لە سێ هەنگاودا ئۆتۆمبێلێکی نوێ هەڵدەبژێرێت: 2 شێوەی لەش (سیدان یان هاچباک)، پاشان 5 ڕەنگ، پاشان 3 مۆدێل (GL، SS، SL). هێڵکاریی درەختی هەموو هەڵبژاردنێکی گونجاو وەک یەک ڕێگا لە خاڵی دەستپێکەوە تا گەڵایەک نیشان دەدات:
You do not need to draw all 30 leaves: every colour has the same 3 models, and the hatchback branch looks exactly like the sedan branch. So the count is .
پێویست ناکات هەر 30 گەڵاکە بکێشیت: هەموو ڕەنگێک هەمان 3 مۆدێلی هەیە و لقی هاچباک ڕێک وەک لقی سیدانە. بۆیە ژمارەکە ـە.
The multiplication principleیاسای بنەڕەتی ژماردن
When one choice limits anotherکاتێک هەڵبژاردنێک هەڵبژاردنێکی تر سنووردار دەکات
Now suppose the hatchback is not sold in black. The simple product 30 is wrong, because the number of colours now depends on the body style. Split the count into separate cases and add them:
ئێستا وای دابنێ کە هاچباک بە ڕەنگی ڕەش نافرۆشرێت. لێکدانی سادەی 30 هەڵەیە، چونکە ئێستا ژمارەی ڕەنگەکان بە شێوەی لەشەکە دەگۆڕێت. ژماردنەکە بکە بە چەند حاڵەتێکی جیا و کۆیان بکەرەوە:
Sedan: 5 colours, each with 3 models. Hatchback: 4 colours, each with 3 models.
سیدان: 5 ڕەنگ، هەریەکە بە 3 مۆدێل. هاچباک: 4 ڕەنگ، هەریەکە بە 3 مۆدێل.
Arranging everything: the factorialڕیزکردنی هەمووان: فاکتۆریێل
In how many orders can A, B and C stand in a row? The first place has 3 choices, the second place has 2 letters left, and the last place has 1: . Watch all six being listed:
A، B و C بە چەند ڕیزبەندی دەتوانن لە ڕیزێکدا ڕابوەستن؟ شوێنی یەکەم 3 هەڵبژاردنی هەیە، بۆ شوێنی دووەم 2 پیت ماونەتەوە و بۆ دوایین شوێن 1: . سەیر بکە چۆن هەر شەشیان دەنووسرێن:


This kind of product has its own name and sign. n factorial, written , is the product of all whole numbers from down to 1:
ئەم جۆرە لێکدانە ناو و نیشانەی تایبەتی خۆی هەیە. n، کە بە دەنووسرێت، لێکدانی هەموو ژمارە تەواوەکانە لە ـەوە تا 1:
Theorem (1) of the lecture notes: different objects can be arranged in a row in ways. Example (3): 7 people can sit on a row of 7 chairs in ways.
(1)ی تێبینییەکانی وانە: شتی جیاواز بە ڕێگا لە ڕیزێکدا ڕیز دەکرێن. نموونەی (3): 7 کەس بە ڕێگا دەتوانن لەسەر ڕیزێک 7 کورسی دابنیشن.
Arranging everything: the factorialڕیزکردنی هەمووان: فاکتۆریێل
Why zero factorial is 1بۆچی فاکتۆریێلی سفر 1ـە
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 |
Each row is the row above it times : . Read the table upwards and divide instead: , , , and one more step gives .
هەر ڕیزێک ڕیزی سەرەوەیەتی جارانی : . خشتەکە بەرەو سەرەوە بخوێنەوە و لە جیاتی لێکدان دابەش بکە: ، ، و هەنگاوێکی تر دەدات.
Why zero factorial equals 1: read the factorial table backwards, dividing by n each time, until you reach 0!.
بۆچی : خشتەی بە پێچەوانەوە بخوێنەوە، هەر جارەی دابەش بە بکە، تا دەگەیتە .
Arranging some of the objects: permutationsڕیزکردنی هەندێک لە شتەکان: گۆڕینەکان
A permutation is an arrangement in which order matters: gold for Aram and silver for Dilan is a different result from silver for Aram and gold for Dilan. Five runners finish a race. Gold can go to any of the 5, silver to one of the 4 left, and bronze to one of the 3 left:
ڕیزکردنێکە کە تێیدا ڕیزبەندی گرنگە: زێڕ بۆ ئارام و زیو بۆ دیلان ئەنجامێکی جیاوازە لە زیو بۆ ئارام و زێڕ بۆ دیلان. پێنج ڕاکەر پێشبڕکێیەک تەواو دەکەن. زێڕ دەتوانێت بۆ هەر یەک لە 5ـەکە بێت، زیو بۆ یەکێک لەو 4ـەی ماونەتەوە و برۆنز بۆ یەکێک لەو 3ـەی ماونەتەوە:
Who can win silver depends on who won gold, but the number of candidates for silver is always 4, so the multiplication principle still works. In general, to arrange of different objects, multiply numbers, starting at and going down by one:
ئەوەی کێ دەتوانێت زیو ببات بەوە دەگۆڕێت کە کێ زێڕی برد، بەڵام ژمارەی کاندیدەکانی زیو هەمیشە 4ـە، بۆیە هێشتا کار دەکات. بە گشتی، بۆ ڕیزکردنی شت لە شتی جیاواز، ژمارە لێک بدە کە لە ـەوە دەست پێ دەکەن و یەک یەک کەم دەبنەوە:
Dividing by cancels the factors we do not need: . The lecture notes write ; other books write . Without repetition, .
دابەشکردن بە ئەو لێکدەرانە لادەبات کە پێویستمان پێیان نییە: . تێبینییەکانی وانە دەنووسن و کتێبی تر . بەبێ دووبارەبوونەوە، .
Arranging some of the objects: permutationsڕیزکردنی هەندێک لە شتەکان: گۆڕینەکان
Three examples of permutationsسێ نموونەی گۆڕین
Example (1). How many 2-letter "words" (any order of letters, real word or not) can be made from a, b, c, d without using a letter twice? . Here they all are:
نموونەی (1). چەند «وشە»ی دوو پیتی (پیتەکان بە هەر ڕیزبەندییەک، وشەی ڕاستەقینە بێت یان نا) لە a، b، c، d دروست دەکرێت بەبێ ئەوەی پیتێک دوو جار بەکار بێت؟ . ئەمە هەموویانن:
| First letterپیتی یەکەم | Wordsوشەکان |
|---|---|
| a | ab ac ad |
| b | ba bc bd |
| c | ca cb cd |
| d | da db dc |
- Example (2). 3 books out of 9 are arranged on a shelf: .
- Three of five letters. Put 3 of the letters A, B, C, D, E in a row: . If only which 3 letters matters, and not their order, the answer is 10: that is a selection, taught in Combinations.
- نموونەی (2). 3 کتێب لە 9 کتێب لەسەر ڕەفەیەک ڕیز دەکرێن: .
- سێ پیت لە پێنج. 3 لە پیتەکانی A، B، C، D، E لە ڕیزێکدا دابنێ: . گەر تەنها گرنگ بێت کام 3 پیت هەڵدەبژێردرێن، نەک ڕیزبەندییان، وەڵامەکە 10ـە: ئەمە هەڵبژاردنە و لە وانەی گونجێنەکاندا دەخوێندرێت.
When repeats are allowedکاتێک دووبارەبوونەوە ڕێگەپێدراوە
So far each object could be used only once (without replacement). If an object can be used again (with replacement, also called with repetition), every place has all choices again, and the multiplication principle gives:
تا ئێستا هەر شتێک تەنها یەک جار بەکار دەهات (). گەر شتێک بتوانێت دووبارە بەکار بێتەوە (، یان بە دووبارەبوونەوە)، هەر شوێنێک دیسان هەموو هەڵبژاردنەکەی هەیە و دەدات:
places, choices in each.
شوێن، لە هەر یەکێکیاندا هەڵبژاردن.
Example (4). How many 2-digit numbers can be made from the digits 2, 5, 7, 8, 9 if a digit may repeat? . Without repetition it would be : the 5 extra numbers are 22, 55, 77, 88 and 99.
نموونەی (4). چەند ژمارەی دوو ڕەقەمی لە ڕەقەمەکانی 2، 5، 7، 8، 9 دروست دەکرێت گەر ڕەقەمێک بتوانێت دووبارە بێتەوە؟ . بەبێ دووبارەبوونەوە دەبوو بە : 5 ژمارە زیادەکە بریتین لە 22، 55، 77، 88 و 99.
Around a round tableلە دەوری مێزێکی خڕ
Five friends sit at a round table. Only who sits next to whom matters: if everyone moves one seat to the right, it is still the same seating. Each seating is therefore counted 5 times among the row orders, once for each turn, so divide by 5. Or fix one person and arrange the other 4 around them:
پێنج هاوڕێ لە دەوری مێزێکی خڕ دادەنیشن. تەنها ئەوە گرنگە کێ لە تەنیشت کێ دادەنیشێت: گەر هەموو کەس یەک کورسی بەرەو ڕاست بجووڵێت، هێشتا هەمان دانیشتنە. بۆیە هەر دانیشتنێک لەناو ڕیزبەندییەکەی ڕیزدا 5 جار ژمێردراوە، بۆ هەر سووڕانەوەیەک جارێک، بۆیە دابەشی بکە بە 5. یان یەک کەس جێگیر بکە و 4 کەسەکەی تر لە دەوری ئەو ڕیز بکە:
Example (5): 5 persons around a round table: .
نموونەی (5): 5 کەس لە دەوری مێزێکی خڕ: .
Why n people around a round table can sit in (n − 1)! ways: fix one person as a reference point.
بۆچی کەس لە دەوری مێزێکی خڕ بە ڕێگا دادەنیشن: یەک کەس وەک خاڵی پشتپێبەستن جێگیر بکە.
Compares a row with a circle, then seats the first person as the reference point.
ڕیزێک لەگەڵ بازنەیەک بەراورد دەکات، پاشان یەکەم کەس وەک خاڵی پشتپێبەستن دادەنیشێنێت.
When some objects look the sameکاتێک هەندێک لە شتەکان وەک یەکن
How many different "words" can be made from the letters A, A, B? If the two A's were different ( and ) there would be orders. But swapping the two A's gives the same word, so every word has been counted times: words (AAB, ABA, BAA). In general:
چەند «وشە»ی جیاواز لە پیتەکانی A، A، B دروست دەکرێت؟ گەر دوو Aـەکە جیاواز بوونایە ( و )، ڕیزبەندی هەبوو. بەڵام گۆڕینەوەی شوێنی دوو Aـەکە هەمان وشە دەدات، بۆیە هەر وشەیەک جار ژمێردراوە: وشە (AAB، ABA، BAA). بە گشتی:
objects: of one kind, of a second kind, …, of a -th kind. Divide by the factorial of each group, because swapping objects inside a group changes nothing.
شت: لە جۆرێک، لە جۆرێکی دووەم، … و لە جۆری ـەم. دابەشی بکە بە هەر کۆمەڵێک، چونکە گۆڕینەوەی شوێنی شتەکانی ناو یەک کۆمەڵ هیچ ناگۆڕێت.
Example (6). 3 red, 2 green, 4 black, 1 white and 1 yellow ball (11 balls) are put in a row. Balls of the same colour look alike:
نموونەی (6). 3 تۆپی سوور، 2 سەوز، 4 ڕەش، 1 سپی و 1 زەرد (11 تۆپ) لە ڕیزێکدا دادەنرێن. تۆپە هاوڕەنگەکان وەک یەک دەردەکەون:
How to count arrangements when some letters repeat: count as if all were different, then divide by the factorial of each repeat.
چۆن ڕێگاکانی ڕیزبوونی پیتەکان دەژمێریت کاتێک هەندێک پیت دووبارە دەبنەوە: وا بژمێرە کە هەموویان جیاوازن، پاشان دابەش بە ژمارەی جارەکانی هەر پیتێکی دووبارە بکە.
When some objects look the sameکاتێک هەندێک لە شتەکان وەک یەکن
Example (7): the word STATISTICSنموونەی (7): وشەی STATISTICS
Example (7) was left as homework: in how many ways can the letters of the word STATISTICS be arranged?
نموونەی (7) وەک ئەرک بەجێ هێڵرابوو: پیتەکانی وشەی STATISTICS بە چەند ڕێگا ڕیز دەکرێن؟
- Count the lettersپیتەکان بژمێرە
letters: S three times, T three times, I twice, A once, C once. Check: .
پیت: S سێ جار، T سێ جار، I دوو جار، A یەک جار، C یەک جار. پشکنین: .
- Use the formulaیاساکە بەکار بهێنە
Divide by the factorial of each group:
دابەش بکە بە هەر کۆمەڵێک:
- Check by computerبە کۆمپیوتەر بیپشکنە
Listing all orders and removing duplicates also leaves 50,400 (see the Python screen below).
نووسینی هەموو ڕیزبەندییەکە و لابردنی دووبارەکان هەروەها 50,400 دەهێڵێتەوە (بڕوانە شاشەی Pythonـی خوارەوە).
Counting passwordsژماردنی تێپەڕەوشەکان
A password is an arrangement of characters, so counting tells us how many guesses a brute-force attack may need. Take the 62 characters a–z, A–Z and 0–9, and choose every character at random:
ڕیزکردنێکی ، بۆیە ژماردن پێمان دەڵێت لەوانەیە پێویستی بە چەند هەوڵ بێت. 62 a–z، A–Z و 0–9 وەربگرە و هەموو بە هەڕەمەکی هەڵبژێرە:
| Password | Possible passwordsژمارەی |
|---|---|
| 8 characters, repeats allowed8 ، دووبارەبوونەوە ڕێگەپێدراوە | |
| 8 different characters8 جیاواز | |
| 15 lowercase letters15 پیتی بچووک |
Forbidding repeats makes the count smaller, not bigger. And length wins: each extra character multiplies the count again, so 15 plain lowercase letters give about 7.7 million times more possibilities than 8 mixed characters. At 10 billion guesses a second, trying them all takes about 6 hours for but about 5,000 years for (Why length beats complexity).
قەدەغەکردنی دووبارەبوونەوە ژمارەکە بچووکتر دەکات، نەک گەورەتر. درێژی دەباتەوە: هەر زیادە ژمارەکە دیسان لێک دەداتەوە، بۆیە 15 پیتی بچووکی ئاسایی نزیکەی 7.7 ملیۆن جار حاڵەتی گونجاوی زیاتر دەدەن لە 8 تێکەڵ. بە 10 ملیار هەوڵ لە چرکەیەکدا، تاقیکردنەوەی هەموویان بۆ نزیکەی 6 کاتژمێر دەخایەنێت، بەڵام بۆ نزیکەی 5,000 ساڵ (بۆچی درێژی لە ئاڵۆزی گرنگترە).
Counting passwordsژماردنی تێپەڕەوشەکان
Shuffling is not enoughتێکدانی ڕیزبەندی بەس نییە
The course note on permutations and cryptography suggests making a password by picking 8 characters, for example nQwZ2f6U, and then using a permutation of them, such as UfQ2Z6wn. Random choice does help, but the shuffle itself adds very little.
تێبینیی کۆرسەکە دەربارەی و پێشنیار دەکات بەم شێوەیە دروست بکرێت: 8 هەڵبژێرە، بۆ نموونە nQwZ2f6U، پاشان بەکار بهێنە، وەک UfQ2Z6wn. هەڵبژاردنی هەڕەمەکی یارمەتی دەدات، بەڵام خودی تێکدانەکە زۆر کەم زیاد دەکات.
Permutations in cryptography: transposition ciphersگۆڕینەکان لە کریپتۆگرافیدا: شفرەی جێگۆڕکێ
Classical ciphers use two techniques. A substitution cipher replaces letters with other letters, numbers or symbols but keeps their places, like the Caesar cipher. A transposition cipher keeps the letters but moves them by a fixed rule, the key, so the ciphertext is a permutation of the plaintext:
لە کۆندا دوو تەکنیک بەکار دێت. پیتەکان بە پیت، ژمارە یان هێمای تر دەگۆڕێتەوە بەڵام شوێنەکانیان دەهێڵێتەوە، وەک شفرەی قەیسەر. پیتەکان دەهێڵێتەوە بەڵام بە یاسایەکی جێگیر، کە ، دەیانجووڵێنێت، بۆیە :
The note's picture used the same key on JOHN (→ ONJH) and NASH (→ AHNS). For blocks of 4 letters there are only keys, and even blocks of 10 letters have , a small number for a computer. The letters are also unchanged (an E stays an E), which is one more clue for a code-breaker. So transposition alone is weak; modern ciphers such as AES repeat substitution and permutation steps in many rounds (see symmetric encryption).
وێنەکەی تێبینییەکە هەمان بۆ JOHN و NASH بەکار هێنا: JOHN بووە ONJH و NASH بووە AHNS. بۆ بلۆکی 4 پیتی تەنها هەیە و تەنانەت بلۆکی 10 پیتی ـی هەیە، کە بۆ ژمارەیەکی بچووکە. پیتەکانیش ناگۆڕێن (E هەر E دەمێنێتەوە)، کە سەرەداوێکی ترە بۆ شفرەشکێنەر. بۆیە جێگۆڕکێ بە تەنها لاوازە؛ وەک AES هەنگاوەکانی جێگرتنەوە و لە چەندین خولدا دووبارە دەکەنەوە (بڕوانە شفرەکردنی هاوچەشن).
Counting in Pythonژماردن لە Pythonـدا
Python's math module has math.factorial(n) and math.perm(n, r), and itertools.permutations lists the arrangements themselves. This program recomputes the lecture's examples and checks STATISTICS the slow way:
mathـی Python math.factorial(n) و math.perm(n, r)ـی تێدایە و itertools.permutations خودی ڕیزکردنەکان دەنووسێت. ئەم بەرنامەیە نموونەکانی وانەکە دووبارە حیساب دەکاتەوە و STATISTICS بە ڕێگا خاوەکە دەپشکنێت:
import math
from itertools import permutations
print(math.factorial(7)) # 7 people in a row: 7!
print(math.perm(9, 3)) # 3 of 9 books on a shelf: 9P3
print(5 ** 2) # 2-digit numbers from 2, 5, 7, 8, 9, repeats allowed
print(math.factorial(5 - 1)) # 5 people around a round table: (5 - 1)!
words = ["".join(p) for p in permutations("abcd", 2)]
print(len(words), words) # Example (1): every 2-letter word from a, b, c, d
# STATISTICS: the formula, and a slow check by listing every order
print(math.factorial(10) // (math.factorial(3) * math.factorial(3) * math.factorial(2)))
print(len(set(permutations("STATISTICS"))))5040 504 25 24 12 ['ab', 'ac', 'ad', 'ba', 'bc', 'bd', 'ca', 'cb', 'cd', 'da', 'db', 'dc'] 50400 50400
Explain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 5
math.perm(9, 3)is .math.perm(9, 3)هەمان ـە.- Lineدێڕی 9
permutations("abcd", 2)gives every ordered pair of different letters;jointurns each pair into a word.permutations("abcd", 2)هەموو جووتێکی ڕیزکراوی پیتی جیاواز دەدات؛joinهەر جووتێک دەکات بە وشەیەک.- Lineدێڕی 14
set(...)throws away duplicate orders, such as the two that only swap two S's.set(...)ڕیزبەندییە دووبارەکان فڕێ دەدات، وەک ئەو دووانەی تەنها شوێنی دوو S دەگۆڕنەوە.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | Correct ideaبیرۆکەی ڕاست |
|---|---|
| Adding when the choices are made together: 3 shirts and 4 trousers give .کۆکردنەوە کاتێک هەڵبژاردنەکان پێکەوە دەکرێن: 3 کراس و 4 پانتۆڵ دەکەنە . | Multiply along one path: . Add only separate cases (either a sedan or a hatchback).بە درێژایی یەک ڕێگا لێک بدە: . تەنها حاڵەتە جیاکان کۆ بکەرەوە (یان سیدان یان هاچباک). |
| Using when repeats are allowed, for example a PIN as .بەکارهێنانی کاتێک دووبارەبوونەوە ڕێگەپێدراوە، بۆ نموونە PIN وەک . | With repetition every place has all choices: , so .بە دووبارەبوونەوە هەر شوێنێک هەموو هەڵبژاردنەکەی هەیە: ، بۆیە . |
| Thinking can never be bigger than .بیرکردنەوە کە هەرگیز لە گەورەتر نابێت. | That is true only without repetition. Codes of 3 letters from A and B: .ئەمە تەنها بەبێ دووبارەبوونەوە ڕاستە. کۆدی 3 پیتی لە A و B: . |
| Treating a round table like a row: for 5 people.مامەڵەکردن لەگەڵ مێزی خڕ وەک ڕیز: بۆ 5 کەس. | Turning everyone gives the same seating: .سووڕاندنی هەمووان هەمان دانیشتن دەدات: . |
| Treating identical letters as different: for STATISTICS.دانانی پیتە وەک یەکەکان وەک جیاواز: بۆ STATISTICS. | Divide by the factorial of each repeat count: .دابەشی بکە بە ژمارەی دووبارەبوونەوەی هەر پیتێک: . |
| Writing .نووسینی . | by definition. بە پێناسە. |
Exercisesڕاهێنانەکان
(a) How many outfits can be made from 3 shirts and 4 pairs of trousers? (b) A car comes in 2 body styles, 5 colours and 3 models: how many choices? (c) The same, but the hatchback is not sold in black?
(أ) لە 3 کراس و 4 پانتۆڵ چەند جلوبەرگ دروست دەکرێت؟ (ب) ئۆتۆمبێلێک بە 2 شێوەی لەش، 5 ڕەنگ و 3 مۆدێل هەیە: چەند هەڵبژاردن؟ (ج) هەمان شت، بەڵام هاچباک بە ڕەنگی ڕەش نافرۆشرێت؟
Show answerوەڵامەکە پیشان بدە
- (a)
- (b)
- (c) : add the two separate cases.
- بەشی (أ):
- بەشی (ب):
- بەشی (ج): : دوو حاڵەتە جیاکە کۆ بکەرەوە.
(a) How many 2-letter words can be made from a, b, c, d with no letter used twice? (b) In how many ways can 3 books out of 9 be arranged on a shelf? (c) In how many ways can 7 persons sit in a row?
(أ) چەند وشەی دوو پیتی لە a، b، c، d دروست دەکرێت بەبێ ئەوەی پیتێک دوو جار بەکار بێت؟ (ب) 3 کتێب لە 9 کتێب بە چەند ڕێگا لەسەر ڕەفەیەک ڕیز دەکرێن؟ (ج) 7 کەس بە چەند ڕێگا لە ڕیزێکدا دادەنیشن؟
Show answerوەڵامەکە پیشان بدە
- (a)
- (b)
- (c)
- بەشی (أ):
- بەشی (ب):
- بەشی (ج):
How many 2-digit numbers can be made from 2, 5, 7, 8, 9 (a) if digits may repeat, (b) if they may not?
چەند ژمارەی دوو ڕەقەمی لە 2، 5، 7، 8، 9 دروست دەکرێت (أ) گەر ڕەقەمەکان بتوانن دووبارە ببنەوە، (ب) گەر نەتوانن؟
Show answerوەڵامەکە پیشان بدە
- (a)
- (b) ; the difference is 22, 55, 77, 88, 99.
- بەشی (أ):
- بەشی (ب): ؛ جیاوازییەکە 22، 55، 77، 88، 99ـە.
In how many ways can (a) 5 persons, (b) 6 persons sit around a round table?
(أ) 5 کەس، (ب) 6 کەس بە چەند ڕێگا لە دەوری مێزێکی خڕ دادەنیشن؟
Show answerوەڵامەکە پیشان بدە
- (a)
- (b)
- بەشی (أ):
- بەشی (ب):
Exercisesڕاهێنانەکان
More exercisesڕاهێنانی زیاتر
(a) In how many ways can 3 red, 2 green, 4 black, 1 white and 1 yellow ball be put in a row? (b) In how many ways can the letters of STATISTICS be arranged? (c) And the letters of MISSISSIPPI?
(أ) 3 تۆپی سوور، 2 سەوز، 4 ڕەش، 1 سپی و 1 زەرد بە چەند ڕێگا لە ڕیزێکدا دادەنرێن؟ (ب) پیتەکانی STATISTICS بە چەند ڕێگا ڕیز دەکرێن؟ (ج) پیتەکانی MISSISSIPPI چی؟
Show answerوەڵامەکە پیشان بدە
- (a)
- (b)
- (c) 11 letters: I four times, S four times, P twice, M once: .
- بەشی (أ):
- بەشی (ب):
- بەشی (ج): 11 پیت: I چوار جار، S چوار جار، P دوو جار، M یەک جار: .
Explain why .
ڕوونی بکەرەوە بۆچی .
Show answerوەڵامەکە پیشان بدە
From we get . Going down: , , , . Strictly, is a definition that keeps this rule and the counting formulas working (for example ).
لە ـەوە وەردەگرین. بەرەو خوارەوە: ، ، ، . بە وردی، پێناسەیەکە کە ئەم یاسایە و یاساکانی ژماردن بە کارکردن دەهێڵێتەوە (بۆ نموونە ).
(a) How many 4-digit PINs are there if digits may repeat? (b) If no digit may repeat? (c) A thief tries 3 different PINs on a phone that locks after 3 wrong tries. What is the probability of getting in, if the PIN was chosen at random from all PINs of (a)?
(أ) چەند PINـی 4 ڕەقەمی هەیە گەر ڕەقەمەکان بتوانن دووبارە ببنەوە؟ (ب) گەر هیچ ڕەقەمێک دووبارە نەبێتەوە؟ (ج) دزێک 3 PINـی جیاواز لەسەر مۆبایلێک تاقی دەکاتەوە کە دوای 3 هەوڵی هەڵە دادەخرێت. لەم حاڵەتەدا چوونە ژوورەوە چەندە، گەر PINـەکە بە هەڕەمەکی لە هەموو PINـەکانی (أ) هەڵبژێردرابێت؟
Show answerوەڵامەکە پیشان بدە
- (a)
- (b)
- (c) 3 of the 10,000 equally likely PINs: . This is why phones limit wrong tries.
- بەشی (أ):
- بەشی (ب):
- بەشی (ج): 3 لە 10,000 PINـی : . لەبەر ئەمەیە مۆبایلەکان هەوڵی هەڵە سنووردار دەکەن.
A message was encrypted with the transposition key 2, 4, 1, 3 and reads OECD. Find the plaintext.
نامەیەک بە جێگۆڕکێی 2، 4، 1، 3 شفرە کراوە و دەبێتە OECD. بدۆزەرەوە.
Show answerوەڵامەکە پیشان بدە
The ciphertext's 1st letter came from position 2, the 2nd from position 4, the 3rd from position 1, the 4th from position 3. Put them back: C goes to place 1, O to place 2, D to place 3 and E to place 4, so the plaintext is CODE.
پیتی یەکەمی لە شوێنی 2ـەوە هاتووە، دووەم لە شوێنی 4، سێیەم لە شوێنی 1 و چوارەم لە شوێنی 3. بیانگەڕێنەرەوە: C بۆ شوێنی 1، O بۆ شوێنی 2، D بۆ شوێنی 3 و E بۆ شوێنی 4، بۆیە CODEـە.
Summaryپوختە
- Multiplication principle: ways, then ways, gives ; add only separate cases.
- All different objects in a row: , with .
- of , order matters, no repeats: .
- Repeats allowed: (here may be bigger than ).
- Round table: . Identical objects: .
- Passwords: length and random choice make them strong; shuffling known characters adds only orders. A transposition cipher is a permutation of the letters.
- : ڕێگا و پاشان ڕێگا، دەدات؛ تەنها حاڵەتە جیاکان کۆ بکەرەوە.
- هەموو شتە جیاوازەکە لە ڕیزێکدا: ؛ هەروەها .
- لە ، ڕیزبەندی گرنگە، بێ دووبارەبوونەوە: .
- دووبارەبوونەوە ڕێگەپێدراوە: (لێرەدا دەتوانێت لە گەورەتر بێت).
- مێزی خڕ: . شتی وەک یەک: .
- : درێژی و هەڵبژاردنی هەڕەمەکی بەهێزیان دەکەن؛ تێکدانی تەنها ڕیزبەندی زیاد دەکات. پیتەکانە.
When do you add instead of multiply?کەی لە جیاتی لێکدان کۆ دەکەیتەوە؟
When the cases are separate alternatives (either this or that), as in .
کاتێک حاڵەتەکان جێگرەوەی جیان (یان ئەمە یان ئەوە)، وەک لە .
What is the difference between and ?جیاوازیی نێوان و چییە؟
uses each object at most once; lets objects repeat.
هەر شتێک زۆرترین یەک جار بەکار دەهێنێت؛ ڕێگە دەدات شتەکان دووبارە ببنەوە.
Why divide by for the two A's in AAB?بۆچی بۆ دوو Aـەکەی AAB بە دابەش دەکەین؟
Swapping the two A's gives the same word, so each word was counted times.
گۆڕینەوەی شوێنی دوو Aـەکە هەمان وشە دەدات، بۆیە هەر وشەیەک جار ژمێردرابوو.
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
Counting arrangements step by step: listing permutations, the nPr formula with factorials, and several arrangement word problems.
ژماردنی ئەو ڕێگایانەی شتەکان پێیان ڕیز دەکرێن، هەنگاو بە هەنگاو: نووسینی ، بە ، هەروەها چەند پرسیارێکی وشەیی.
Plays 0:00-11:16: understanding and listing permutations, the permutation formula and arrangement examples; the combination part after 11:16 belongs to the next lesson.
لە 0:00 تا 11:16 پەخش دەبێت: تێگەیشتن لە و نووسینیان، و نموونەی ڕیزبەندی؛ بەشی دوای 11:16 هی وانەی داهاتووە.
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Combinationsگونجێنەکان
Related lecturesوانە پەیوەندیدارەکان
- Combinationsگونجێنەکان
- What Is Probability?ئەگەرێتی چییە؟
- Passwords, MFA and Access Controlتێپەڕەوشەکان، MFA و کۆنترۆڵی دەستڕاگەیشتن
- Encryption, Hashing and Digital Signaturesشفرەکردن، هاشکردن و واژووە دیجیتاڵییەکان
- Modules and importمۆدیوڵەکان و import
- Probability in Computing: Speech, Predictive Text and Riskبەکارهێنانی ئەگەر لە بواری کۆمپیوتەردا: ئاخاوتن، پێشبینیی دەق و مەترسی
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- MIT OpenCourseWare 18.05, Class 1 reading: Counting and Sets (rule of product, the medals example, permutations and the formula n!/(n−k)!)
- NIST SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management, 3.1.1 Passwords (minimum 15 characters for single-factor use, no composition rules, blocklists)
- Python documentation: math module (factorial, perm, comb; soft-deprecated aliases of math.integer since 3.15)
- Python documentation: itertools.permutations
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.