← COMP5511 全部讲次
Q13

Final 问答|M 基础、搜索、逻辑、概率

Final 双语问答 M 基础、搜索、逻辑、概率:中英题面,逐题折叠中文答案、英文答卷模板与回查出处。非官方。

手机上宽表格可左右滑动;自测答案默认收起,点击题目下方按钮查看。

使用边界:期末复习,非官方材料。考试安排按课程公告整理,正式要求以讲师通知和课堂公告为准。本页是同学整理的双语问答,英文可作答卷模板,题目是整理出来的常见问法,不是预测卷。

复习资料:考试安排与范围地图 · 专家系统与推荐系统 · Agent 与生成式 AI

先做题再看解析:G 往年卷:搜索、逻辑、概率 · H 往年卷:CNN 与神经网络 · I 往年卷:延伸与简答 · J 判断 1–25 · K 判断 26–50 · L 选择题 · M 问答:搜索、逻辑、概率 · N 问答:回归、聚类、神经网络 · O 问答:CNN、RNN 与拓展 · P 期中后新内容

怎么做:先只看题面,用英文写出答案要点,再展开核对;简答题先下结论再给理由;页码为 PDF 页序。

M 基础、搜索、逻辑、概率

底稿问答 Q01–Q25,按「基础与搜索」「逻辑」「概率」三组排列。「回查」里标了往年卷题号的,表示出过同类题型,不表示今年会出原题。

基础与搜索:M1–M13。

AI、ML、DL 有什么关系?

How are AI, ML and DL related?

M1 · 查看答案与解析

答案:AI 是研究机器智能行为的广泛领域,包括搜索、逻辑推理和学习。ML 是其中从数据或经验改善任务表现的方法。DL 是使用多层神经网络的 ML 方法。因此 DL⊂ML⊂AI。一个只执行人工 IF–THEN 规则的专家系统可以属于 AI,但不一定属于 ML。

English: AI is the broad field of building systems that perform intelligent tasks, including search, reasoning and learning. ML is a subset of AI that improves task performance through data or experience. DL is a subset of ML that uses multilayer neural networks. A purely rule-based expert system may be an AI system without being a machine-learning system.

回查:L01、L04a。

M2 · Q02 Compare supervised, unsupervised and reinforcement learning.

比较三类学习并举例。

Compare supervised, unsupervised and reinforcement learning.

M2 · 查看答案与解析

答案:监督学习用输入与正确标签学习映射,如用历史面积和价格预测房价;无监督学习没有目标标签,发现数据结构,如客户聚类;强化学习通过与环境交互和奖励学习策略,如游戏智能体学习行动。奖励不必是每一步的“标准答案”,可能延迟出现。

English: Supervised learning uses labeled input–target pairs, for example house-price prediction. Unsupervised learning discovers structure without target labels, for example customer clustering. Reinforcement learning learns a policy through interaction and rewards, for example a game-playing agent. Rewards may be delayed and need not specify the correct action at each step.

回查:L01、L04a。

M3 · Q03 Does a classifier become a regression model because it outputs probabilities?

分类模型输出概率,它是否就变成回归?

Does a classifier become a regression model because it outputs probabilities?

M3 · 查看答案与解析

答案:不一定。任务类型由目标决定,不由输出是否写成小数决定。预测“猫/狗”属于分类,即使用 0.8 表示猫的概率;预测房价属于回归。逻辑回归虽名字有 regression,通常用于分类。

English: No. The task is determined by the target, not by whether an intermediate output is a decimal. Predicting cat versus dog is classification even if the model outputs a class probability such as 0.8. Predicting a house price is regression. Logistic regression is normally used for classification despite its name.

回查:L04a、L06。

M4 · Q04 Distinguish generative and discriminative classifiers.

生成式与判别式分类器有什么区别?

Distinguish generative and discriminative classifiers.

M4 · 查看答案与解析

