Chapterبەش 1 · Lectureوانە 1.2

Union, Intersection, Difference and Complementیەکگرتن، یەکتربڕین، جیاوازیی کۆمەڵە و تەواوکەر

How to build new sets from old ones: the universal set and Venn diagrams, union, intersection, disjoint sets, difference and complement, with worked examples and their use in databases, search filters and Python.

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

12 min read13 خولەک خوێندنەوە · 14 stepsهەنگاو

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

  • Draw and read a Venn diagram with a universal set.
  • Find the union, intersection, difference and complement of given sets.
  • Decide whether two sets are disjoint and explain why A−B≠B−AA-B\ne B-A.
  • Recognise set operations in SQL, Python and search filters.
  • بە بکێشیت و بیخوێنیتەوە.
  • ، ، و چەند دراو بدۆزیتەوە.
  • بڕیار بدەیت دوو جیاکراوەن یان نا و ڕوونی بکەیتەوە بۆچی A−B≠B−AA-B\ne B-A.
  • لە SQL، Python و گەڕاندا بناسیتەوە.

Combining setsتێکەڵکردنی کۆمەڵەکان

In the previous lesson you learned to read and write one set. Real questions usually involve two sets. Imagine a class in Erbil. A is the set of students in the Python club and B is the set of students in the football team. The teacher may ask:

لە وانەی پێشوودا فێر بوویت چۆن یەک بخوێنیتەوە و بنووسیت. پرسیارە ڕاستەقینەکان زۆرجار دوو لەخۆ دەگرن. پۆلێک لە هەولێر وێنا بکە. A ئەو قوتابییانەیە کە لە یانەی Pythonـدان و B قوتابییانی تیمی تۆپی پێیە. مامۆستا لەوانەیە بپرسێت:

  • Who is in at least one of them? → the union
  • Who is in both? → the intersection
  • Who is in the Python club but not in the team? → the difference
  • Who is in neither? → the complement of the union
  • کێ لانیکەم لە یەکێکیاندایە؟ ←
  • کێ لە هەردووکیاندایە؟ ←
  • کێ لە یانەی Pythonـدایە بەڵام نەک لە تیمەکە؟ ←
  • کێ لە هیچیاندا نییە؟ ←

Each question builds a new set from A and B. This lesson gives each operation its symbol, its rule and a picture.

هەر پرسیارێک نوێ لە A و B دروست دەکات. ئەم وانەیە هێما، یاسا و وێنەی هەر دەدات.

Quick checkپشکنینی خێرا“Students who are in the Python club or in the football team (or in both)” describes which set?«ئەو قوتابییانەی کە لە یانەی Pythonـدان یان لە تیمی تۆپی پێدان (یان لە هەردووکیان)» کام وەسف دەکات؟

The universal set and Venn diagramsکۆمەڵەی گشتی و هێڵکارییەکانی ڤێن

Definitionپێناسە

The U of all the objects we are talking about in a problem. Every other set in the problem is a of U.

ئەو ⁦(U)⁩ کە هەموو ئەو شتانە لەخۆ دەگرێت کە لە پرسیارێکدا باسیان دەکەین. هەموو کۆمەڵەکانی تری پرسیارەکە Uـن.

Before we combine sets, we fix the universal set U: everything we are talking about in this problem. In the class example, U is all the students of the class. Every other set is a subset of U.

پێش تێکەڵکردنی ، ⁦(U)⁩ دیاری دەکەین: هەموو ئەو شتانەی لەم پرسیارەدا باسیان دەکەین. لە نموونەی پۆلەکەدا، U هەموو قوتابییانی پۆلەکەیە. هەموو تر Uـن.

In a Venn diagram, U is a rectangle and every set is a circle inside it. Two overlapping circles cut the rectangle into four regions. All examples of this lesson use U={1,2,…,7}U=\{1,2,\dots,7\}, A={1,2,3}A=\{1,2,3\} and B={2,3,4,5}B=\{2,3,4,5\}.

لە ، U لاکێشەیەکە و هەر بازنەیەکە لە ناویدا. دوو بازنە کە بەشێکیان بەسەر یەکدا کەوتووە، لاکێشەکە دەکەنە چوار ناوچە. هەموو نموونەکانی ئەم وانەیە U={1,2,…,7}U=\{1,2,\dots,7\}، A={1,2,3}A=\{1,2,3\} و B={2,3,4,5}B=\{2,3,4,5\} بەکار دەهێنن.

A Venn diagram of U = {1, …, 7}, A = {1, 2, 3} and B = {2, 3, 4, 5}. The region 'only A' holds 1, the overlap 'A and B' holds 2 and 3, 'only B' holds 4 and 5, and 'in neither' holds 6 and 7. A legend says: rectangle = the universal set U, circle = one set, overlap = elements in both. Each element sits in exactly one region.هێڵکاریی ڤێن بۆ U = {1, …, 7}، A = {1, 2, 3} و B = {2, 3, 4, 5}. ناوچەی «تەنها A» 1ـی تێدایە، بەشی هاوبەشی «A و B» 2 و 3ـی تێدایە، «تەنها B» 4 و 5ـی تێدایە و «لە هیچیان» 6 و 7ـی تێدایە. ڕوونکردنەوەیەک دەڵێت: لاکێشە = کۆمەڵەی گشتی (U)، بازنە = یەک کۆمەڵە، بەشی هاوبەش = ئەندامەکانی هەردووکیان. هەر ئەندامێک تەنها لە یەک ناوچەدایە.
The four regions of two sets. Every operation in this lesson is just a choice of regions.چوار ناوچەی دوو . هەموو لەم وانەیەدا تەنها هەڵبژاردنی چەند ناوچەیەکە.CêIT
Quick checkپشکنینی خێراIn the diagram, which region holds the element 6?لە هێڵکارییەکەدا، کام ناوچە 6 لەخۆ دەگرێت؟

