← All Units← 返回单元列表 ← Course Hub← 课程主页
A P C O M P U T E R S C I E N C E P R I N C I P L E S
Unit 4 · Solutions第 4 单元 · 解析

Computer Systems and Networks — Solutions计算机系统与网络 —— 解析

Companion to the AP-Style MC Practice SetAP 风格选择题练习的解析配套

MEDIUM HARD AP MC

Unit 4: Computer Systems and Networks第 4 单元:计算机系统与网络CSP



MULTIPLE CHOICEWorked Answers详细解析

Multiple Choice — Worked Answers选择题(Multiple Choice)—— 详细解析

Each item restates the prompt and choices, marks the correct letter, and gives a brief justification. Trap distractors are called out where useful.每道题重述题干与选项、标出正确答案字母,并给出简明解析;对容易混淆的干扰项(trap distractor)单独提示。

Q1MEDIUMAP MC4.1 The Internet

A school adds sensors made by several manufacturers to its existing Internet-connected network. The sensors and other devices use the same open communication protocols.一所学校将多家制造商生产的传感器加入现有的互联网连接网络。传感器和其他设备使用相同的开放通信协议(open communication protocols)。

Which statement best explains how the protocols help the devices communicate?哪个说法最能解释协议如何帮助这些设备通信?

Answer:答案: (C)
  • A protocol specifies agreed-upon behavior. Open protocols can be implemented by different manufacturers, allowing their devices to communicate.
The identical-hardware option confuses common rules with common physical equipment. The guaranteed-connection option ignores possible failures. The option about preventing additions contradicts the Internet's scalability.
  • 协议规定了共同遵循的行为规则。不同制造商可以实现开放协议,使其设备能够通信。
相同硬件选项混淆了共同规则与相同的物理设备。保证连接的选项忽略了可能发生的故障。阻止接入的选项与互联网的可扩展性相矛盾。
Q2HARDAP MC4.1 The Internet

A device sends a large file across the Internet as multiple packets. Some packets take different routes, and the receiver does not initially receive every packet.一台设备通过互联网将一个大文件分成多个数据包(packet)发送。一些数据包经过不同的路由,接收方最初并未收到所有数据包。

Which two statements are correct? Select two answers. Select two answers.以下哪两个说法正确?请选择两个答案。 选择两个答案。

Answer:答案: (A), (C)
  • Packets carry data and metadata; information such as ordering can support reassembly.
  • TCP can detect missing data and support retransmission.
The same-route option overlooks dynamic routing. The data-only option ignores packet metadata used for routing and reassembly.
  • 数据包包含数据和元数据;顺序等信息可以帮助接收方重新组装数据。
  • TCP 可以检测数据缺失并支持重新传输。
相同路由选项忽略了动态路由。仅含数据的选项忽略了用于路由和重新组装的数据包元数据。
Q3MEDIUMAP MC4.1 The Internet

A student uses a browser to open a linked page on a remote server.一名学生使用浏览器打开远程服务器上的一个链接页面。

Which statement correctly describes the World Wide Web and the Internet?哪个说法正确描述了万维网(World Wide Web)和互联网(Internet)?

Answer:答案: (D)
  • The Internet connects networks, while the Web is a system of linked pages, programs, and files that uses the Internet.
  • HTTP is a protocol used by the Web.
The single-page option misidentifies both systems. The identical-names option confuses a protocol with the systems that use it. The local-only option incorrectly excludes Internet connections.
  • 互联网连接多个网络,而万维网是使用互联网的链接页面、程序和文件组成的系统。
  • HTTP 是万维网使用的一种协议。
单个网页选项错误地定义了两个系统。名称相同的选项混淆了协议与使用该协议的系统。仅限局域网的选项错误地排除了互联网连接。
Q4HARDAP MC4.1 The Internet

A dedicated link has a maximum bandwidth of 8 million bits per second. A device sends a file containing 96 million bits over the link. Assume the link operates continuously at its maximum bandwidth and ignore all overhead.一条专用链路的最大带宽(bandwidth)为每秒 800 万比特。一台设备通过该链路发送一个包含 9600 万比特的文件。假设链路始终以最大带宽运行,且忽略所有额外开销。

How many seconds does the transmission take?传输需要多少秒?

Answer:答案: (D)
  • Transmission time equals data size divided by the rate.
  • 96 million bits divided by 8 million bits per second is 12 seconds.