答案:生成式分类器建模 P(x|y) 和 P(y),或联合 P(x,y),再用 Bayes 得到分类结果。判别式直接学习 P(y|x) 或决策边界。前者关心“某类如何产生数据”,后者关心“如何把类别分开”。不要把这里的生成式分类器只理解为聊天或生成图片。

English: A generative classifier models P(x|y) and P(y), or their joint distribution, and uses Bayes’ rule for classification. A discriminative classifier directly models P(y|x) or a decision boundary. The former models how classes generate observations; the latter focuses on separating classes. This distinction is broader than modern text or image generation.

回查:L06 p.9–15。

M5 · Q05 What defines a search problem, and how is search evaluated?

一个搜索问题需要定义什么?什么是好搜索?

What defines a search problem, and how is search evaluated?

M5 · 查看答案与解析

答案:需定义状态空间、初始状态、合法动作及后继、目标测试、路径代价。常用评价是完备性、最优性、时间复杂度和空间复杂度。解路径是从起点到目标的连续路线;展开顺序还可能包含尝试过的旁支,二者不能混写。

English: A search problem specifies states, an initial state, legal actions and successors, a goal test, and path costs. Search algorithms are evaluated by completeness, optimality, time complexity and space complexity. The solution path is a connected route to the goal; the expansion order may also contain nodes explored on unsuccessful branches.

回查:L02 p.4–15。

M6 · Q06 Give at least three differences between BFS and DFS.

给出 BFS 与 DFS 的至少三个区别。

Give at least three differences between BFS and DFS.

M6 · 查看答案与解析

答案:BFS 用 FIFO 队列,逐层展开;DFS 用 LIFO 栈或递归,先深入再回溯。BFS 在有限分支且解深度有限时完备;DFS 在无限深或未处理循环时可能不完备。等边权时 BFS 保证最小代价,DFS 一般不保证。树搜索下 BFS 存储整个大前沿,空间通常高于 DFS。

English: BFS uses a FIFO queue and explores level by level, whereas DFS uses a LIFO stack or recursion and explores deeply before backtracking. BFS is complete with finite branching and a finite-depth solution. DFS may fail in infinite-depth spaces or untreated cycles. BFS is optimal for equal edge costs; DFS is not generally optimal. BFS usually needs more frontier memory in tree search.

复杂度补充 / Complexity:令 b=分支因子,d=最浅解深度,m=最大搜索深度。常见树搜索上界:BFS 时间/空间 O(bᵈ⁺¹),DFS 时间 O(bᵐ)、前沿空间 O(bm)。若在有限显式图上用 visited 集合,BFS/DFS 都可有 O(V+E) 时间和 O(V) 额外空间。不同设定不能混用。/ Complexity depends on whether the problem is an implicit search tree or an explicitly stored finite graph.

回查:L02、T02;F24 Q5.1、F25 Q1。

M7 · Q07 Does BFS always find the cheapest path?

BFS 一定找到最便宜路径吗?

Does BFS always find the cheapest path?

M7 · 查看答案与解析

答案:不一定。BFS 优先边数少的路径,而不是权重总和小的路径。若 S→G 花费 100,而 S→A→G 花费 1+1,BFS 可能选一条边的 100。只有所有边等代价等条件下,最少边数才等于最小代价。

English: No. BFS minimizes the number of edges, not the sum of arbitrary edge costs. If S→G costs 100 but S→A→G costs 2, BFS may select the one-edge route costing 100. Minimum depth corresponds to minimum cost when edge costs are equal.

回查:L02、F25 Q1 的加权图题型。

M8 · Q08 Compare greedy best-first search and A*.

比较 Greedy 与 A*。

Compare greedy best-first search and A*.

M8 · 查看答案与解析

答案:Greedy 用 f=h,只关注估计离目标还有多远。A* 用 f=g+h,同时考虑已付代价和预计剩余代价。Greedy 可能被看似接近目标但已经很贵的路线误导。A* 在适当启发式和重复状态处理条件下可以保证最优;不能说只要写出 g+h 就无条件最优。