What is a Universal Set? | Don't MemoriseSri Chaitanya Academy NEET · Englishئینگلیزی · 434K viewsبینین · 6.6K likesلایک

What the universal set is: the set of everything we are talking about in a problem, with simple examples.

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

Short (3:39) definition of the universal set with examples.

پێناسەیەکی کورت ⁦(3:39)⁩ بۆ ، لەگەڵ نموونە.

Union: A∪BA\cup Bیەکگرتن: A∪BA\cup B

Definitionپێناسە

The A∪BA\cup B of all elements that are in A, in B or in both: A∪B={x∣x∈A or x∈B}A\cup B=\{x \mid x\in A \text{ or } x\in B\}.

کۆمەڵەی A∪BA\cup B، کە هەموو ئەو ئەندامانە لەخۆ دەگرێت کە لە A یان لە B یان لە هەردووکیاندا هەن: A∪B={x∣x∈A or x∈B}A\cup B=\{x \mid x\in A \text{ or } x\in B\}.

A∪B={x ; x∈A or x∈B}A\cup B=\{x\,;\,x\in A\ \text{or}\ x\in B\}

x is in the union when it is in A, in B, or in both. The mathematical “or” always includes “both”.

x لە کاتێک لە A، لە B یان لە هەردووکیاندا بێت. «یان»ـی بیرکاری هەمیشە «هەردووکیان»یش دەگرێتەوە.

Example: A∪B={1,2,3}∪{2,3,4,5}={1,2,3,4,5}A\cup B=\{1,2,3\}\cup\{2,3,4,5\}=\{1,2,3,4,5\}. Put everything from both sets together and write each element once: 2 and 3 are in both sets but appear only once in the answer.

نموونە: A∪B={1,2,3}∪{2,3,4,5}={1,2,3,4,5}A\cup B=\{1,2,3\}\cup\{2,3,4,5\}=\{1,2,3,4,5\}. هەموو شتێکی هەردوو کۆ بکەرەوە و هەر تەنها یەک جار بنووسە: 2 و 3 لە هەردوو بەڵام تەنها یەک جار لە وەڵامەکەدا دەردەکەون.

A Venn diagram: a rectangle U holds two overlapping circles A and B. A alone holds 1, the overlap holds 2 and 3, B alone holds 4 and 5, and 6 and 7 lie outside both circles. Both circles are shaded. The panel beside it reads: Union A ∪ B, in A, in B, or in both, {x ; x ∈ A or x ∈ B}, A ∪ B = {1, 2, 3, 4, 5}.هێڵکاریی ڤێن: لاکێشەی U دوو بازنەی A و Bـی تێدایە کە بەشێکیان بەسەر یەکدا کەوتووە. A بە تەنها 1ـی تێدایە، بەشە هاوبەشەکە 2 و 3ـی تێدایە، B بە تەنها 4 و 5ـی تێدایە و 6 و 7 لە دەرەوەی هەردوو بازنەکەن. هەردوو بازنەکە ڕەنگ کراون. لە تەنیشتییەوە نووسراوە: یەکگرتن A ∪ B، لە A، لە B یان لە هەردووکیان، {x ; x ∈ A یان x ∈ B}، A ∪ B = {1, 2, 3, 4, 5}.
The union: everything inside either circle.: هەموو شتێک لە ناو هەر کام لە دوو بازنەکەدا.CêIT
Quick checkپشکنینی خێراWhat is {1,3}∪{3,5}\{1,3\}\cup\{3,5\}?{1,3}∪{3,5}\{1,3\}\cup\{3,5\} چەندە؟

Intersection: A∩BA\cap Bیەکتربڕین: A∩BA\cap B

Definitionپێناسە

The A∩BA\cap B of the elements that are in both A and B: A∩B={x∣x∈A and x∈B}A\cap B=\{x \mid x\in A \text{ and } x\in B\}.

کۆمەڵەی A∩BA\cap B، کە تەنها ئەو ئەندامانە لەخۆ دەگرێت کە هەم لە A و هەم لە Bـدا هەن: A∩B={x∣x∈A and x∈B}A\cap B=\{x \mid x\in A \text{ and } x\in B\}.

A∩B={x ; x∈A and x∈B}A\cap B=\{x\,;\,x\in A\ \text{and}\ x\in B\}

x is in the intersection only when it is in A and in B at the same time: the elements the two sets share.

x تەنها کاتێک لە کە لە هەمان کاتدا لە A و لە B بێت: ئەو دوو هاوبەشن تێیدا.