8 uses the bandwidth as the time. 88 subtracts quantities with different units. 768 multiplies instead of dividing.
  • 传输时间等于数据大小除以传输速率。
  • 9600 万比特除以每秒 800 万比特,得到 12 秒。
8 把带宽当成了时间。88 将单位不同的量相减。768 使用了乘法而不是除法。
Q5HARDAP MC4.1 The Internet

A network has devices S, A, B, and T. Its bidirectional connections are S-A, S-B, A-B, A-T, and B-T. A path may not visit any device more than once.一个网络有设备 S、A、B 和 T。其双向连接为 S-A、S-B、A-B、A-T 和 B-T。一条路径不能多次经过同一设备。

How many distinct paths are there from S to T?从 S 到 T 有多少条不同的路径(path)?

Answer:答案: (C)
  • Starting through A gives S-A-T and S-A-B-T.
  • Starting through B gives S-B-T and S-B-A-T.
  • These are the four paths that do not revisit a device.
2 counts only the paths with one intermediate device. 3 omits one valid path. 5 overcounts, since no other path satisfies the no-revisit condition.
  • 先经过 A 可得到 S-A-T 和 S-A-B-T。
  • 先经过 B 可得到 S-B-T 和 S-B-A-T。
  • 这四条路径均不重复经过设备。
2 只计算了具有一个中间设备的路径。3 漏掉了一条有效路径。5 多算了路径,因为不存在其他满足不重复经过条件的路径。
Q6HARDAP MC4.1 The Internet

An online game sends frequent updates between players. During a session, a network connection fails, but another route remains available.一款在线游戏在玩家之间频繁发送更新。游戏过程中,一条网络连接发生故障,但仍有其他可用路由。

Which explanation best describes what dynamic routing can do?哪个解释最准确地描述了动态路由(dynamic routing)能够做什么?

Answer:答案: (A)
  • Routing finds a path from sender to receiver. When a connection fails, an available alternative may be used for later packets.
  • Alternative routing alone does not guarantee delivery.
Physical repair is not what routing does. The fixed-route option contradicts dynamic routing. The ordered-arrival option ignores that packets can take different paths or be delayed.
  • 路由负责寻找从发送方到接收方的路径。连接故障时,后续数据包可能使用可用的替代路径。
  • 仅有替代路由并不能保证送达。
物理修复不是路由的作用。固定路由选项与动态路由相矛盾。按序到达选项忽略了数据包可能经过不同路径或发生延迟。
Q7MEDIUMAP MC4.2 Fault Tolerance

A hospital connects its local network to a remote service using two independent network connections. Either connection alone has enough capacity for essential traffic.一家医院使用两条独立的网络连接,将其局域网连接到远程服务。任意一条连接的容量都足以承载必要的数据流量。

What is the primary fault-tolerance benefit of the second connection?第二条连接提供的主要容错(fault tolerance)优势是什么?

Answer:答案: (C)
  • The extra connection is redundant: it can carry essential traffic when the other connection fails.
The no-failure option confuses tolerating failure with preventing it. The no-router option removes components still needed for communication. The remote-service option claims protection against a failure not addressed by the connections.
  • 额外连接提供冗余(redundancy):另一条连接故障时,它可以承载必要的数据流量。
不会故障的选项混淆了容忍故障与防止故障。无需路由器的选项排除了通信仍然需要的组件。远程服务选项声称这些连接能够防范它们无法解决的故障。
Q8HARDAP MC4.2 Fault Tolerance

A network has bidirectional connections S-A, A-T, S-B, B-T, and T-U. All devices and connections initially work. Assume that only one connection fails at a time.一个网络有双向连接 S-A、A-T、S-B、B-T 和 T-U。最初所有设备和连接均正常工作。假设每次只有一条连接发生故障。

Which two statements are correct? Select two answers. Select two answers.以下哪两个说法正确?请选择两个答案。 选择两个答案。

Answer:答案: (A), (C)
  • After S-A fails, S-B-T remains available.
  • Every path to U uses T-U, so its failure disconnects U from S.
The route-through-B option for a T-U failure overlooks the final connection to U. The no-device-failure option confuses redundant routes with prevention of all failures.
  • S-A 故障后,S-B-T 仍然可用。
  • 所有通向 U 的路径都经过 T-U,因此该连接故障会使 U 与 S 断开。
T-U 故障时仍可通过 B 到达 U 的选项忽略了通向 U 的最后一条连接。设备不会故障的选项混淆了路由冗余与防止所有故障。
Q9HARDAP MC4.2 Fault Tolerance