English: Greedy best-first search ranks frontier nodes by h(n), the estimated remaining cost. A* ranks them by g(n)+h(n), combining the cost already paid and the estimated cost to go. Greedy can choose an expensive route that merely appears close to the goal. A* can guarantee optimality under suitable heuristic and duplicate-handling assumptions.

回查:L02 p.52–67;F25 Q1。

Hill Climbing 为什么会失败?它和 Greedy 一样吗?

Why can hill climbing fail, and is it the same as greedy best-first search?

M9 · 查看答案与解析

答案:爬山通常只从当前节点的邻居选择改进,丢弃其他候选,因此可能卡在局部最优、平台或山脊。随机重启可改善但不保证一次就找到全局最优。Greedy best-first 在整个 Open 集合中选择 h 最小的节点,通常保留其他前沿;二者不是同一种算法。

English: Hill climbing typically selects an improving neighbor of the current state and discards other alternatives. It can stop at a local optimum, plateau or ridge. Random restarts can help but do not guarantee a global optimum in a single run. Greedy best-first search instead selects the best heuristic value from the entire frontier and normally retains alternative frontier nodes.

回查:L02 p.47–57、T03。

M10 · Q10 What heuristic properties support A* optimality?

什么启发式能支持 A* 最优性?

What heuristic properties support A* optimality?

M10 · 查看答案与解析

答案:可采纳性是 h(n)≤h*(n),即不高估。以有限图、非负边代价、h(goal)=0 为例,可采纳启发式配合允许必要的重新打开,并在目标从 Open 取出时停止,可得到最优解。若算法永久关闭节点不再展开,通常使用更强的一致性 h(n)≤c(n,n′)+h(n′)。h=0 时 A* 退化为按 g 的一致代价搜索。

English: Admissibility means h(n)≤h*(n). For a finite graph with nonnegative edge costs and h(goal)=0, admissibility supports optimal A* when improved closed states can be reopened and the goal is accepted when removed from the frontier. If closed states are never reopened, consistency, h(n)≤c(n,n′)+h(n′), is a standard sufficient condition. With h=0, A* becomes uniform-cost search.

回查:L02 p.58–60;一致性是为解释图搜索条件补充。

M11 · Q11 What should A* do when it finds a cheaper route to an existing state?

同一状态出现更便宜路径时怎么办?

What should A* do when it finds a cheaper route to an existing state?

M11 · 查看答案与解析

答案:若 new g 更小,更新 g、f 和 parent;节点还在 Open 时调整优先级。若已经在 Closed,允许 reopen 的版本应重新加入 Open;若题目明说不重复展开,就遵守题设,并且不再无条件声称此实现最优。new g 相等时是否换 parent 也按题设,未说明可保留先找到的。

English: If the new g-value is lower, update the path cost, priority and parent. If the state is open, adjust its priority. If it is closed, reopen it when the specified algorithm permits reopening. If the question explicitly forbids repeated expansion, follow that rule and do not assume unconditional optimality. For equal costs, follow the tie rule or retain the existing parent.

回查:T03 p.31–34;F25 Q1 另给“只展开一次”。

M12 · Q12 How does beam search work, and is a larger beam always better?

Beam Search 如何工作?更大的 beam 一定最好吗?

How does beam search work, and is a larger beam always better?

M12 · 查看答案与解析

答案:每步扩展保留的部分序列,按累计评分只留最好的 k 个。它减少时间与内存,但丢弃的候选可能通向最佳完整解,因此一般不完备、不保证最优。更大的 k 保留更多候选、计算更贵;不保证最终任务指标一定提升。序列概率是条件概率连乘,也可把对数相加。

English: Beam search expands retained partial sequences and keeps only the best k candidates by cumulative score at each step. Pruning saves computation and memory but may discard the prefix of the best complete solution, so optimality and completeness are not generally guaranteed. A larger beam keeps more alternatives at higher cost but does not guarantee a better task metric. Sequence probabilities multiply; log probabilities add.

回查:T03 p.16–19。

M13 · Q13 What are two common heuristics for the eight-puzzle?

八数码常用的两个启发式是什么?

What are two common heuristics for the eight-puzzle?