Example: A∩B={1,2,3}∩{2,3,4,5}={2,3}A\cap B=\{1,2,3\}\cap\{2,3,4,5\}=\{2,3\}. Walk through A and keep only the elements that also appear in B.

نموونە: A∩B={1,2,3}∩{2,3,4,5}={2,3}A\cap B=\{1,2,3\}\cap\{2,3,4,5\}=\{2,3\}. بە Aدا بڕۆ و تەنها ئەوانە بهێڵەوە کە لە Bـیشدا هەن.

A Venn diagram: a rectangle U holds two overlapping circles A and B. A alone holds 1, the overlap holds 2 and 3, B alone holds 4 and 5, and 6 and 7 lie outside both circles. Only the overlap of the two circles is shaded. The panel beside it reads: Intersection A ∩ B, in A and in B at the same time, {x ; x ∈ A and x ∈ B}, A ∩ B = {2, 3}.هێڵکاریی ڤێن: لاکێشەی U دوو بازنەی A و Bـی تێدایە کە بەشێکیان بەسەر یەکدا کەوتووە. A بە تەنها 1ـی تێدایە، بەشە هاوبەشەکە 2 و 3ـی تێدایە، B بە تەنها 4 و 5ـی تێدایە و 6 و 7 لە دەرەوەی هەردوو بازنەکەن. تەنها بەشی هاوبەشی دوو بازنەکە ڕەنگ کراوە. لە تەنیشتییەوە نووسراوە: یەکتربڕین A ∩ B، لە هەمان کاتدا لە A و لە B، {x ; x ∈ A و x ∈ B}، A ∩ B = {2, 3}.
The intersection: only the overlap.: تەنها بەشە هاوبەشەکە.CêIT
Quick checkپشکنینی خێراWhat is {a,b,c,d}∩{b,d,f}\{a,b,c,d\}\cap\{b,d,f\}?{a,b,c,d}∩{b,d,f}\{a,b,c,d\}\cap\{b,d,f\} چەندە؟

Intersection of Sets, Union of Sets and Venn DiagramsThe Organic Chemistry Tutor · Englishئینگلیزی · 3.1M viewsبینین · 54K likesلایک · Partبەشی 0:00–5:12 (ofلە 11:49)

How to find the intersection of two sets, the elements they share, and shade it in a Venn diagram.

چۆن دوو دەدۆزیتەوە، واتە ئەو لە هەردووکیاندا هەن، پاشان چۆن لە ڕەنگی دەکەیت.

Plays 0:00-5:12, the intersection part with Venn diagrams; the union part follows after 5:12.

لە ⁦0:00⁩ تا ⁦5:12⁩ پەخش دەبێت: بەشی لەگەڵ ؛ بەشی دوای ⁦5:12⁩ دێت.

Disjoint setsکۆمەڵە جیاکراوەکان

Definitionپێناسە

Two sets are disjoint when they have no element in common, that is when A∩B=∅A\cap B=\emptyset.

دوو کۆمەڵە جیاکراوەن کاتێک هیچ ئەندامێکی هاوبەشیان نییە، واتە کاتێک A∩B=∅A\cap B=\emptyset.

Two sets are disjoint if they have no element in common, that is A∩B=∅A\cap B=\emptyset. In a Venn diagram their circles do not overlap. Example: the odd numbers {1,3,5}\{1,3,5\} and the even numbers {2,4}\{2,4\} are disjoint.

دوو جیاکراوەن ئەگەر هیچ هاوبەشیان نەبێت، واتە A∩B=∅A\cap B=\emptyset. لە بازنەکانیان بەسەر یەکدا ناکەون. نموونە: ژمارە تاکەکانی {1,3,5}\{1,3,5\} و ژمارە جووتەکانی {2,4}\{2,4\} .

A Venn diagram with two separate circles inside U: A holds 1, 3 and 5; B holds 2 and 4. The text says: disjoint sets, no element in common, the circles do not overlap, A ∩ B = ∅.هێڵکاریی ڤێن بە دوو بازنەی جیاواز لە ناو Uـدا: A، 1، 3 و 5ـی تێدایە؛ B، 2 و 4ـی تێدایە. دەقەکە دەڵێت: کۆمەڵە جیاکراوەکان، هیچ ئەندامێکیان هاوبەش نییە، بازنەکان بەسەر یەکدا ناکەون، A ∩ B = ∅.
Disjoint sets: two circles that never touch.: دوو بازنە کە هەرگیز یەکتر نابڕن.CêIT
Quick checkپشکنینی خێراWhich pair of sets is disjoint?کام جووت جیاکراوەن؟

Difference: A−BA-Bجیاوازیی کۆمەڵە: A−BA-B

Definitionپێناسە

The A−BA-B (also A∖BA\setminus B) of the elements that are in A but not in B.

کۆمەڵەی A−BA-B (یان A∖BA\setminus B)، کە ئەو ئەندامانە لەخۆ دەگرێت کە لە Aـدا هەن بەڵام لە Bـدا نین.

A−B={x ; x∈A and x∉B}A-B=\{x\,;\,x\in A\ \text{and}\ x\notin B\}

Start with A and remove everything that is also in B. Many books write A∖BA\setminus B for the same set.