A network has bidirectional connections S-A, A-B, B-T, A-C, C-T, S-D, D-B, and T-U. All devices work, and exactly one connection will fail.一个网络有双向连接 S-A、A-B、B-T、A-C、C-T、S-D、D-B 和 T-U。所有设备均正常工作,且恰好有一条连接将发生故障。

For how many of the listed connections would its failure disconnect S from U?在列出的连接中,有多少条连接一旦发生故障就会使 S 无法到达 U?

Answer:答案: (B)
  • T-U is the only connection to U, so its failure disconnects S from U.
  • Every other listed connection lies on a cycle. If one fails, the rest of its cycle provides an alternative route between its endpoints.
  • Therefore exactly one connection has the stated effect.
0 overlooks T-U. 2 and 3 incorrectly treat connections on cycles as unavoidable.
  • T-U 是连接 U 的唯一链路,因此它发生故障会使 S 无法到达 U。
  • 其他每条连接都位于一个环路上。如果其中一条发生故障,该环路的其余部分可提供连接其两个端点的替代路径。
  • 因此恰好有一条连接具有题述影响。
0 忽略了 T-U。2 和 3 错误地认为环路上的连接不可替代。
Q10HARDAP MC4.3 Parallel and Distributed Computing

A data-analysis program first performs a 6-second setup. It then runs three independent tasks simultaneously, taking 12, 8, and 10 seconds. After all three finish, it performs a 4-second summary. Assume there is no additional overhead.一个数据分析程序首先进行 6 秒的准备工作。然后它同时运行三个独立任务,分别需要 12、8 和 10 秒。三个任务全部完成后,程序再用 4 秒生成汇总。假设没有其他额外开销。

How many seconds does the program take?程序共需要多少秒?

Answer:答案: (A)
  • The simultaneous tasks take as long as the longest one, 12 seconds.
  • The setup and summary are sequential, so the total is 6 + 12 + 4 = 22 seconds.
18 omits the summary. 30 uses the sum of the parallel tasks but omits the sequential work. 40 treats every task as sequential.
  • 同时运行的任务所需时间等于其中最长的时间,即 12 秒。
  • 准备和汇总必须顺序执行,因此总时间为 6 + 12 + 4 = 22 秒。
18 漏掉了汇总时间。30 将并行任务的时间相加,却漏掉了顺序工作。40 把所有任务都当作顺序执行。
Q11HARDAP MC4.3 Parallel and Distributed Computing

A sequential solution takes 48 seconds. A parallel solution to the same task takes 6 seconds for setup, 9 seconds for its longest simultaneous task, and 3 seconds for final aggregation.一个顺序计算方案需要 48 秒。完成同一任务的并行方案需要 6 秒进行准备,最长的并行任务需要 9 秒,最后汇总需要 3 秒。

What is the speedup of the parallel solution over the sequential solution?并行方案相对于顺序方案的加速比(speedup)是多少?

Answer:答案: (A)
  • The parallel time is 6 + 9 + 3 = 18 seconds.
  • Speedup is sequential time divided by parallel time: 48/18 = 8/3.
3/8 reverses the ratio. 16/3 divides by only the longest parallel task. 48 is the sequential time, not a ratio.
  • 并行方案的时间为 6 + 9 + 3 = 18 秒。
  • 加速比等于顺序时间除以并行时间:48/18 = 8/3。
3/8 将比值颠倒。16/3 仅用最长并行任务的时间作除数。48 是顺序时间,不是比值。
Q12HARDAP MC4.3 Parallel and Distributed Computing

A task takes 100 seconds sequentially. Of this time, 20 seconds must remain sequential. The remaining work can be divided perfectly among any number of processors, with no overhead.一个任务顺序执行需要 100 秒。其中 20 秒的工作必须保持顺序执行。其余工作可以完美地分配给任意数量的处理器,且没有额外开销。

What is the greatest possible speedup under these assumptions, even as the number of processors increases without bound?在这些假设下,即使处理器数量无限增加,最大可能加速比是多少?

Answer:答案: (B)
  • The parallelizable 80 seconds can approach zero, but the 20-second sequential portion remains.
  • The total time cannot be less than 20 seconds, so speedup cannot exceed 100/20 = 5.
4 uses only the parallelizable work in the numerator. 20 is the limiting time in seconds, not the speedup. 100 ignores the sequential portion when calculating the limit.
  • 可并行的 80 秒工作所需时间可以趋近于零,但 20 秒的顺序部分仍然存在。
  • 总时间不能低于 20 秒,因此加速比不能超过 100/20 = 5。
