Chapterبەش 1 · Lectureوانە 1.2
Algebra, Boolean Logic and Matrices Inside the Computerجەبر، لۆجیکی بوول و ماتریکسەکان لەناو کۆمپیوتەردا
How algebra turned word problems into expressions; variables, constants and why “=” means assignment in programs; Boolean algebra's AND, OR and NOT laws as switch circuits and how gates build the CPU; matrices, their types, row-times-column multiplication, transformations in games, and why a transpose is a mirror, not a rotation.
چۆن کێشەی وشەیی کردە ؛ ، و بۆچی «=» لە واتە ؛ یاساکانی AND، OR و NOTـی وەک بە و چۆن CPU دروست دەکەن؛ ، جۆرەکانیان، لێکدانی ڕیز لە ستوون، لە یارییەکاندا و بۆچی ئاوێنەیە، نەک سووڕانەوە.
What you will learnچی فێر دەبیت
- Turn a word problem into an algebraic expression or equation, and solve a simple one.
- Tell a variable from a constant, and equality in algebra from assignment in programming.
- Apply the AND, OR and NOT laws of Boolean algebra and link them to switch circuits and the CPU.
- Read the shape of a matrix, name common types and multiply two matrices.
- Find a transpose and explain why it is a reflection, not a rotation.
- کێشەیەکی وشەیی بکەیتە یان و یەکێکی سادە چارەسەر بکەیت.
- لە و یەکسانی لە لە لە جیا بکەیتەوە.
- یاساکانی AND، OR و NOTـی جێبەجێ بکەیت و بە و CPUـەوە ببەستیتەوە.
- شێوەی بخوێنیتەوە، جۆرە باوەکان ناو بهێنیت و دوو لێک بدەیت.
- بدۆزیتەوە و ڕوونی بکەیتەوە بۆچی وێنەدانەوەیە، نەک سووڕانەوە.
Algebra: problems written as expressionsجەبر: کێشە بە شێوەی دەربڕینی جەبری
is the branch of mathematics that writes a problem as a mathematical , using letters for numbers that are unknown or that change. You use it without noticing. Say the walk to the bus stop takes minutes and the bus ride takes 25 minutes. Then the whole trip to university takes minutes, whatever is today. The essay's own everyday examples are the same kind: how long you stay in the bath, or how long it takes to reach school.
ئەو لقەی بیرکارییە کە کێشەیەک بە شێوەی دەنووسێت و پیت بەکار دەهێنێت بۆ ئەو ژمارانەی نەزانراون یان دەگۆڕێن. بەبێ ئەوەی هەست بکەیت بەکاری دەهێنیت. با بڵێین ڕۆیشتن بە پێ تا وێستگەی پاس خولەک دەخایەنێت و سواربوونی پاسەکە 25 خولەک. کەواتە هەموو گەشتەکە بۆ زانکۆ خولەک دەخایەنێت، ئەمڕۆ هەرچەندێک بێت. نموونە ڕۆژانەکانی نامیلکەکەش لەم جۆرەن: چەند لە گەرماو دەمێنیتەوە، یان چەند کاتت پێدەچێت تا دەگەیتە قوتابخانە.
Long ago, Babylonian and Egyptian writers had no letters for unknowns. They wrote problems in words: “the thing which, added to five things, makes eight things.” Today the same sentence is one short line.
لە کۆندا نووسەرە بابلی و میسرییەکان پیتیان بۆ نەزانراو نەبوو. کێشەکانیان بە وشە دەنووسی: «ئەو شتەی لەگەڵ پێنج شتدا کۆ دەکرێتەوە و دەکاتە هەشت شت.» ئەمڕۆ هەمان ڕستە یەک دێڕی کورتە.
Take 5 away from both sides to find the unknown thing: it is 3.
5 لە هەردوو لا کەم بکەرەوە بۆ ئەوەی شتە نەزانراوەکە بدۆزیتەوە: 3ـە.
A short history of algebraمێژوویەکی کورتی جەبر
The essay shows the history of algebra as a chain of cultures, each building on the one before:
نامیلکەکە مێژووی وەک زنجیرەیەک لە شارستانییەت پیشان دەدات کە هەر یەکەیان لەسەر ئەوەی پێشووی بنیات دەنێت:
- Egyptian and Babylonian algebra: problems and answers written completely in words.
- Greek geometric algebra: unknowns pictured as lengths and areas.
- Diophantus: the first short symbols for unknowns.
- Indian (Hindu) algebra: rules that work with zero and negative numbers.
- Arabic algebra: in Baghdad around 820, al-Khwarizmi wrote the book whose title gave us the word algebra.
- European algebra after 1500: letters such as and the symbols we use today.
- Abstract algebra: the study of rules and structures themselves; today it is the mathematics behind cryptography and error-correcting codes.
- میسری و بابلی: کێشە و وەڵام بە تەواوی بە وشە نووسراون.
- ئەندازەیی یۆنانی: نەزانراوەکان وەک درێژی و ڕووبەر وێنا دەکران.
- دیۆفانتۆس: یەکەم نیشانە کورتەکان بۆ نەزانراو.
- هیندی: یاسا کە لەگەڵ سفر و کار دەکەن.
- عەرەبی: لە بەغدا نزیکەی ساڵی 820، خوارزمی ئەو کتێبەی نووسی کە ناونیشانەکەی وشەی ئەلجەبرـی پێ بەخشیین.
- ئەورووپی دوای 1500: پیتی وەک و ئەو نیشانانەی ئەمڕۆ بەکاریان دەهێنین.
- ڕووت: لێکۆڵینەوە لە خودی یاسا و پێکهاتەکان؛ ئەمڕۆ بیرکاریی پشت و ئەو کۆدانەیە کە هەڵەی ناردنی ڕاست دەکەنەوە.
Al-jabr means “restoring” or “completing”: moving a subtracted amount to the other side of an equation. For example becomes . Robert of Chester's Latin translation carried the word into Europe, and algebra reached English from there.
الجبر واتە «گەڕاندنەوە» یان «تەواوکردن»: گواستنەوەی بڕێکی لێدەرکراو بۆ لایەکەی تری . بۆ نموونە دەبێتە . وەرگێڕانە لاتینییەکەی ڕۆبێرتی چێستەر ئەم وشەیەی گەیاندە ئەورووپا و لەوێوە algebra گەیشتە ئینگلیزی.
A pattern of pebblesنەخشێکی هەڵمات
The essay's simple example: imagine a clay board with pebbles set on it in columns. The first column (from the left) has 2 pebbles, the second has 3, the third has 4, and so on: every new column has one pebble more.
نموونە سادەکەی نامیلکەکە: وێنای تەختەیەکی قوڕ بکە کە هەڵماتی بە ستوون لەسەر دانراوە. ستوونی یەکەم (لە چەپەوە) 2 هەڵماتی هەیە، دووەم 3، سێیەم 4 و بەم شێوەیە: هەموو ستوونێکی نوێ هەڵماتێکی زیاترە.
Here is a : it stands for the column number and can take different values. The is a : it never changes. Together, is an built from the variable and the constant 1.
لێرەدا : ژمارەی ستوونەکە دەنوێنێت و دەتوانێت نرخی جیاواز وەربگرێت. : هەرگیز ناگۆڕێت. پێکەوە کە لە و 1 دروست بووە.
Variables and constantsگۆڕاوەکان و نەگۆڕەکان
A letter such as x or y that stands for a number that can change or is not yet known. In , x is a variable and 1 is a .
پیتێکی وەک x یان y کە لە جیاتی ژمارەیەک دادەنرێت کە دەگۆڕێت یان هێشتا نەزانراوە. لە ـدا x گۆڕاوە و 1 .
A is a quantity that changes; it is not fixed. Everyday variables: the temperature in different places, a child's height as time passes, a car's speed during a trip, a person's age over the years. A stays the same: a person's date of birth, or the normal temperature of the human body (about 37 °C).
بڕێکە کە دەگۆڕێت؛ جێگیر نییە. نموونەی ڕۆژانەی : پلەی گەرمی لە شوێنی جیاواز، باڵای منداڵێک بە تێپەڕبوونی کات، خێرایی ئۆتۆمبێلێک لە ماوەی گەشتێکدا، تەمەنی کەسێک بە درێژایی ساڵەکان. وەک خۆی دەمێنێتەوە: ڕێکەوتی لەدایکبوونی کەسێک، یان پلەی گەرمیی ئاسایی جەستەی مرۆڤ (نزیکەی 37 °C).
The essay's more books example: Aram has 10 more books than Shilan. We do not know how many Shilan has, so call it . Then Aram's books are . If Shilan has 15 books, Aram has .
نموونەی کتێبی زیاتری نامیلکەکە: ئارام 10 کتێبی زیاترە لە شیلان. نازانین شیلان چەند کتێبی هەیە، بۆیە ناوی دەنێین . کەواتە کتێبەکانی ئارام ـن. ئەگەر شیلان 15 کتێبی هەبێت، ئارام کتێبی هەیە.
“=” in algebra and in programming«=» لە جەبر و لە بەرنامەسازیدا
In algebra you can write . It is a statement of fact: is equal to 5. Now write two lines together: and . In algebra this is impossible at once, because cannot equal 5 and 11 at the same time.
لە دەتوانیت بنووسیت . ئەمە ڕستەیەکی ڕاستییە: یەکسانە بە 5. ئێستا دوو دێڕ پێکەوە بنووسە: و . لە ئەمە دەستبەجێ مەحاڵە، چونکە ناتوانێت لە هەمان کاتدا یەکسان بێت بە 5 و 11.
In the same sign means something else. In C, C++, Java or C#, int x = 2 + 3; does not compare two sides. It is an : work out the right side and store the result in the x. A later x = 11; replaces the 5 with 11. At the end x holds 11, not 5. Python works the same way:
لە هەمان نیشانە واتایەکی تری هەیە. لە C، C++، Java یان C#ـدا، int x = 2 + 3; دوو لا بەراورد ناکات. : لای ڕاست حساب بکە و ئەنجامەکە لە xـدا هەڵبگرە. دواتر x = 11; لە جیاتی 5، 11 دادەنێت. لە کۆتاییدا x 11ی تێدایە، نەک 5. Python بە هەمان شێوە کار دەکات:
x = 2 + 3
print(x)
x = 11
print(x)
print(x == 5)5 11 False
Explain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 1
Assignment:
xgets the value 5.:
xنرخی 5 وەردەگرێت.- Lineدێڕی 3
A new assignment replaces the old value.
دووەم لە جیاتی نرخە کۆنەکە نرخێکی نوێ دادەنێت.
- Lineدێڕی 5
To compare, Python uses
==, which givesTrueorFalse.بۆ بەراوردکردن، Python
==بەکار دەهێنێت کەTrueیانFalseدەدات.
Assignment, == and variables in programs are taught in the Python track: Assignment.
، == و لە لە بەشی Pythonـدا دەخوێنرێن: دانانی نرخ.
Boolean algebra: the algebra of 0 and 1جەبری بوول: جەبری 0 و 1
is a branch of algebra that works with logical values (true and false) and with binary variables that can only be 0 or 1. It is the language of electricity in a computer: it describes how digital circuits work. George Boole created it in 1847 and 1854, and in 1937 Claude Shannon showed that switch circuits follow exactly Boole's rules.
لقێکی کە لەگەڵ نرخە لۆجیکییەکان () و کار دەکات کە تەنها دەتوانن 0 یان 1 بن. زمانی کارەبایە لەناو : شێوازی کارکردنی ڕوون دەکاتەوە. جۆرج بوول لە 1847 و 1854دا دایهێنا و لە 1937دا کلۆد شانۆن پیشانی دا کە کە تێدایە ڕێک یاساکانی بوول پەیڕەو دەکەن.
The essay (following byjus.com) lists six kinds of laws. Each is written with · for AND, + for OR and a bar () or a dash () for NOT:
نامیلکەکە (بە پەیڕەوی لە byjus.com) شەش جۆر یاسا ڕیز دەکات. هەر یەکەیان بە · بۆ AND، + بۆ OR و هێڵێک لە سەرەوە () یان نیشانەیەک () بۆ NOT دەنووسرێت:
| Lawیاسا | Exampleنموونە |
|---|---|
| AND lawیاسای AND | |
| OR lawیاسای OR | |
| Inversion lawیاسای پێچەوانەکردن |
The essay concentrates on AND, OR and inversion (NOT) because they are the closest to how computers work. The next two screens take them in turn; the full list of laws, including De Morgan's, is in Logic Design: Boolean expressions and laws and De Morgan's theorems. Mathsisfun's Boolean algebra page, one of the essay's sources, lists the laws with examples.
نامیلکەکە سەرنج دەخاتە سەر AND، OR و پێچەوانەکردن (NOT)، چونکە نزیکترینن لە شێوازی کارکردنی . دوو پەڕەی داهاتوو یەک لە دوای یەک باسیان دەکەن؛ لیستی تەواوی یاساکان، لەوانە هی دی مۆرگان، لە خولی دیزاینی : دەربڕینە بوولییەکان و یاساکانی جەبری بوول و سەلمێنراوەکانی دی مۆرگان. پەڕەی Boolean algebraی Mathsisfun کە یەکێکە لە سەرچاوەکانی نامیلکەکە، یاساکان بە نموونەوە ڕیز دەکات.
The AND and OR lawsیاساکانی AND و OR
AND works like multiplication of 0s and 1s: if any input is 0, the result is 0, and only 1 AND 1 gives 1. OR gives 1 if at least one input is 1, and only 0 OR 0 gives 0. From these come the essay's four AND laws and four OR laws:
AND وەک لێکدانی 0 و 1 کار دەکات: ئەگەر هەر 0 بێت، ئەنجامەکە 0ـە و تەنها 1 AND 1 دەکاتە 1. OR دەکاتە 1 ئەگەر لانیکەم یەک 1 بێت و تەنها 0 OR 0 دەکاتە 0. چوار یاساکەی AND و چوار یاساکەی ORـی نامیلکەکە لێرەوە دێن:
Top row: the AND laws. Bottom row: the OR laws. Check each one with and then . Careful: this + is OR, not ordinary addition, so .
ڕیزی سەرەوە: یاساکانی AND. ڕیزی خوارەوە: یاساکانی OR. هەر یەکەیان بە و پاشان تاقی بکەرەوە. ئاگادار بە: ئەم + واتە OR، نەک کۆکردنەوەی ئاسایی، بۆیە .
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |


Each gate, with its switch model, symbol and timing diagram, is taught in Logic Design: The AND gate and The OR gate, including why OR is not addition. All the rules are in The 12 rules of Boolean algebra. Python's and and or follow the same tables: Logical operators.
هەر گەیتێک، لەگەڵ نموونەی سویچەکەی، و ، لە خولی دیزاینی دەخوێنرێت: گەیتی AND و گەیتی OR، لەوانە بۆچی OR کۆکردنەوە نییە. هەموو یاساکان لە دوازدە یاساکەی جەبری بوولدان. and و orـی Python هەمان خشتە پەیڕەو دەکەن: کارپێکەرە لۆجیکییەکان.
Inversion: the NOT lawپێچەوانەکردن: یاسای NOT
NOT (inversion) has only one . When 0 goes in, the is 1; when 1 goes in, the output is 0. Doing NOT twice brings back the original value: not (not hungry) means hungry. The switch model of NOT (a switch across the lamp) and the NOT gate itself are in Logic gates and the NOT gate.
NOT (پێچەوانەکردن) تەنها یەک هەیە. کاتێک 0 دەچێتە ژوورەوە، دەبێتە 1؛ کاتێک 1 دەچێتە ژوورەوە، دەبێتە 0. دووجار NOT نرخە ڕەسەنەکە دەگەڕێنێتەوە: نا (نا برسی) واتە برسی. نموونەی NOT ( بە تەریبی گڵۆپەکە) و خودی لە گەیتە لۆجیکییەکان و گەیتی NOTدان.
From gates to the CPUلە گەیتە لۆجیکییەکانەوە بۆ CPU
A is a tiny electronic switch with no moving parts. From transistors we build (AND, OR, NOT and the rest), and from gates we build circuits that add binary numbers. A famous part of the CPU, the (ALU), is built from such circuits: it does arithmetic operations (, ) and logic operations (AND, OR, NOT) on bits. A modern CPU contains billions of transistors wired into gates.
ئەلیکترۆنیی زۆر بچووکە کە هیچ پارچەیەکی جووڵاوی نییە. لە دروست دەکەین (AND، OR، NOT و ئەوانی تر) و لە دروست دەکەین کە ژمارەی کۆ دەکەنەوە. بەشێکی ناوداری CPU، (ALU)، لە لەم جۆرە دروست کراوە: (، ) و (AND، OR، NOT) لەسەر ئەنجام دەدات. CPUـیەکی ئەمڕۆ بلیۆنان تێدایە کە پێکدەهێنن.
| Chip | Yearساڵ | Transistors |
|---|---|---|
| Apple A17 Pro (phone)Apple A17 Pro (بۆ مۆبایل) | 2023 | about 19 billionنزیکەی 19 بلیۆن |
| Apple M1 Max (laptop)Apple M1 Max (بۆ ) | 2021 | about 57 billionنزیکەی 57 بلیۆن |
| Apple M3 Max (laptop)Apple M3 Max (بۆ ) | 2023 | about 92 billionنزیکەی 92 بلیۆن |
From gates to the CPUلە گەیتە لۆجیکییەکانەوە بۆ CPU
Algebra: the computer's “mind”جەبر: «ئەقڵ»ی کۆمپیوتەر
The essay's example was a chip with 60 billion transistors (a 2020 article). The numbers keep growing, but the idea stays the same: billions of on/off switches following the rules of Boolean algebra. Programmers meet the same operators in code: AND, OR, NOT and XOR (exclusive OR, which gives 1 only when the two inputs are different) all come from Boolean algebra. XOR is taught in XOR and XNOR.
نموونەکەی نامیلکەکە بوو بە 60 بلیۆن (وتارێکی 2020). ژمارەکان هەر زیاد دەبن، بەڵام بیرۆکەکە وەک خۆی دەمێنێتەوە: بلیۆنان کار/ناکار کە یاساکانی پەیڕەو دەکەن. بەرنامەسازەکان هەمان لە کۆددا دەبینن: AND، OR، NOT و XOR (ORـی تایبەت، کە تەنها کاتێک 1 دەدات کە دوو جیاواز بن) هەموویان لە هاتوون. XOR لە گەیتی XORدا دەخوێنرێت.
In the end we reach the essay's conclusion: algebra is the foundation of the computer's “mind”. Without it the computer as we know it would not exist. Gates in detail: What is a logic gate?; truth tables in logic: Truth tables.
لە کۆتاییدا دەگەینە ئەنجامەکەی نامیلکەکە: بناغەی «ئەقڵ»ی . بەبێ ئەو، بەم شێوەیەی دەیناسین نەدەهاتە ئاراوە. بە وردی: گەیتی لۆجیکی چییە؟؛ لە لۆجیکدا: خشتەکانی ڕاستی.
Two branches of algebra in the computerدوو لقی جەبر لەناو کۆمپیوتەردا
The essay ends its algebra part with a diagram that joins algebra to the CPU. Algebra reaches the computer along two separate roads. leads to and to the CPU. leads to , which power and .
نامیلکەکە بەشی بە هێڵکارییەک تەواو دەکات کە بە CPU دەبەستێتەوە. بە دوو ڕێگای جیاواز دەگاتە . دەگاتە و CPU. دەگاتە کە و دەجووڵێنن.
Linear algebra and matricesجەبری هێڵی و ماتریکسەکان
Mathematicians built from such as . Its main tool is the (plural: matrices): a rectangular of numbers inside square brackets. A matrix with rows and columns has the shape .
بیرکاریزانەکان لە وەک دروست کرد. ئامرازی سەرەکیی (کۆ: ): لاکێشەیی ژمارە لەناو کەوانەی چوارگۆشەدا. کە ڕیز و ستوونی هەبێت، شێوەی ـە.
An arranges things, such as numbers, in rows and/or columns, and a table is made of arrays. The clearest everyday array is the multiplication chart:
شتەکان، وەک ژمارە، بە ڕیز و/یان ستوون ڕیز دەکات و خشتە لە چەند پێکدێت. ڕوونترین ڕۆژانە خشتەی لێکدانە:
The times table as a matrix: the number in row and column is .
خشتەی لێکدانی وەک : ژمارەی ڕیزی و ستوونی دەکاتە .
- : one number.
- : one row or one column of numbers (shape or ).
- : a rectangle of numbers, here .
- : the same idea in more than two dimensions. AI libraries store a colour photo as a tensor with three sizes: height, width and 3 colours.
- : یەک ژمارە.
- : یەک ڕیز یان یەک ستوون ژمارە (شێوەی یان ).
- : لاکێشەیەک ژمارە، لێرەدا .
- : هەمان بیرۆکە لە زیاتر لە دوو ڕەهەنددا. کتێبخانەکانی وێنەیەکی ڕەنگاوڕەنگ وەک بە سێ قەبارە هەڵدەگرن: بەرزی، پانی و 3 ڕەنگ.
In Python a matrix is a list of lists: see 2-D lists and the AI course's grids.
لە Pythonـدا لیستێکە لە لیستەکان: بڕوانە لیستە دووڕەهەندەکان و تۆڕەکانی خولی .
Learn more: the Calculus course has a whole chapter on matrices and determinants. It starts with Matrix Notation and Special Matrices.
زیاتر بزانە: خولی کالکولەس بەشێکی تەواوی دەربارەی و هەیە کە بە نووسینی ماتریکس و جۆرە تایبەتەکانی دەست پێدەکات.
Types of matricesجۆرەکانی ماتریکس
Some matrices have their own names. These are the types shown in the essay's picture:
هەندێک ناوی تایبەتی خۆیان هەیە. ئەمانە ئەو جۆرانەن کە لە وێنەکەی نامیلکەکەدا پیشان دراون:
| Typeجۆر | Exampleنموونە | What makes it specialچی تایبەتی دەکات |
|---|---|---|
| Row matrix ڕیزی | Only one rowتەنها یەک ڕیز | |
| Column matrix ستوونی | Only one columnتەنها یەک ستوون | |
| Zero (null) matrix سفر | Every entry is 0هەموو ژمارەکانی 0ـن | |
| Square matrix چوارگۆشەیی | As many rows as columnsژمارەی ڕیز و ستوونی یەکسانە | |
| Diagonal matrix تیرەیی | Square; zeros everywhere off the main diagonalچوارگۆشەییە؛ جگە لە هەموو شوێنێک سفرە | |
| Scalar matrix سکالێری | Diagonal, with the same number all along the diagonalتیرەییە و هەمان ژمارە بە درێژایی تیرەکەیە | |
| Unit (identity) matrix یەکە | Diagonal of 1s; multiplying by it changes nothingتیرەیەکی 1ـە؛ لێکدان لەگەڵیدا هیچ ناگۆڕێت | |
| Upper triangularسێگۆشەیی سەرەوە | Zeros below the main diagonalسفر لە ژێر | |
| Lower triangularسێگۆشەیی خوارەوە | Zeros above the main diagonalسفر لە سەرووی |
The main diagonal (Kurdish school books also call it تەوەرەی سەرەکی) runs from the top-left corner to the bottom-right corner. Do not mix up a scalar matrix with a scalar: a scalar is one number, a scalar matrix is a whole square of numbers.
(کتێبەکانی قوتابخانەی کوردستان پێی دەڵێن تەوەرەی سەرەکیش) لە گۆشەی سەرەوەی چەپەوە بۆ گۆشەی خوارەوەی ڕاست دەڕوات. سکالێری لەگەڵ تێکەڵ مەکە: یەک ژمارەیە، سکالێری چوارگۆشەیەکی تەواوی ژمارەیە.
In Kurdish: what a matrix is (m × n), then square, scalar, zero and identity matrices, the main diagonal, block-diagonal matrices and the transpose.
بە کوردی: چییە ()، پاشان ، ، و ، ، کە بلۆکەکانی لەسەر تیرەکەن، هەروەها .
In Kurdish, explained from handwritten notes.
بە کوردی، لەسەر پەڕەی دەستنووس ڕوون دەکرێتەوە.
Multiplying matrices: row times columnلێکدانی ماتریکسەکان: ڕیز لە ستوون
To multiply two matrices, take a row of the first and a column of the second, multiply them number by number and add. That sum is one entry of the answer.
بۆ لێکدانی دوو ، ڕیزێک لە یەکەم و ستوونێک لە دووەم وەربگرە، ژمارە بە ژمارە لێکیان بدە و کۆیان بکەرەوە. ئەو کۆیە یەک ژمارەی وەڵامەکەیە.
- Top-left: row 1 times column 1سەرەوەی چەپ: ڕیزی 1 لە ستوونی 1
- Top-right: row 1 times column 2سەرەوەی ڕاست: ڕیزی 1 لە ستوونی 2
- Bottom-left: row 2 times column 1خوارەوەی چەپ: ڕیزی 2 لە ستوونی 1
- Bottom-right: row 2 times column 2خوارەوەی ڕاست: ڕیزی 2 لە ستوونی 2
Why numbers are kept in a matrix, and how each product entry is a row of the first times a column of the second.
چین و چۆن لێکیان دەدەیت: ڕیزێکی یەکەم لە ستوونێکی دووەم، ژمارە بە ژمارە لێک دەدرێن، پاشان کۆ دەکرێنەوە.
From 1:58 to the end: row-times-column multiplication of two 2 × 2 matrices, then an example. (0:48-1:58, skipped here, is about adding matrices and multiplying by a scalar.)
لە 1:58ـەوە تا کۆتایی: لێکدانی ڕیز لە ستوون بۆ دوو ، پاشان نموونەیەک. (0:48 تا 1:58، کە لێرەدا بەجێ دەهێڵرێت، کۆکردنەوەی و لێکدانیان لە ڕوون دەکاتەوە.)
Matrices move, turn and resize picturesماتریکسەکان وێنە دەجووڵێنن، دەسووڕێنن و قەبارەیان دەگۆڕن
In , especially in 3-D games, matrices carry out : moving an object to a new place (translation, a ), turning it () and making it bigger or smaller (). Each of these can be written as a transformation matrix. To turn a teapot in a game, the computer multiplies every corner of the teapot by the same matrix.
لە ، بەتایبەت لە یارییە سێڕەهەندییەکاندا، ئەنجام دەدەن: بردنی شتێک بۆ شوێنێکی نوێ ()، و گەورە یان بچووککردنەوەی (). هەر یەکەیان دەتوانرێت وەک بنووسرێت. بۆ قۆرییەک لە یارییەکدا، هەموو گۆشەیەکی قۆرییەکە بە هەمان لێک دەدات.
Two transformation matrices: turns a point 90° anticlockwise about the origin; doubles its distance from the origin, so becomes .
دوو : خاڵێک 90 پلە بە پێچەوانەی کاتژمێر بە دەوری دەسووڕێنێت؛ دووریەکەی لە دوو هێندە دەکات، بۆیە دەبێتە .
A 2×2 matrix moves the whole grid; where the two basic arrows land gives the matrix. Examples include a 90° turn and a shear.
هەموو تۆڕەکە دەجووڵێنێت؛ شوێنی گەیشتنی دوو بنەڕەتییەکە دیاری دەکات. نموونەکان: و لارکردنەوەیەک (shear).
Chapter 8:03 shows the 90° rotation matrix used on this screen.
بەشی 8:03 هەمان پیشان دەدات کە لەسەر ئەم شاشەیە بەکار هاتووە.
The transpose: rows become columnsجێگۆڕکێی ماتریکس: ڕیز دەبێتە ستوون
The of a matrix , written , is made by writing every row of as a column: row 1 becomes column 1, row 2 becomes column 2, and so on. The essay's example:
: بۆ ، بەوە دروست دەبێت کە هەموو ڕیزێکی وەک ستوونێک بنووسیت: ڕیزی 1 دەبێتە ستوونی 1، ڕیزی 2 دەبێتە ستوونی 2 و بەم شێوەیە. نموونەکەی نامیلکەکە:


- An matrix becomes : the transpose of a matrix is .
- Transposing twice gives the matrix back: .
- The numbers on the main diagonal (top-left to bottom-right) never move.
- دەبێتە : بۆ نموونە دوای دەبێتە .
- ئەگەر دوو جار بکەیت، وەک خۆی دەگەڕێتەوە: .
- ژمارەکانی سەر (لە سەرەوەی چەپەوە بۆ خوارەوەی ڕاست) هەرگیز ناجووڵێن.
A transpose is a mirror, not a turnجێگۆڕکێی ماتریکس ئاوێنەیە، نەک سووڕانەوە
The essay asks a nice question: when you edit a photo and turn it to the left or right, what does the work? Its answer is “a matrix” (correct: a photo is a grid of pixels, so it is a matrix of colour values). But it then names the operation the transpose, which is not right.
نامیلکەکە پرسیارێکی جوان دەکات: کاتێک وێنەیەک دەستکاری دەکەیت و بەرەو چەپ یان ڕاست دەیسووڕێنیت، چی ئەو کارە دەکات؟ وەڵامەکەی «»ـە (ڕاستە: وێنە تۆڕێکی ، بۆیە نرخی ڕەنگە). بەڵام پاشان ئەو کارە بە ناو دەبات کە ڕاست نییە.
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
T = [list(row) for row in zip(*A)] # transpose: rows become columns
R = [row[::-1] for row in T] # then flip each row
print(T)
print(R)[[1, 4, 7], [2, 5, 8], [3, 6, 9]] [[7, 4, 1], [8, 5, 2], [9, 6, 3]]
Explain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 5
zip(*A)takes the first item of every row, then the second, … : those are the columns.zip(*A)یەکەم ژمارەی هەموو ڕیزێک وەردەگرێت، پاشان دووەم، … : ئەمانە ستوونەکانن.- Lineدێڕی 6
row[::-1]reverses one row. After this step the picture is turned 90° clockwise.row[::-1]یەک ڕیز پێچەوانە دەکاتەوە. دوای ئەم هەنگاوە وێنەکە 90 پلە بەلای کاتژمێردا سووڕاوە.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | What is trueڕاستییەکە |
|---|---|
Reading x = x + 1 in a program as an impossible equation.خوێندنەوەی x = x + 1 لە وەک مەحاڵ. | In programs = is assignment: compute the right side, store it in x.لە = : لای ڕاست حساب بکە و لە xـدا هەڵیبگرە. |
| Thinking in Boolean algebra.پێتوابێت لە . | + means OR, so .+ واتە OR، بۆیە . |
| Calling NOT “NOR”.ناونانی NOT بە «NOR». | NOT has one input; NOR has two inputs and means NOT (A OR B), .NOT یەک هەیە؛ NOR دوو هەیە و واتە NOT (A OR B)، . |
| Using for the pebble count in the rule .بەکارهێنانی بۆ ژمارەی هەڵمات لە یاسای ـدا. | is the column number; is the pebble count. ژمارەی ستوونە؛ ژمارەی هەڵماتە. |
| Drawing linear algebra as the step before Boolean algebra.کێشانی وەک هەنگاوی پێش . | They are two separate branches of algebra.دوو لقی جیاوازی . |
| Assuming for matrices.وا دانان کە بۆ . | Order matters: usually .ڕیزبەندی گرنگە: زۆرجار . |
| Thinking a transpose rotates a picture.پێتوابێت وێنە دەسووڕێنێت. | It mirrors it across the main diagonal; a turn needs one more step.لە سەر وێنەی دەداتەوە؛ سووڕانەوە هەنگاوێکی تری پێویستە. |
Exercisesڕاهێنانەکان
Write “the thing which, added to nine things, makes fifteen things” as an equation and solve it.
«ئەو شتەی لەگەڵ نۆ شتدا کۆ دەکرێتەوە و دەکاتە پازدە شت» وەک بنووسە و چارەسەری بکە.
Show answerوەڵامەکە پیشان بدە
Columns 1, 2, 3, 4 of a new pebble pattern hold 3, 5, 7, 9 pebbles. Write the number of pebbles in column as an algebraic expression, then find column 20.
ستوونەکانی 1، 2، 3، 4ی نەخشێکی نوێی هەڵمات 3، 5، 7، 9 هەڵماتیان تێدایە. ژمارەی هەڵماتەکانی ستوونی وەک بنووسە، پاشان ستوونی 20 بدۆزەوە.
Hintئاماژە
How many pebbles does each new column add?
هەر ستوونێکی نوێ چەند هەڵمات زیاد دەکات؟
Show answerوەڵامەکە پیشان بدە
Each new column adds 2 pebbles, so the rule has . Column 1 has , so the rule is . Column 20: pebbles.
هەر ستوونێکی نوێ 2 هەڵمات زیاد دەکات، بۆیە یاساکە ـی تێدایە. ستوونی 1 ـی هەیە، بۆیە یاساکە ـە. ستوونی 20: هەڵمات.
Let and . Find , , and (NOR).
با و بن. ، ، و (NOR) بدۆزەوە.
Show answerوەڵامەکە پیشان بدە
Find .
بدۆزەوە.
Show answerوەڵامەکە پیشان بدە
Write the transpose of and give the shapes before and after.
بنووسە و شێوەکانی پێش و دوا بڵێ.
Show answerوەڵامەکە پیشان بدە
becomes .
دەبێتە .
What does this Python program print?
ئەم کۆدەی Python چی چاپ دەکات؟
x = 4
x = x + 1
print(x)Show answerوەڵامەکە پیشان بدە
x = 4
x = x + 1
print(x)5
Summaryپوختە
- writes problems as expressions with letters: the old words “the thing plus five things makes eight” became . The word comes from al-Khwarizmi's al-jabr (Baghdad, about 820).
- A changes, a does not; is an algebraic expression. In programs
=means assignment, not equality. - works with 0 and 1. AND: ; OR: ; NOT: . Switches in series act like AND, in parallel like OR.
- Transistors build gates, gates build the ALU and the CPU (tens of billions of transistors today).
- gives matrices: multiply row by column; matrices move, turn and resize objects in games.
- A transpose turns rows into columns and mirrors across the main diagonal; a 90° turn is a transpose followed by reversing each row.
- کێشەکان بە دەنووسێت: وشە کۆنەکانی «شتەکە کۆ پێنج شت دەکاتە هەشت» بوون بە . وشەکە لە الجبرـی خوارزمییەوە هاتووە (بەغدا، نزیکەی 820).
- دەگۆڕێت، ناگۆڕێت؛ . لە
=واتە ، نەک یەکسانی. - لەگەڵ 0 و 1 کار دەکات. AND: ؛ OR: ؛ NOT: . بە دوای یەکدا وەک AND و لە تەنیشت یەکتر وەک OR ڕەفتار دەکەن.
- دروست دەکەن، ALU و CPU دروست دەکەن (ئەمڕۆ دەیان بلیۆن ).
- دەدات: ڕیز لە ستوون لێک بدە؛ شتەکان لە یارییەکاندا دەجووڵێنن، دەسووڕێنن و قەبارەیان دەگۆڕن.
- ڕیز دەکاتە ستوون و لە سەر وێنە دەداتەوە؛ سووڕانەوەی 90 پلە و پاشان پێچەوانەکردنی هەر ڕیزێک.
Next: What is statistics?
دواتر: ئامار چییە؟
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
What Is Statistics? Data, Populations and Samplesئامار چییە؟ دراوە، کۆمەڵگە و نموونە
Related lecturesوانە پەیوەندیدارەکان
- Logic Gates, Truth Tables and the NOT Gateگەیتە لۆجیکییەکان، خشتەکانی ڕاستی و گەیتی NOT
- The AND Gateگەیتی AND
- The OR Gateگەیتی OR
- Variables and Data Typesگۆڕاوەکان و جۆرەکانی دراوە
- Logical Operators and Nested ifکارپێکەرە لۆجیکییەکان و ڕستەی ifـی ناوەکی
- Propositional Logic and Knowledge Basesلۆجیکی گوزارەیی و بنکەکانی زانین
- Stretching, Compressing and Reflecting Graphsدرێژکردنەوە، پەستاندن و وێنەدانەوەی هێڵکاری
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- Wikipedia: The Compendious Book on Calculation by Completion and Balancing (al-Khwarizmi, al-jabr)
- Cuemath: Algebra in real life
- Math is Fun: Boolean algebra (laws)
- BYJU'S: Boolean algebra (six kinds of laws)
- Wikipedia: Boolean algebra (Boole 1847/1854; Shannon's switching algebra)
- Wikipedia: A Symbolic Analysis of Relay and Switching Circuits (Shannon, 1937)
- Wikipedia: Transistor count
- Wikipedia: Transpose (reflection across the main diagonal)
- Wikipedia: Transformation matrix (rotation, scaling, homogeneous coordinates)
- Python documentation: Built-in functions (zip)
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.