لە Aـەوە دەست پێبکە و هەموو ئەو شتانە لابە کە لە Bـیشدا هەن. زۆر کتێب هەمان بە A∖BA\setminus B دەنووسن.

The course example: A={a,b,c,d}A=\{a,b,c,d\} and B={a,b}B=\{a,b\}, so A−B={c,d}A-B=\{c,d\}: remove a and b from A.

نموونەی کۆرسەکە: A={a,b,c,d}A=\{a,b,c,d\} و B={a,b}B=\{a,b\}، بۆیە A−B={c,d}A-B=\{c,d\}: a و b لە A لابە.

With our sets: A−B={1,2,3}−{2,3,4,5}={1}A-B=\{1,2,3\}-\{2,3,4,5\}=\{1\}, but B−A={4,5}B-A=\{4,5\}. The order matters: A−B≠B−AA-B\ne B-A, just as 5−3≠3−55-3\ne3-5.

بە خۆمان: A−B={1,2,3}−{2,3,4,5}={1}A-B=\{1,2,3\}-\{2,3,4,5\}=\{1\}، بەڵام B−A={4,5}B-A=\{4,5\}. ڕیزبەندی گرنگە: A−B≠B−AA-B\ne B-A، هەر وەک چۆن 5−3≠3−55-3\ne3-5.

A Venn diagram: a rectangle U holds two overlapping circles A and B. A alone holds 1, the overlap holds 2 and 3, B alone holds 4 and 5, and 6 and 7 lie outside both circles. Only the part of A outside B is shaded. The panel beside it reads: Difference A − B, in A but not in B, {x ; x ∈ A and x ∉ B}, A − B = {1}.هێڵکاریی ڤێن: لاکێشەی U دوو بازنەی A و Bـی تێدایە کە بەشێکیان بەسەر یەکدا کەوتووە. A بە تەنها 1ـی تێدایە، بەشە هاوبەشەکە 2 و 3ـی تێدایە، B بە تەنها 4 و 5ـی تێدایە و 6 و 7 لە دەرەوەی هەردوو بازنەکەن. تەنها ئەو بەشەی A ڕەنگ کراوە کە لە دەرەوەی Bـیە. لە تەنیشتییەوە نووسراوە: جیاوازیی کۆمەڵە A − B، لە A بەڵام نەک لە B، {x ; x ∈ A و x ∉ B}، A − B = {1}.
A−BA-B: the part of A that B does not cover.A−BA-B: ئەو بەشەی A کە B دایناپۆشێت.CêIT
Quick checkپشکنینی خێراLet P={2,4,6,8}P=\{2,4,6,8\} and Q={4,8,12}Q=\{4,8,12\}. What is Q−PQ-P?با P={2,4,6,8}P=\{2,4,6,8\} و Q={4,8,12}Q=\{4,8,12\} بن. Q−PQ-P چەندە؟

Complement: AcA^{c}تەواوکەر: AcA^{c}

Definitionپێناسە

The AcA^c of everything in the U that is not in A: Ac=U−AA^c=U-A.

کۆمەڵەی AcA^c، کە هەموو ئەو شتانەی ⁦(U)⁩ لەخۆ دەگرێت کە لە Aـدا نین: Ac=U−AA^c=U-A.

Ac={x∈U ; x∉A}=U−AA^{c}=\{x\in U\,;\,x\notin A\}=U-A

The complement is everything in the universal set that is not in A. It is also written A′A' or A‾\overline{A}.

هەموو ئەو شتانەی کە لە Aـدا نین. بە A′A' یان A‾\overline{A}ـیش دەنووسرێت.

With U={1,2,…,7}U=\{1,2,\dots,7\} and A={1,2,3}A=\{1,2,3\}: Ac={4,5,6,7}A^{c}=\{4,5,6,7\}. Another example: if U is the digits {0,1,…,9}\{0,1,\dots,9\} and A is the prime digits {2,3,5,7}\{2,3,5,7\}, then Ac={0,1,4,6,8,9}A^{c}=\{0,1,4,6,8,9\}.

بە U={1,2,…,7}U=\{1,2,\dots,7\} و A={1,2,3}A=\{1,2,3\}: Ac={4,5,6,7}A^{c}=\{4,5,6,7\}. نموونەیەکی تر: ئەگەر U تاکژمارەکانی {0,1,…,9}\{0,1,\dots,9\} بێت و A ژمارە سەرەتاییەکانی {2,3,5,7}\{2,3,5,7\} بێت، ئەوا Ac={0,1,4,6,8,9}A^{c}=\{0,1,4,6,8,9\}.