4 只把可并行的工作时间放在分子。20 是以秒为单位的极限时间,不是加速比。100 在计算极限时忽略了顺序部分。
Q13MEDIUMAP MC4.3 Parallel and Distributed Computing

A research team stores a data set across many networked computers and uses those computers together to analyze it. The data set is too large to fit on any one of the computers.一个研究团队将数据集存储在多台联网计算机上,并使用这些计算机共同分析数据。该数据集过大,无法存放在其中任何一台计算机上。

Which statement best describes an advantage of this distributed approach?哪个说法最能描述这种分布式计算(distributed computing)方法的优势?

Answer:答案: (A)
  • Distributed computing uses multiple devices, allowing a task to draw on their combined storage and processing resources.
The no-exchange option ignores coordination and data transfer. The single-device option describes a different arrangement. The constant-reduction option ignores sequential work and other limits on scaling.
  • 分布式计算使用多台设备,使任务能够利用它们合计的存储和处理资源。
无需交换数据的选项忽略了协调和数据传输。单设备选项描述的是另一种安排。恒定减少时间的选项忽略了顺序工作和其他扩展限制。
Q14HARDAP MC4.3 Parallel and Distributed Computing

A program must process 120 equal-sized records. It spends 10 seconds on setup, then assigns records to three processors. Each processor takes 1 second per record, processors work simultaneously, and the program spends 5 seconds combining results after all processors finish. There is no other overhead. The current assignment gives the processors 50, 40, and 30 records. A proposed assignment gives each processor 40 records.一个程序必须处理 120 条大小相同的记录。程序先用 10 秒进行准备,然后将记录分配给三个处理器。每个处理器处理一条记录需要 1 秒,各处理器同时工作,所有处理器完成后程序还需要 5 秒合并结果。没有其他额外开销。当前分配给三个处理器的记录数分别为 50、40 和 30。建议的新分配方案是每个处理器处理 40 条。

How many seconds would the proposed assignment save?建议的新分配方案可节省多少秒?

Answer:答案: (D)
  • The current assignment takes 10 + max(50, 40, 30) + 5 = 65 seconds.
  • The proposed assignment takes 10 + 40 + 5 = 55 seconds.
  • The saving is 65 - 55 = 10 seconds.
5 is the combining time rather than the saving. 15 omits part of the comparison by treating the proposed total as 50 seconds. 20 adds the sizes of the individual workload changes (10 + 10) instead of comparing the longest loads.
  • 当前方案需要 10 + max(50, 40, 30) + 5 = 65 秒。
  • 建议方案需要 10 + 40 + 5 = 55 秒。
  • 节省的时间为 65 - 55 = 10 秒。
5 是合并结果的时间,不是节省的时间。15 将建议方案的总时间错误地算成 50 秒,漏掉了部分时间。20 把各处理器工作量变化的大小相加(10 + 10),而没有比较最长的负载。
Q15HARDAP MC4.3 Parallel and Distributed Computing

A program has seven independent jobs, each taking 5 seconds. It has three processors, and each processor can run only one job at a time. Jobs cannot be split between processors. After all jobs finish, a single sequential step takes 4 seconds. Assume jobs can be assigned immediately and there is no other overhead.一个程序有七个独立任务,每个任务需要 5 秒。程序有三个处理器,每个处理器同一时间只能运行一个任务。任务不能拆分到多个处理器上。所有任务完成后,还需要执行一个耗时 4 秒的顺序步骤。假设任务可以立即分配,且没有其他额外开销。

What is the minimum total time needed to complete the program?完成程序所需的最短总时间是多少?

Answer:答案: (B)
  • At most three jobs can run in each 5-second interval. Seven jobs require three such intervals.
  • The jobs take at least 15 seconds, achievable by assigning three jobs to one processor and two to each other processor.
  • The final sequential step adds 4 seconds, for 19 seconds total.
14 assumes that the jobs fit into two intervals. 15 omits the final step. 39 treats all seven jobs as sequential.
  • 每个 5 秒的时间段最多运行三个任务。七个任务需要三个这样的时间段。
  • 任务至少需要 15 秒;将三个任务分配给一个处理器、另外两个处理器各分配两个任务即可达到这一时间。
  • 最后的顺序步骤再加 4 秒,总共需要 19 秒。
14 错误地认为任务能在两个时间段内完成。15 漏掉了最后的步骤。39 将七个任务都当作顺序执行。