M13 · 查看答案与解析

答案:错位棋子数统计不在目标位置的棋子;曼哈顿距离把每块棋子离目标的横向与纵向距离相加,通常不计空格。标准每次移动一块棋子、每步代价为 1 时,两者都不高估。曼哈顿距离通常提供更强的信息,但更强启发式也可能需要更多计算。

English: The misplaced-tile heuristic counts tiles outside their goal positions. Manhattan distance sums each tile’s horizontal and vertical distance from its goal, usually excluding the blank. Both are admissible for the standard puzzle with unit-cost tile moves. Manhattan distance is generally more informative, although heuristic computation itself also has a cost.

回查:L02 p.53–56。

逻辑:M14–M20。

M14 · Q14 How do we translate if, only if, iff, necessary and sufficient?

怎样翻译 if、only if、iff、必要与充分?

How do we translate if, only if, iff, necessary and sufficient?

M14 · 查看答案与解析

答案:“P if Q” 是 Q→P;“P only if Q” 是 P→Q;“P if and only if Q” 是 P↔Q。“P is sufficient for Q” 是 P→Q;“P is necessary for Q” 是 Q→P。蕴含不是因果的自动证明,也不能随意反向。P→Q 等价于 ¬P∨Q 和逆否命题 ¬Q→¬P。

English: “P if Q” means Q→P. “P only if Q” means P→Q. “P if and only if Q” means P↔Q. “P is sufficient for Q” means P→Q, while “P is necessary for Q” means Q→P. An implication is equivalent to ¬P∨Q and to its contrapositive ¬Q→¬P, but not generally to its converse.

回查:L03b;F24 Q2。

M15 · Q15 Distinguish valid, satisfiable and unsatisfiable formulas.

有效、可满足、不可满足如何区分?

Distinguish valid, satisfiable and unsatisfiable formulas.

M15 · 查看答案与解析

答案:至少一个赋值为真叫可满足;所有赋值为真叫有效;没有赋值为真叫不可满足。P∨¬P 有效且可满足;P∧¬P 不可满足;P→Q 可满足但不有效。“有效”和“可满足”不是互斥分类;若题目给三选,写最精确结论并注明包含关系。

English: A formula is satisfiable if at least one interpretation makes it true, valid if every interpretation makes it true, and unsatisfiable if none does. P∨¬P is valid and satisfiable; P∧¬P is unsatisfiable; P→Q is satisfiable but not valid. Validity implies satisfiability, so those two categories are not mutually exclusive.

回查:L03b p.17;F25 Q2。

M16 · Q16 How does equivalence differ from entailment?

逻辑等价与蕴含有什么区别?

How does equivalence differ from entailment?

M16 · 查看答案与解析

答案:α≡β 要求每个赋值下真值相同,相当于互相蕴含。KB⊨Q 只要求所有使 KB 为真的赋值也使 Q 为真。比如 P∧Q 蕴含 P,但不与 P 等价,因为 P 真、Q 假时二者不同。单个赋值同真不足以证明等价。

English: Logical equivalence requires two formulas to have identical truth values under every interpretation, or to entail each other. KB⊨Q requires only that every interpretation satisfying KB also satisfies Q. For example, P∧Q entails P but is not equivalent to P. Agreement under one interpretation does not establish equivalence.

回查:L03b p.18–20。

M17 · Q17 How do we convert to CNF, and how does it differ from DNF?

如何转 CNF?它与 DNF 的区别是什么?

How do we convert to CNF, and how does it differ from DNF?

M17 · 查看答案与解析

答案:CNF 是 AND of ORs,DNF 是 OR of ANDs。转 CNF:消去 ↔;用 ¬P∨Q 消去 →;用德摩根与双重否定把 NOT 推到原子;用 OR 对 AND 的分配律;最后可化简。不是只把括号换个位置。比如 P∨(Q∧R)=(P∨Q)∧(P∨R)。

