跳到正文
The Lumenary

The Lumenary

练习

带提示和讲解的练习。想试多少次都可以——没有分数、计时或连续打卡。

一组对象

热身人类思维

这里有一组对象:🍎 🍌 🍐。下面哪一个是这一组的成员?

选择一项

一组对象

热身人类思维

这一组有几个成员?🍊 🥕 🍋 🍎 🍐

一组对象

核心人类思维

健二的盒子里有 🍎 🍌 🍐。露西娅的盒子里有 🍐 🍎 🍌。它们是同一组吗?

选择一项

一组对象

核心人类思维

装蓝色水果的盒子是空的。空组有几个成员?

一组对象

核心形式化

Gideon 的游戏:这一组是 🍌 🍋 🥒。下面的说法是真还是假?“这一组的每个成员都是黄色的。”

选择一项

一组对象

挑战人类思维

给大一点的孩子:从苹果(apple)、香蕉(banana)、草莓(strawberry)和柠檬(lemon)中,写出由红色东西组成的一组。请使用代码中显示的英文单词,用逗号分隔,例如 {kiwi, plum}。

用逗号分隔各个元素。顺序和重复都无关紧要——就像集合一样!

Sets

热身人类思维

Let A={1,2,3,4}A = \{1, 2, 3, 4\} and B={3,4,5,6}B = \{3, 4, 5, 6\}. Write A∪BA \cup B.

用逗号分隔各个元素。顺序和重复都无关紧要——就像集合一样!

Sets

热身人类思维

With the same A={1,2,3,4}A = \{1, 2, 3, 4\} and B={3,4,5,6}B = \{3, 4, 5, 6\}, write A∩BA \cap B.

用逗号分隔各个元素。顺序和重复都无关紧要——就像集合一样!

Sets

核心人类思维

In the universe U={1,2,3,4,5,6,7,8}U = \{1, 2, 3, 4, 5, 6, 7, 8\}, write the complement AcA^{c} of A={1,2,3,4}A = \{1, 2, 3, 4\}.

用逗号分隔各个元素。顺序和重复都无关紧要——就像集合一样!

Sets

核心形式化

Which statements are true? (Choose all that apply.)

选择所有符合的选项

Sets

核心人类思维

What is the cardinality ∣{a,b,a,c,b}∣|\{a, b, a, c, b\}|?

Sets

核心人类思维

A café offers 3 drinks and 4 snacks. A combo is an ordered pair (drink, snack). If DD is the set of drinks and SS the set of snacks, how many elements does D×SD \times S have?

Sets

挑战人类思维

In a class, 14 students play football, 9 play chess, and 5 play both. How many play at least one of the two games?

Sets

挑战计算

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.

完全在你的浏览器中、在一个隔离的工作线程里运行。不会向服务器发送任何内容。

Integers

热身人类思维

Compute −8+5-8 + 5.

Integers

热身人类思维

Compute −4−(−9)-4 - (-9).

Integers

核心人类思维

Compute (−3)⋅(−4)⋅(−1)(-3) \cdot (-4) \cdot (-1).

Integers

核心人类思维

Compute (−6)+(−7)(-6) + (-7).

Integers

核心人类思维

In the proof that (−a)(−b)=ab(-a)(-b) = ab, we wrote (−a)(−b)+(−a)b=(−a)((−b)+b)(-a)(-b) + (-a)b = (-a)\big((-b) + b\big). Which property justifies this step?

选择一项

Integers

热身人类思维

At dawn in Ulaanbaatar the temperature is −23 ∘C-23\,^\circ\mathrm{C}. By noon it has risen by 1515 degrees. What is the noon temperature, in ∘C^\circ\mathrm{C}?

Integers

挑战计算

Write find_mult_partner(a, limit) that searches the integers bb with −limit≤b≤limit-\text{limit} \le b \le \text{limit} and returns the first bb with a * b == 1, or None if there is none. Then think: why does searching further never help when ∣a∣≥2|a| \ge 2?

完全在你的浏览器中、在一个隔离的工作线程里运行。不会向服务器发送任何内容。

Functions

热身人类思维

Let A={1,2,3}A = \{1, 2, 3\} and B={a,b}B = \{a, b\}. Which of these rules is a function from AA to BB?

选择一项

Functions

核心人类思维

How many functions are there from a set with 33 elements to a set with 22 elements?

Functions

核心人类思维

How many injective functions are there from a 2-element set to a 4-element set?

Functions

核心人类思维

Which of these functions Z→Z\Z \to \Z are surjective? (Choose all that apply.)

选择所有符合的选项

Functions

挑战人类思维

A school has 400 students. Why must at least two of them share a birthday (day and month)?

选择一项

Functions

挑战计算

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.

完全在你的浏览器中、在一个隔离的工作线程里运行。不会向服务器发送任何内容。

Composition

热身人类思维

Let f(x)=x+3f(x) = x + 3 and g(x)=x2g(x) = x^2. Compute (g∘f)(2)(g \circ f)(2).

Composition

热身人类思维

If f:A→Bf : A \to B and g:B→Cg : B \to C, what are the domain and codomain of g∘fg \circ f?

选择一项

Composition

核心人类思维

Let f(x)=3xf(x) = 3x and g(x)=x−2g(x) = x - 2. Compute (g∘f)(4)−(f∘g)(4)(g \circ f)(4) - (f \circ g)(4).

Composition

挑战人类思维

Suppose g∘fg \circ f is injective. Which of these must be true? (Choose all that apply.)

选择所有符合的选项

Composition

核心形式化

In Lean, comp_assoc is proved by rfl. What does that tell us?

选择一项

Composition

挑战计算

Finite functions can be stored as dictionaries. Write compose(g, f) returning a dictionary for g∘fg \circ f (apply f first!). You may assume every value of f is a key of g.

完全在你的浏览器中、在一个隔离的工作线程里运行。不会向服务器发送任何内容。