A Venn diagram: a rectangle U holds two overlapping circles A and B. A alone holds 1, the overlap holds 2 and 3, B alone holds 4 and 5, and 6 and 7 lie outside both circles. Everything inside the rectangle except circle A is shaded, including the part of B outside A. The panel beside it reads: Complement Aᶜ, in U but not in A, {x ∈ U ; x ∉ A}, Aᶜ = {4, 5, 6, 7}.هێڵکاریی ڤێن: لاکێشەی U دوو بازنەی A و Bـی تێدایە کە بەشێکیان بەسەر یەکدا کەوتووە. A بە تەنها 1ـی تێدایە، بەشە هاوبەشەکە 2 و 3ـی تێدایە، B بە تەنها 4 و 5ـی تێدایە و 6 و 7 لە دەرەوەی هەردوو بازنەکەن. هەموو ناو لاکێشەکە جگە لە بازنەی A ڕەنگ کراوە، بەشی B کە لە دەرەوەی Aـیە لەگەڵیدا. لە تەنیشتییەوە نووسراوە: تەواوکەر Aᶜ، لە U بەڵام نەک لە A، {x ∈ U ; x ∉ A}، Aᶜ = {4, 5, 6, 7}.
The complement of A: the whole rectangle except circle A. A: هەموو لاکێشەکە جگە لە بازنەی A.CêIT
Quick checkپشکنینی خێراWith U={1,2,…,7}U=\{1,2,\dots,7\} and B={2,3,4,5}B=\{2,3,4,5\}, what is BcB^{c}?بە U={1,2,…,7}U=\{1,2,\dots,7\} و B={2,3,4,5}B=\{2,3,4,5\}، BcB^{c} چەندە؟

All the operations at a glanceهەموو کارەکانی کۆمەڵە بە یەک نیگا

Watch the shaded region change while the rule under it changes. Every operation is a choice of regions of the same picture.

سەیری ناوچە ڕەنگکراوەکە بکە کاتێک لەگەڵ یاساکەی خوارەوەیدا دەگۆڕێت. هەر تەنها هەڵبژاردنی چەند ناوچەیەکی هەمان وێنەیە.

Animation in five steps on the same Venn diagram (U = {1, …, 7}, A = {1, 2, 3}, B = {2, 3, 4, 5}). 1: both circles shaded, union A ∪ B = {1, 2, 3, 4, 5}. 2: only the overlap shaded, intersection A ∩ B = {2, 3}. 3: only A outside B shaded, difference A − B = {1}. 4: only B outside A shaded, difference B − A = {4, 5}. 5: everything except circle A shaded, complement Aᶜ = {4, 5, 6, 7}. Each step shows the name, the symbol, the rule in words and in set-builder form, and the result.
Animation in five steps on the same Venn diagram (U = {1, …, 7}, A = {1, 2, 3}, B = {2, 3, 4, 5}). 1: both circles shaded, union A ∪ B = {1, 2, 3, 4, 5}. 2: only the overlap shaded, intersection A ∩ B = {2, 3}. 3: only A outside B shaded, difference A − B = {1}. 4: only B outside A shaded, difference B − A = {4, 5}. 5: everything except circle A shaded, complement Aᶜ = {4, 5, 6, 7}. Each step shows the name, the symbol, the rule in words and in set-builder form, and the result.
Union, intersection, the two differences and the complement on one picture.، ، دوو و لەسەر یەک وێنە.CêIT
U={1,…,7}U=\{1,\dots,7\}, A={1,2,3}A=\{1,2,3\}, B={2,3,4,5}B=\{2,3,4,5\}U={1,…,7}U=\{1,\dots,7\}، A={1,2,3}A=\{1,2,3\}، B={2,3,4,5}B=\{2,3,4,5\}
OperationSymbolهێماx belongs to it when …x تێیدایە کاتێک …Our exampleنموونەکەمان
UnionA∪BA\cup Bx∈Ax\in A or x∈Bx\in B (or both)x∈Ax\in A یان x∈Bx\in B (یان هەردووکیان){1,2,3,4,5}\{1,2,3,4,5\}
IntersectionA∩BA\cap Bx∈Ax\in A and x∈Bx\in Bx∈Ax\in A و x∈Bx\in B{2,3}\{2,3\}
DifferenceA−BA-Bx∈Ax\in A and x∉Bx\notin Bx∈Ax\in A و x∉Bx\notin B{1}\{1\}
DifferenceB−AB-Ax∈Bx\in B and x∉Ax\notin Ax∈Bx\in B و x∉Ax\notin A{4,5}\{4,5\}
ComplementAcA^{c}x∈Ux\in U and x∉Ax\notin Ax∈Ux\in U و x∉Ax\notin A{4,5,6,7}\{4,5,6,7\}
Quick checkپشکنینی خێراWhich operation gives a set that is always inside both A and B?کام دەدات کە هەمیشە لە ناو هەردوو A و Bـدایە؟

A worked exampleنموونەیەکی شیکراوە

Let U={1,2,…,10}U=\{1,2,\dots,10\}, let E be the even numbers in U and T the multiples of 3 in U. Work out every operation.