English: CNF is a conjunction of disjunctions; DNF is a disjunction of conjunctions. To obtain CNF, eliminate biconditionals and implications, push negations inward using De Morgan’s laws, and distribute OR over AND. Simplify if appropriate. For example, P∨(Q∧R) becomes (P∨Q)∧(P∨R). Merely rearranging brackets is insufficient.

回查:L03b p.36–38、T05、A1 Q5;F24 Q3、F25 Q2。

M18 · Q18 Compare forward and backward chaining.

比较前向与后向链接。

Compare forward and backward chaining.

M18 · 查看答案与解析

答案:前向从事实出发,触发前提满足的规则,是数据驱动;后向从查询出发,找到能推出查询的规则,再证明其全部前提,是目标驱动。若一条规则前提是 A∧B,两者都要证明;若多条规则都能推出 Q,任意一条成功即可。课件算法主要在 definite Horn 规则范围内讨论。

English: Forward chaining is data-driven: it starts with facts and fires rules whose premises are satisfied. Backward chaining is goal-driven: it starts with a query and recursively proves premises of rules that can establish it. All premises of one conjunctive rule are required, while any successful alternative rule may establish the goal. The standard algorithms here operate on definite Horn rules.

回查:L03b p.21–34、T05。

M19 · Q19 How do we prove KB⊨Q by resolution?

如何用归结证明 KB⊨Q?

How do we prove KB⊨Q by resolution?

M19 · 查看答案与解析

答案:将 KB∧¬Q 转成 CNF 子句集合。反复选含互补文字的两个子句,比如 P∨A 和 ¬P∨B,推出 A∨B。若推出空子句,说明 KB∧¬Q 不可满足,因此 KB⊨Q。若还没推出空子句,不能立刻说失败;只有穷尽所有新归结式仍无矛盾,才在完整命题归结过程下否定该蕴含。

English: Convert KB∧¬Q into CNF clauses. Repeatedly resolve complementary literals, for example deriving A∨B from P∨A and ¬P∨B. Deriving the empty clause shows that KB∧¬Q is unsatisfiable, so KB entails Q. Failure to find a contradiction after only a few steps is inconclusive; a complete propositional procedure must exhaust the possible new resolvents.

回查:L03b p.35–43;F25 Q2.3。

M20 · Q20 What is a Horn clause, and why is chaining restricted?

什么是 Horn 子句?为什么前后向链接有使用范围?

What is a Horn clause, and why is chaining restricted?

M20 · 查看答案与解析

答案:Horn 子句至多有一个正文字。例如 ¬P∨¬Q∨R 等价于 P∧Q→R。课件常用的是恰有一个正文字的 definite Horn 规则,事实 R 也可视为这种子句。前后向链接利用这种规则结构高效推理;一般含多个正文字的任意公式不能直接套同一算法。一般命题公式可转 CNF 后用归结。

English: A Horn clause has at most one positive literal. For example, ¬P∨¬Q∨R is equivalent to P∧Q→R. The chaining algorithms here mainly use definite Horn clauses, which have exactly one positive literal, including facts. Their efficiency relies on this rule structure; arbitrary propositional formulas cannot simply be processed in the same way. Resolution handles general CNF clauses.

回查:L03b p.21、28、34–35。

概率:M21–M25。

M21 · Q21 Are independence, mutual exclusivity and conditional independence the same?

独立、互斥、条件独立是否一样?

Are independence, mutual exclusivity and conditional independence the same?

M21 · 查看答案与解析

答案:不一样。独立是 P(A,B)=P(A)P(B);互斥是 P(A,B)=0。如果两事件概率都大于零,互斥就不独立。条件独立给定 C 后要求 P(A,B|C)=P(A|C)P(B|C)。无条件独立不保证给定某变量后仍独立,反过来也不保证。

English: No. Independence means P(A,B)=P(A)P(B), while mutual exclusivity means P(A,B)=0. Two mutually exclusive events with positive probabilities are not independent. Conditional independence requires P(A,B|C)=P(A|C)P(B|C). Independence need not survive conditioning, and conditional independence does not generally imply unconditional independence.

回查:L03a p.8、13、19。

