一组对象
热身人类思维这里有一组对象:🍎 🍌 🍐。下面哪一个是这一组的成员?
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.