التجمّعات
إحماءبشريهذا تجمّع: 🍎 🍌 🍐. أيّ هذه الأشياء عضو في هذا التجمّع؟
The Lumenary
تمارين مع تلميحات وشروح. حاول بقدر ما تشاء — لا درجات ولا مؤقّتات ولا عدّادات للأيام المتتالية.
هذا تجمّع: 🍎 🍌 🍐. أيّ هذه الأشياء عضو في هذا التجمّع؟
كم عضوًا في هذا التجمّع؟ 🍊 🥕 🍋 🍎 🍐
في صندوق كينجي 🍎 🍌 🍐. وفي صندوق لوسيا 🍐 🍎 🍌. هل هما التجمّع نفسه؟
صندوق الفاكهة الزرقاء فارغ. كم عضوًا في التجمّع الخالي؟
لعبة Gideon: التجمّع هو 🍌 🍋 🥒. هل هذه العبارة صحيحة أم خاطئة؟ «كل عضو في هذا التجمّع أصفر.»
للأطفال الأكبر سنًّا: من بين التفاحة (apple) والموزة (banana) والفراولة (strawberry) والليمونة (lemon)، اكتب تجمّع الأشياء الحمراء. استخدم الكلمات الإنجليزية الظاهرة في الشيفرة، مفصولة بفواصل، مثل {kiwi, plum}.
Let and . Write .
With the same and , write .
In the universe , write the complement of .
Which statements are true? (Choose all that apply.)
What is the cardinality ?
A café offers 3 drinks and 4 snacks. A combo is an ordered pair (drink, snack). If is the set of drinks and the set of snacks, how many elements does have?
In a class, 14 students play football, 9 play chess, and 5 play both. How many play at least one of the two games?
Write a Python function is_subset(a, b) that returns True exactly when every element of the set a is an element of the set b. Don't use Python's built-in <= or issubset — loop over the elements instead.
Compute .
Compute .
Compute .
Compute .
In the proof that , we wrote . Which property justifies this step?
For which integers is there an integer with ? (Choose all that apply.)
At dawn in Ulaanbaatar the temperature is . By noon it has risen by degrees. What is the noon temperature, in ?
Write find_mult_partner(a, limit) that searches the integers with and returns the first with a * b == 1, or None if there is none. Then think: why does searching further never help when ?
Let and . Which of these rules is a function from to ?
How many functions are there from a set with elements to a set with elements?
How many injective functions are there from a 2-element set to a 4-element set?
Which of these functions are surjective? (Choose all that apply.)
A school has 400 students. Why must at least two of them share a birthday (day and month)?
A finite function can be stored as a Python dictionary, e.g. {1: 'a', 2: 'b', 3: 'a'}. Write is_injective(f) returning True exactly when no two keys have the same value.
Let and . Compute .
If and , what are the domain and codomain of ?
Let and . Compute .
Suppose is injective. Which of these must be true? (Choose all that apply.)
In Lean, comp_assoc is proved by rfl. What does that tell us?
Finite functions can be stored as dictionaries. Write compose(g, f) returning a dictionary for (apply f first!). You may assume every value of f is a key of g.