M22 · Q22 Explain the components of Bayes’ rule.

Bayes 公式的四个部分分别是什么?

Explain the components of Bayes’ rule.

M22 · 查看答案与解析

答案:P(H|E)=P(E|H)P(H)/P(E)。P(H) 是先验,P(E|H) 是似然,P(E) 是证据的总概率,P(H|E) 是后验。若 Hᵢ 互斥且覆盖全部情况,P(E)=ΣᵢP(E|Hᵢ)P(Hᵢ)。不能直接把 P(E|H) 当成 P(H|E)。

English: Bayes’ rule is P(H|E)=P(E|H)P(H)/P(E). P(H) is the prior, P(E|H) the likelihood, P(E) the evidence probability, and P(H|E) the posterior. For an exhaustive mutually exclusive partition Hᵢ, P(E)=ΣᵢP(E|Hᵢ)P(Hᵢ). Reversing a conditional probability requires this adjustment; the two conditionals are not generally equal.

回查:L03a p.15–17、A1 Q4;F25 Q3 为全概率题型。

M23 · Q23 Does high sensitivity imply a high probability of disease after a positive test?

检测灵敏度很高,阳性后患病概率一定很高吗?

Does high sensitivity imply a high probability of disease after a positive test?

M23 · 查看答案与解析

答案:不一定,还取决于先验患病率和假阳性率。若病非常少见,健康人数量远多于患者,即使健康人只有少部分误报,也可能占大多数阳性。用课件数值:先验 .001、灵敏度 .99、假阳性 .05,后验约 .01943,即 1.943%,不是 99%。这是题目中的概率例子。

English: No. The posterior also depends on disease prevalence and the false-positive rate. With a rare condition, false positives among the large healthy population may outnumber true positives. Using the lecture’s hypothetical values, prevalence 0.001, sensitivity 0.99 and false-positive rate 0.05, the posterior is about 0.01943, or 1.943%, rather than 99%.

回查:L03a p.16–17。

M24 · Q24 How does a BBN factor a joint distribution, and does a missing edge guarantee independence?

BBN 如何表示联合概率?图上没有边就一定独立吗?

How does a BBN factor a joint distribution, and does a missing edge guarantee independence?

M24 · 查看答案与解析

答案:BBN 是 DAG,联合分布为 ∏ᵢP(Xᵢ|Parents(Xᵢ))。每个节点在给定父节点后,与它的非后代条件独立。没有直接边不等于任何条件下都独立,要考虑整条连接结构。比如 A→C←B 中,独立根 A、B 在观察 C 后可能相关,因为二者都能解释 C。

English: A BBN is a DAG that factors the joint distribution as ∏ᵢP(Xᵢ|Parents(Xᵢ)). Each node is conditionally independent of its non-descendants given its parents. The absence of a direct edge does not guarantee independence under all conditions. In A→C←B, independent root variables A and B can become dependent after observing their common effect C.

回查:L03a p.21–27、T04。

M25 · Q25 Why is switching better in the Monty Hall problem?

Monty Hall 为什么换门更好?

Why is switching better in the Monty Hall problem?

M25 · 查看答案与解析

答案:标准前提是车位置均匀、主持人知道答案、总打开一扇未选的羊门并总提供换门。最初选中车的概率 1/3,选错的概率 2/3;留门在最初选对时赢,换门在最初选错时赢。因此换门胜率 2/3。若主持人的开门和提供选择规则改变,需要重算。若特别条件化到某扇门,还需说明主持人有两个羊门可开时的选择规则。

English: Under the standard assumptions, the car is uniformly placed and the knowledgeable host always opens an unchosen goat door and offers a switch. The initial choice is correct with probability 1/3 and wrong with probability 2/3. Staying wins in the first case, while switching wins in the second. Thus switching wins with probability 2/3. Different host policies require a new calculation.

回查:T04 p.12–15。

下一页 →
Q14 Final 问答|N 回归、聚类、神经网络

个人整理的学习笔记,不是官方材料;数字与结论以课件和讲师为准。