با U={1,2,…,10}U=\{1,2,\dots,10\} بێت، E ژمارە جووتەکانی U بێت و T ئەو ژمارانەی U بێت کە دابەشی 3 دەبن. هەموو ئەنجام بدە.

  1. Write the sets in roster formکۆمەڵەکان بە شێوەی لیستکردنی کۆمەڵە بنووسە

    First list the elements, so that every later step is just looking.

    سەرەتا بنووسە، بۆ ئەوەی هەموو هەنگاوەکانی دواتر تەنها سەیرکردن بن.

    E={2,4,6,8,10},T={3,6,9}E=\{2,4,6,8,10\},\qquad T=\{3,6,9\}
  2. Union and intersectionیەکگرتن و یەکتربڕین

    Put everything together for the union; keep only what is shared for the intersection.

    بۆ هەموو شتێک کۆ بکەرەوە؛ بۆ تەنها هاوبەشەکان بهێڵەوە.

    E∪T={2,3,4,6,8,9,10}E∩T={6}\begin{aligned}E\cup T&=\{2,3,4,6,8,9,10\}\\E\cap T&=\{6\}\end{aligned}
  3. The two differencesدوو جیاوازیی کۆمەڵەکە

    Remove the shared element 6 from each set.

    هاوبەشەکەی 6 لە هەر لابە.

    E−T={2,4,8,10}T−E={3,9}\begin{aligned}E-T&=\{2,4,8,10\}\\T-E&=\{3,9\}\end{aligned}
  4. Complementsتەواوکەرەکان

    Take everything in U that is missing from the set.

    هەموو ئەوەی لە Uـدایە و لە نییە وەربگرە.

    Ec={1,3,5,7,9}(E∪T)c={1,5,7}\begin{aligned}E^{c}&=\{1,3,5,7,9\}\\(E\cup T)^{c}&=\{1,5,7\}\end{aligned}

    (E∪T)c(E\cup T)^{c} is the set of numbers that are neither even nor a multiple of 3.

    (E∪T)c(E\cup T)^{c} ئەو ژمارانەن کە نە جووتن نە دابەشی 3 دەبن.

Quick checkپشکنینی خێراIn this example, what is E∩TcE\cap T^{c}?لەم نموونەیەدا، E∩TcE\cap T^{c} چەندە؟

Set operations in computingکارەکانی کۆمەڵە لە کۆمپیوتەردا

Three of these operations appear wherever a computer searches or compares data. The complement is missing: to list “everything that is not in A”, a computer would first need the universal set U.

سێ لەم لە هەر شوێنێکدا دەردەکەون کە کۆمپیوتەر بەدوای دەگەڕێت یان بەراوردی دەکات. لێرەدا نییە: بۆ ڕیزکردنی «هەموو ئەوەی لە Aـدا نییە»، کۆمپیوتەر سەرەتا پێویستی بە ⁦(U)⁩ دەبوو.

IdeaبیرۆکەMathsبیرکاریSQLPython
in A or in Bلە A یان لە BA∪BA\cup BUNIONa | b
in A and in Bلە A و لە BA∩BA\cap BINTERSECTa & b
in A but not in Bلە A بەڵام نەک لە BA−BA-BEXCEPTa - b
Quick checkپشکنینی خێراIn Python, {1, 2, 3} - {2, 3, 4, 5} gives …لە Pythonـدا {1, 2, 3} - {2, 3, 4, 5} چی دەدات؟

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

MistakeهەڵەWhy it is wrongبۆچی هەڵەیەDo this insteadلە جیاتی ئەوە
Mixing up ∪\cup and ∩\capتێکەڵکردنی ∪\cup و ∩\cap∪\cup is “or” (more elements), ∩\cap is “and” (fewer elements)∪\cup واتە «یان» ( زیاتر)، ∩\cap واتە «و» ( کەمتر)Think of ∪\cup as an open cup that collects everything, and of ∩\cap as a narrow cap that keeps only what is shared∪\cup وەک پەرداخێکی کراوە بزانە کە هەموو شتێک کۆ دەکاتەوە، ∩\cap وەک سەرپۆشێکی تەسک کە تەنها هاوبەشەکان دەهێڵێتەوە
Writing shared elements twice: {1,2,2,3,3,4,5}\{1,2,2,3,3,4,5\}نووسینی دوو جار: {1,2,2,3,3,4,5}\{1,2,2,3,3,4,5\}A set has no repeats دووبارەی تێدا نییەA∪B={1,2,3,4,5}A\cup B=\{1,2,3,4,5\}A∪B={1,2,3,4,5}A\cup B=\{1,2,3,4,5\}
Thinking A−B=B−AA-B=B-Aبیرکردنەوە لەوەی A−B=B−AA-B=B-AThe first set is the one you keep from یەکەم ئەوەیە کە لێی دەهێڵیتەوەA−B={1}A-B=\{1\} but B−A={4,5}B-A=\{4,5\}A−B={1}A-B=\{1\} بەڵام B−A={4,5}B-A=\{4,5\}
A complement without saying what U is بەبێ دیاریکردنی UAcA^{c} depends on UAcA^{c} پشت بە U دەبەستێتAlways write U firstهەمیشە سەرەتا U بنووسە
Calling two different sets “disjoint”پێوتنی «جیاکراوە» بە هەر دوو جیاوازDisjoint means no shared elementجیاکراوە واتە هیچ هاوبەش نییەCheck A∩B=∅A\cap B=\emptysetA∩B=∅A\cap B=\emptyset بپشکنە
Forgetting elements that are in A but not in B when finding BcB^{c}لەبیرچوونی ئەو لە Aـدان و لە Bـدا نین کاتێک BcB^{c} دەدۆزیتەوەBcB^{c} is everything outside B, inside A or notBcB^{c} هەموو شتێکە لە دەرەوەی B، لە ناو A بێت یان ناGo through U element by element U یەک یەک بپشکنە

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

ExerciseڕاهێنانAll the operationsهەموو کارەکانی کۆمەڵە

