逻辑表达式简化与类型判断Logic simplification & classification
真值表分析与逻辑等价Truth tables & logical equivalence
组合数学综合应用Combinatorics applications
高级计数问题与递推关系Advanced counting & recurrences
这是你填写真值表时需要刻在脑子里的四条规则:
一假则假
只要有一个 F,结果就是 F
一真则真
只要有一个 T,结果就是 T
真变假,假变真
简单的取反操作
真推假,才是假
只有 T → F 是 F,其他都是 T
特征:永真式
无论 p, q 是什么,结果永远是 T
记忆:必然真理
例:$p ∨ ¬p ≡ T$
特征:永假式
无论 p, q 是什么,结果永远是 F
记忆:必然矛盾
例:$p ∧ ¬p ≡ F$
特征:不确定
结果有真有假,取决于 p, q 的取值
记忆:看情况
例:$p ∧ q$
🎯 不要依赖真值表!用下面的公式化步骤,更快更准。
$A → B ≡ ¬A ∨ B$
用于消灭 → 符号
$¬(A ∨ B) ≡ ¬A ∧ ¬B$
$¬(A ∧ B) ≡ ¬A ∨ ¬B$
用于处理括号外的 ¬ 符号
$¬(¬A) ≡ A$
负负得正
$A ∨ ¬A ≡ T$ (排中律)
$A ∧ ¬A ≡ F$ (矛盾律)
判断重言式和矛盾式的最后一步
幂等律: $A ∨ A ≡ A$;$A ∧ A ≡ A$
支配律: $A ∨ T ≡ T$;$A ∧ F ≡ F$
目标:简化这个表达式
结论:最终结果是 F,所以它是矛盾式 (Contradiction)。
结论:最终结果是 $p ∧ q$,它不是 T 也不是 F,它的真假"看情况",所以它是偶发式 (Contingency)。
Always true. Every input yields T.
Think “guaranteed truth”.
Example: $p \lor \neg p$.
Always false. Every input yields F.
Think “built-in conflict”.
Example: $p \land \neg p$.
Sometimes true, sometimes false.
Think “depends on inputs”.
Example: $p \land q$.
🎯 Avoid brute-force truth tables—rewrite and then classify.
$A \rightarrow B \equiv \neg A \lor B$
First move whenever an arrow appears.
$\neg(A \lor B) \equiv \neg A \land \neg B$
$\neg(A \land B) \equiv \neg A \lor \neg B$
Use to push negation inside brackets.
$\neg(\neg A) \equiv A$
$A \lor \neg A \equiv T$
$A \land \neg A \equiv F$
Final check for tautology vs contradiction.
Idempotent: $A \lor A \equiv A$, $A \land A \equiv A$
Dominance: $A \lor T \equiv T$, $A \land F \equiv F$
Conclusion: final result is F → contradiction.
Conclusion: result is $p \land q$, so the overall proposition is a contingency.
| p | q | r |
|---|---|---|
| T | F | T |
| F | T | F |
| T | T | T |
| F | F | F |
1. 计算 p → q 的真值列:
所以 p → q 的真值列是:F, T, T, T
2. 比较各命题的真值列:
发现:¬r 的真值列与 p → q 的真值列不完全一样,但可能存在其他等价关系。
Negation 与 Converse (逆命题) 和 Contrapositive (逆否命题) 是三种完全不同的逻辑操作。
核心概念:严格区分三种逻辑操作
| 操作类型 | 目标 | 变形规则 |
|---|---|---|
| 1. 求逆命题 (Converse) | $A → B ⇒ B → A$ |
1. 前后对调 得到 $B → A$ 2. 再用蕴含等价式 $¬B ∨ A$ 消灭箭头 |
| 2. 求逆否命题 (Contrapositive) | $A → B ⇒ ¬B → ¬A$ |
1. 换位再取反 得到 $¬B → ¬A$ 2. 再用蕴含等价式 $¬(¬B) ∨ ¬A = B ∨ ¬A$ 消灭箭头 |
| 3. 求否定 (Negation) | $A → B ⇒ A ∧ ¬B$ |
方法一 (三连招): 1. $¬(A→B)$ 2. $¬(¬A∨B)$ 3. $A∧¬B$ 方法二 (记口诀): "箭头变'与',后面取反" |
对于一个蕴含式 $A → B$,求它的否定 $¬(A → B)$ 有一套固定的"三连招"公式。
第一招:蕴含等价式 (消灭箭头)
$¬(A → B) ≡ ¬(¬A ∨ B)$
第二招:德摩根定律
$¬(¬A ∨ B) ≡ ¬(¬A) ∧ ¬B$
第三招:双重否定律
$¬(¬A) ∧ ¬B ≡ A ∧ ¬B$
结论:$A → B$ 的否定,就是 $A ∧ ¬B$
口诀可以记为:"箭头变'与',后面取反"
首先,我们需要根据真值表确定 Part (a) 的完整陈述。我们来看一下真值表 (p, q, r) 为真的情况:
(T, T, T), (T, F, F), (F, T, T), (F, F, T)
我们来检验一下 r 和 p → q 的关系:
太棒了!Part(a) 的陈述就是 r ↔ (p → q)。所以,它的右侧命题是 p → q。
我们直接套用刚刚总结的公式 $¬(A → B) ≡ A ∧ ¬B$。
在这里, A 是 p, B 是 q。
所以,$¬(p → q)$ 的等价式是:$p ∧ ¬q$
Numbas 答案: 在下拉菜单中选择 p, ∧, ¬q
💡 学习流程总结:
| p | q | r |
|---|---|---|
| T | F | T |
| F | T | F |
| T | T | T |
| F | F | F |
1. Truth column for $p \rightarrow q$.
So the column is F, T, T, T.
2. Compare with the given propositions.
Outcome: $r$ and $p \rightarrow q$ agree exactly on all rows when wrapped in a biconditional, so Part (a) is $r \leftrightarrow (p \rightarrow q)$.
Converse and contrapositive rearrange the statement; negation finds when the original is false.
Goal: keep the three operations straight.
| Operation | Target form | Transformation steps |
|---|---|---|
| 1. Converse | $A \rightarrow B \Rightarrow B \rightarrow A$ |
1. Swap premise/conclusion → $B \rightarrow A$ 2. Remove the arrow using $\neg B \lor A$ |
| 2. Contrapositive | $A \rightarrow B \Rightarrow \neg B \rightarrow \neg A$ |
1. Swap and negate → $\neg B \rightarrow \neg A$ 2. Remove the arrow: $\neg(\neg B) \lor \neg A = B \lor \neg A$ |
| 3. Negation | $A \rightarrow B \Rightarrow A \land \neg B$ |
Method 1 (three moves): 1. $\neg(A \rightarrow B)$ 2. $\neg(\neg A \lor B)$ 3. $A \land \neg B$ Method 2 (mnemonic): “arrow becomes AND, negate the back half” |
To negate $A \rightarrow B$, always run the same trio of identities.
1. Implication equivalence.
$\neg(A \rightarrow B) \equiv \neg(\neg A \lor B)$
2. De Morgan.
$\neg(\neg A \lor B) \equiv \neg(\neg A) \land \neg B$
3. Double negation.
$\neg(\neg A) \land \neg B \equiv A \land \neg B$
Conclusion: $\neg(A \rightarrow B) = A \land \neg B$.
Mnemonic: “arrow to AND, negate the tail”.
Check the rows where $(p,q,r)$ is true:
(T, T, T), (T, F, F), (F, T, T), (F, F, T)
Evaluate $r$ versus $p \rightarrow q$:
Therefore Part (a) is $r \leftrightarrow (p \rightarrow q)$, so the “right-hand statement” we negate is $p \rightarrow q$.
Apply the combo above: $\neg(p \rightarrow q) = p \land \neg q$.
Numbas input: select $p$, $\land$, and $\neg q$ from the menus.
💡 Study summary
$C(n, k)$ 或 $\binom{n}{k}$
定义:从 n 个不同元素中选出 k 个元素,不考虑顺序
公式:$C(n,k) = \frac{n!}{k!(n-k)!}$
口诀:"只选不排"
适用:挑选小组成员、抽奖、选水果
$P(n, k)$ 或 $A_n^k$
定义:从 n 个不同元素中选出 k 个元素并进行排列
公式:$P(n,k) = \frac{n!}{(n-k)!}$
口诀:"选了要排"
适用:排队、分配职务、数字密码
$n! = n × (n-1) × (n-2) × \ldots × 2 × 1$
特殊值:$0! = 1$,$1! = 1$
全排列:$P(n,n) = n!$
思路分解:这是分两步进行的事件,每一步都是独立的,所以用乘法原理。
第一步:从 19 人中选出 8 人入选
第二步:从这 8 名入选者中,有 6 人获得命名角色
答案:$C(19, 8) × P(8, 6)$
记忆点:
思路分解:交替排列意味着两种基本模式:
计算步骤:
答案:$4! × 4! × 2$
= 24 × 24 × 2 = 1152
记忆点:"交替排列" → 考虑开头(男女两种),然后各自内部排列
思路分解:
这意味着我们必须使用这 5 个奇数,并且把它们全部排列起来组成 5 位数。这实际上是 5 个不同元素的全排列。
计算:
答案:$5 × 4 × 3 × 2 × 1 = 5! = 120$
记忆点:"所有数字不同,且所有数字都是奇数,组成一个由这些奇数组成的 5 位数" → 就是这些奇数的全排列
问题分析:为什么"男女交替"的笔记不适用?
所以,我们需要为这个新题型建立一个全新的"速成笔记"。
口诀:"先捆绑,再排外,后排内"
根据乘法原理,总的排列方法数就是"排外"的方法数乘以"排内"的方法数。
总方法数 = 9! × 2!
根据系统偏好,使用 perm(n, k) 函数来表示阶乘 n! (perm(n, n))。
| 题型 | 核心方法 | 口诀 | 公式化步骤 |
|---|---|---|---|
| 元素相邻问题 (如: 2人相邻, 3人相邻) |
捆绑法 (Bundling) | 先捆绑,再排外,后排内 |
1. 捆绑: 将 k 个必须相邻的元素视为 1 个大单位。 2. 排外: 计算 (总人数 - k + 1) 个单位的全排列,即 (n - k + 1)!。 3. 排内: 计算被捆绑的 k 个元素内部的全排列,即 k!。 4. 相乘: 最终答案 = (n - k + 1)! * k! |
| 男女交替问题 | 插空法/模式法 | 先排一队,再插另一队 |
1. 内部排: 计算男队内部排列 (男!) 和女队内部排列 (女!)。 2. 模式选: 看有几种开头模式 (男开头或女开头)。 3. 相乘: 答案 = 男! * 女! * 模式数。 |
情境:15名学生申请,选6人组队,其中4人担任特定角色,2人为普通队员
解题思路:
或者用另一种思路:
Choose $k$ items from $n$ with no attention to order.
Formula: $C(n,k)=\frac{n!}{k!(n-k)!}$.
Use for pure selection problems.
Choose and arrange $k$ items; order matters.
Formula: $P(n,k)=\frac{n!}{(n-k)!}$.
Use for ordering, seating, role assignment.
$n!$ counts all permutations of $n$ distinct items; remember $0! = 1$.
Select 8 actors with $C(19,8)$, then order 6 named roles with $P(8,6)$ → multiply the two.
Two start patterns (M/F). Within each pattern, arrange men $4!$ and women $4!$ → answer $2\cdot 4!\cdot 4!$.
Permute the digits {1,3,5,7,9}; total $5! = 120$.
Total $9!\times2$ (expressible as `perm(9,9)*perm(2,2)` for Numbas).
Select 6 from 15, assign 4 special roles: $C(15,6) \times P(6,4)$.
Equivalent approach: choose role-holders directly $P(15,4)$, then choose two additional members $C(11,2)$.
Strategies: use multiplication for sequential steps, addition for disjoint cases, complement or inclusion–exclusion for restrictions.
🎯 核心思路:分两步走,先选出哪几天是全天,再为剩下的半天安排时段。
总日程数 = C(总天数, 全天数) × 2^(半天数)
在 Numbas 中输入: comb(n, k1) * 2^k2
例子:n=7, k1=2, k2=5
计算:comb(7, 2) × 2^5 = 21 × 32 = 672
ceil(员工总数 / 日程总数)
记忆口诀:"人数除以选项数,结果向上取个整"
例子:N=3972, k=672
计算:ceil(3972 ÷ 672) = ceil(5.91...) = 6
最少员工数 = (日程总数) × (目标人数 - 1) + 1
记忆口诀:"选项数乘以(目标数减一),最后再加一"
例子:k=672, m=5
计算:672 × (5 - 1) + 1 = 672 × 4 + 1 = 2689
🎯 Key idea: break it into two phases—pick full-day slots, then assign morning/afternoon for part-days.
Total schedules = $C(\text{days}, \text{full-days}) \times 2^{\text{half-days}}$
Numbas entry: `comb(n, k1) * 2^k2`.
Example. $n=7$, $k_1=2$, $k_2=5$.
Computation. $\text{comb}(7,2) \times 2^5 = 21 \times 32 = 672$.
$\left\lceil \dfrac{\text{employees}}{\text{distinct schedules}} \right\rceil$
Think “people ÷ options, round up”.
Example. $N=3972$, $k=672$.
Computation. $\lceil 3972 / 672 \rceil = \lceil 5.91… \rceil = 6$.
Minimum employees $= \text{(schedule count)} \times (m-1) + 1$
Mnemonic: “options × (target−1), then add one”.
Example. $k=672$, $m=5$.
Computation. $672 \times (5 - 1) + 1 = 672 \times 4 + 1 = 2689$.
🎯 核心思路:将不同的人根据结果分组,遵循"先选人,再管剩下的人"原则。
总方式 = (选第一组人的方式) × (选第二组人的方式) × ... × (剩下的人的方式)
Part a) 8人投10面骰,恰好5人投出8:
Part b) 45人投12面骰,分3组:
🎯 对于"小于某个数"的限制,必须使用分类讨论,从最高位开始分析。
总数 = 各Case之和
🎯 Strategy: partition players by the outcome they show—"pick the special groups first, then handle the rest".
Total ways = choose group 1 × choose group 2 × … × handle leftovers.
Part (a). Eight people roll a 10-sided die; exactly five show 8.
Part (b). Forty-five people roll a 12-sided die; three outcomes are specified.
🎯 Rule: when “less than” appears, split cases by the highest digit.
Total count = sum of all disjoint cases.
⚠️ 重要提醒:在MATH1081的Numbas系统中,xᵢ ∈ ℕ 定义为 xᵢ ≥ 0 (非负整数),而不是 xᵢ ≥ 1。
口诀:"先给足,再平移,剩下随便分"
口诀:"总量减去坏的,再加上多减的"
口诀:"按模改写,代入化简,解新方程"
⚠️ Reminder: in the MATH1081 Numbas system, $x_i \in \mathbb{N}$ means $x_i \ge 0$, not $x_i \ge 1$.
$x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 61$ with each $x_i \ge 1$ unless stated otherwise.
Mantra: “top up first, shift, then distribute freely”.
Mantra: “total minus bad cases, plus the over-subtracted ones”.
Mantra: “rewrite by modulus, plug in, solve the transformed sum”.
口诀:"移项、立特征、解方程、定形态"
| 特征根情况 | 齐次解形态 |
|---|---|
| 两个不等实根 r₁, r₂ | A × r₁ⁿ + B × r₂ⁿ |
| 重复根 r | (A + Bn) × rⁿ |
口诀:"尾巴长啥样,我就猜啥样;一有撞车,立马乘n"
| "小尾巴"F(n)形式 | 初步猜测 |
|---|---|
| 一次多项式 (-36n-12) | Dn + E |
| 指数函数 (-12×3ⁿ) | D × 3ⁿ |
例子1 (无撞车):bₙ = -6bₙ₋₁ - 5bₙ₋₂ - 36n - 12
例子2 (一次撞车):cₙ = -3cₙ₋₁ + 40cₙ₋₂ - 26×5ⁿ
示例:cₙ = (A + Bn - 6n²) × 3ⁿ
通过c₀=2, c₁=-6 可求出 A=2, B=2
最终答案:cₙ = (2 + 2n - 6n²) × 3ⁿ
Mnemonic: “rearrange → characteristic → solve roots → write the shape”.
| Roots | Homogeneous form |
|---|---|
| Distinct reals $r_1, r_2$ | $A r_1^n + B r_2^n$ |
| Repeated root $r$ | $(A + Bn) r^n$ |
Mnemonic: “copy the forcing term’s shape; if it clashes, multiply by $n$”.
| Forcing $F(n)$ | Initial guess |
|---|---|
| Linear polynomial $-36n-12$ | $Dn + E$ |
| Exponential $-12 \cdot 3^n$ | $D \cdot 3^n$ |
Example 1 (no clash). $b_n = -6 b_{n-1} - 5 b_{n-2} - 36n - 12$
Example 2 (one clash). $c_n = -3 c_{n-1} + 40 c_{n-2} - 26\cdot 5^n$
Example. $c_n = (A + Bn - 6n^2) \cdot 3^n$.
Using $c_0 = 2$, $c_1 = -6$ gives $A = 2$, $B = 2$.
Final answer. $c_n = (2 + 2n - 6n^2) \cdot 3^n$.
30道精心设计的题目,全面检验你的掌握程度30 carefully curated questions to check your mastery end-to-end.
30 carefully curated questions to check your mastery end-to-end.30道精心设计的题目,全面检验你的掌握程度