Mikusanyiko
Kupasha motoKibinadamuHuu hapa ni mkusanyiko: 🍎 🍌 🍐. Ni kipi kati ya hivi ambacho ni mwanachama wa mkusanyiko huu?
The Lumenary
Mazoezi yenye vidokezo na maelezo. Jaribu mara nyingi kadiri unavyotaka — hakuna alama, vipima muda wala mfululizo wa siku.
Huu hapa ni mkusanyiko: 🍎 🍌 🍐. Ni kipi kati ya hivi ambacho ni mwanachama wa mkusanyiko huu?
Mkusanyiko huu una wanachama wangapi? 🍊 🥕 🍋 🍎 🍐
Sanduku la Kenji lina 🍎 🍌 🍐. Sanduku la Lucía lina 🍐 🍎 🍌. Je, ni mkusanyiko uleule?
Sanduku la matunda ya buluu ni tupu. Mkusanyiko mtupu una wanachama wangapi?
Mchezo wa Gideon: mkusanyiko ni 🍌 🍋 🥒. Je, kauli hii ni kweli au si kweli? "Kila mwanachama wa mkusanyiko huu ni wa njano."
Kwa watoto wakubwa zaidi: kutoka kwa tufaha (apple), ndizi (banana), stroberi (strawberry) na limau (lemon), andika mkusanyiko wa vitu vyekundu. Tumia maneno ya Kiingereza yanayoonyeshwa kama msimbo, yakitenganishwa kwa koma, kama {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.