Let U={1,2,…,8}U=\{1,2,\dots,8\}, C={1,2,3,4}C=\{1,2,3,4\} and D={3,4,5,6}D=\{3,4,5,6\}. Find C∪DC\cup D, C∩DC\cap D, C−DC-D, D−CD-C, CcC^{c}, (C∪D)c(C\cup D)^{c} and Cc∩DcC^{c}\cap D^{c}. What do you notice about the last two?

با U={1,2,…,8}U=\{1,2,\dots,8\}، C={1,2,3,4}C=\{1,2,3,4\} و D={3,4,5,6}D=\{3,4,5,6\} بن. C∪DC\cup D، C∩DC\cap D، C−DC-D، D−CD-C، CcC^{c}، (C∪D)c(C\cup D)^{c} و Cc∩DcC^{c}\cap D^{c} بدۆزەرەوە. سەبارەت بە دوو دانەی کۆتایی چی دەبینیت؟

Show answerوەڵامەکە پیشان بدە
C∪D={1,2,3,4,5,6},C∩D={3,4},C−D={1,2},D−C={5,6},Cc={5,6,7,8},(C∪D)c={7,8},Cc∩Dc={5,6,7,8}∩{1,2,7,8}={7,8}\begin{aligned}C\cup D&=\{1,2,3,4,5,6\}, & C\cap D&=\{3,4\},\\ C-D&=\{1,2\}, & D-C&=\{5,6\},\\ C^{c}&=\{5,6,7,8\}, & (C\cup D)^{c}&=\{7,8\},\\ C^{c}\cap D^{c}&=\{5,6,7,8\}\cap\{1,2,7,8\}=\{7,8\}\end{aligned}

The last two are equal: “not in (C or D)” is the same as “not in C and not in D”. This rule, (C∪D)c=Cc∩Dc(C\cup D)^{c}=C^{c}\cap D^{c}, is one of De Morgan's laws; you will meet it again in logic and Boolean algebra.

دوو دانەی کۆتایی یەکسانن: «نە لە (C یان D)» هەمان «نە لە C و نە لە D»ـیە. ئەم یاسایە، (C∪D)c=Cc∩Dc(C\cup D)^{c}=C^{c}\cap D^{c}، یەکێکە لە ؛ لە لۆجیک و دووبارە دەیبینیتەوە.

ExerciseڕاهێنانDisjoint or not?جیاکراوەن یان نا؟

X={1,4,9}X=\{1,4,9\}, Y={2,3,5}Y=\{2,3,5\} and Z={4,8}Z=\{4,8\}. Which pairs are disjoint?

X={1,4,9}X=\{1,4,9\}، Y={2,3,5}Y=\{2,3,5\} و Z={4,8}Z=\{4,8\}. کام جووتانە جیاکراوەن؟

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

X∩Y=∅X\cap Y=\emptyset and Y∩Z=∅Y\cap Z=\emptyset, so X, Y and Y, Z are disjoint. X∩Z={4}X\cap Z=\{4\}, so X and Z are not.

X∩Y=∅X\cap Y=\emptyset و Y∩Z=∅Y\cap Z=\emptyset، بۆیە X و Y، هەروەها Y و Z جیاکراوەن. X∩Z={4}X\cap Z=\{4\}، بۆیە X و Z جیاکراوە نین.

ExerciseڕاهێنانClubs in a classیانەکانی پۆلێک

A class has 40 students. 25 are in the Python club, 18 are in the football team and 9 are in both. How many are in at least one of them? How many are in neither? How many are only in the Python club, and how many only in the team?

پۆلێک ⁦40⁩ قوتابیی هەیە. ⁦25⁩ لە یانەی Pythonـدان، ⁦18⁩ لە تیمی تۆپی پێدان و 9 لە هەردووکیاندان. چەند قوتابی لانیکەم لە یەکێکیاندان؟ چەند لە هیچیاندا نین؟ چەند تەنها لە یانەی Pythonـدان و چەند تەنها لە تیمەکەدان؟

Hintئاماژە

Start with the overlap, then fill the other regions.

لە بەشە هاوبەشەکەوە دەست پێبکە، پاشان ناوچەکانی تر پڕ بکەرەوە.

Show answerوەڵامەکە پیشان بدە
n(P∪F)=25+18−9=34neither=40−34=6only P=25−9=16,only F=18−9=9\begin{aligned}n(P\cup F)&=25+18-9=34\\ \text{neither}&=40-34=6\\ \text{only }P&=25-9=16,\qquad \text{only }F=18-9=9\end{aligned}

Draw the Venn diagram: 9 in the overlap, 16 in P only, 9 in F only, 6 outside. Check: 9+16+9+6=409+16+9+6=40.

بکێشە: 9 لە بەشە هاوبەشەکە، ⁦16⁩ تەنها لە P، 9 تەنها لە F و 6 لە دەرەوە. پشکنین: 9+16+9+6=409+16+9+6=40.

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

With A={1,2,3}A=\{1,2,3\} and B={2,3,4,5}B=\{2,3,4,5\} a student wrote: “A∪B={1,2,2,3,3,4,5}A\cup B=\{1,2,2,3,3,4,5\}” and “A−B=B−A={1,4,5}A-B=B-A=\{1,4,5\}”. Correct both lines.

بە A={1,2,3}A=\{1,2,3\} و B={2,3,4,5}B=\{2,3,4,5\} خوێندکارێک نووسیویەتی: «A∪B={1,2,2,3,3,4,5}A\cup B=\{1,2,2,3,3,4,5\}» و «A−B=B−A={1,4,5}A-B=B-A=\{1,4,5\}». هەردوو دێڕەکە ڕاست بکەرەوە.

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

Line 1: a set lists each element once, so A∪B={1,2,3,4,5}A\cup B=\{1,2,3,4,5\}. Line 2: A−B={1}A-B=\{1\} and B−A={4,5}B-A=\{4,5\} are different sets. The set {1,4,5}\{1,4,5\} is “in exactly one of the two sets”, which is (A−B)∪(B−A)(A-B)\cup(B-A) (called the symmetric difference; Python writes it a ^ b).

دێڕی یەکەم: هەر تەنها یەک جار دەنووسێت، بۆیە A∪B={1,2,3,4,5}A\cup B=\{1,2,3,4,5\}. دێڕی دووەم: A−B={1}A-B=\{1\} و B−A={4,5}B-A=\{4,5\} دوو جیاوازن. {1,4,5}\{1,4,5\} واتە «تەنها لە یەکێک لە دوو »، کە دەکاتە (A−B)∪(B−A)(A-B)\cup(B-A) (پێی دەوترێت symmetric difference؛ Python بە a ^ b دەینووسێت).

Summary and reviewپوختە و پێداچوونەوە

  • Fix the universal set U first. A Venn diagram draws U as a rectangle and each set as a circle.
  • Union A∪BA\cup B: in A or in B (or both). Intersection A∩BA\cap B: in A and in B.
  • A and B are disjoint when A∩B=∅A\cap B=\emptyset.
  • Difference A−BA-B: in A but not in B; the order matters. Complement Ac=U−AA^{c}=U-A: everything in U outside A.
  • A−B=A∩BcA-B=A\cap B^{c} and n(A∪B)=n(A)+n(B)−n(A∩B)n(A\cup B)=n(A)+n(B)-n(A\cap B).
  • سەرەتا ⁦(U)⁩ دیاری بکە. U وەک لاکێشە و هەر وەک بازنە دەکێشێت.
  • A∪BA\cup B: لە A یان لە B (یان هەردووکیان). A∩BA\cap B: لە A و لە B.
  • A و B جیاکراوەن کاتێک A∩B=∅A\cap B=\emptyset.
  • A−BA-B: لە A بەڵام نەک لە B؛ ڕیزبەندی گرنگە. Ac=U−AA^{c}=U-A: هەموو ئەوەی لە Uـدایە و لە دەرەوەی Aـیە.
  • A−B=A∩BcA-B=A\cap B^{c} و n(A∪B)=n(A)+n(B)−n(A∩B)n(A\cup B)=n(A)+n(B)-n(A\cap B).
Review questionsپرسیارەکانی پێداچوونەوە
Why does the complement need a universal set?بۆچی تەواوکەر پێویستی بە کۆمەڵەی گشتی هەیە؟

Because “everything not in A” must mean “everything in U not in A”; without U we do not know what “everything” is.

چونکە «هەموو ئەوەی لە Aـدا نییە» دەبێت واتای «هەموو ئەوەی لە Uـدایە و لە Aـدا نییە» بێت؛ بەبێ U نازانین «هەموو» چییە.

Is the mathematical “or” in the union exclusive?ئایا «یان»ـی بیرکاری لە یەکگرتندا یەکێکیان بە تەنهایە؟

No. “x∈Ax\in A or x∈Bx\in B” is also true when x is in both.

نەخێر. «x∈Ax\in A یان x∈Bx\in B» ڕاستە تەنانەت کاتێک x لە هەردووکیاندایە.

How do you find A−BA-B quickly?چۆن بە خێرایی A−BA-B دەدۆزیتەوە؟

Write A, then cross out every element that also appears in B.

A بنووسە، پاشان هەموو ئەو بسڕەوە کە لە Bـیشدا هەن.

What do disjoint sets look like in a Venn diagram?کۆمەڵە جیاکراوەکان لە هێڵکاریی ڤێندا چۆن دەردەکەون؟

Two circles that do not overlap.

دوو بازنە کە بەسەر یەکدا ناکەون.

Videoڤیدیۆ

Watch a videoسەیری ڤیدیۆیەک بکە

A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.

Sets: Union, Intersection, ComplementSteve Crow · Englishئینگلیزی · 1.3M viewsبینین · 25K likesلایک

How to find the union, intersection and complement of sets step by step, from easy examples to combined operations.

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

Chapters: 0:00 set operations, 2:01 complement and union, 5:58 combined operations, 11:24 a harder example.

بەشەکان: ⁦0:00⁩ ، ⁦2:01⁩ و ، ⁦5:58⁩ چەند پێکەوە، ⁦11:24⁩ نموونەیەکی قورستر.

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

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

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

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

Sets of Numbers: From Natural to Complexکۆمەڵەکانی ژمارە: لە ژمارە سروشتییەکانەوە تا ژمارە ئاوێتەکان

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

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