AP Computer Science Principles · 鼎睿学苑

Unit 4: Computer Systems and Networks

单元 4:计算机系统与网络

Explore how networks transfer data and keep working through failures. Compare sequential, parallel, and distributed computing solutions.

探索网络如何传输数据并在发生故障时继续运行,再比较顺序计算、并行计算与分布式计算方案。

11–15% of AP Exam MCQ占 AP 选择题 11–15%Big Idea 4 · CSN大概念 4 · CSN3 Topics3 个小节

The Internet

互联网

Must know
  • A computing device can run a program; a computing system is devices and programs working together. A computer network connects devices that can send or receive data and is a type of computing system. (CSN-1.A.1, CSN-1.A.2, CSN-1.A.3, CSN-1.A.4)
  • A path is a sequence of directly connected devices from sender to receiver; routing finds a path. Bandwidth is the maximum data sent per fixed time, usually measured in bits per second. (CSN-1.A.5, CSN-1.A.6, CSN-1.A.7, CSN-1.A.8)
  • The Internet connects networks using standardized, open protocols. A protocol is an agreed set of rules; open protocols make it easy to connect more devices. Access requires a connection to an Internet-connected device. (CSN-1.B.1, CSN-1.B.2, CSN-1.B.3, CSN-1.B.4)
  • Internet routing is usually dynamic, not specified in advance. Scalability is the capacity to change size or scale for new demands; the Internet was designed to be scalable. (CSN-1.B.5, CSN-1.B.6, CSN-1.B.7)
  • Internet data streams contain chunks encapsulated in packets. Packets carry data and metadata for routing and reassembly; they can arrive in order, out of order, or not at all. IP, TCP, and UDP are common Internet protocols. (CSN-1.C.1, CSN-1.C.2, CSN-1.C.3, CSN-1.C.4)
  • The World Wide Web is a system of linked pages, programs, and files. It uses the Internet and the HTTP protocol. (CSN-1.D.1, CSN-1.D.2, CSN-1.D.3)
必备知识
  • 计算设备(computing device)可以运行程序;计算系统(computing system)是为共同目的协作的设备和程序。计算机网络(computer network)连接能够发送或接收数据的设备,是一种计算系统。(CSN-1.A.1, CSN-1.A.2, CSN-1.A.3, CSN-1.A.4)
  • 路径(path)是从发送方到接收方的一串直接相连的设备;路由(routing)寻找这样的路径。带宽(bandwidth)是固定时间内可发送的数据最大量,通常以比特每秒计量。(CSN-1.A.5, CSN-1.A.6, CSN-1.A.7, CSN-1.A.8)
  • 互联网(Internet)使用标准化的开放协议连接各个网络。协议(protocol)是一组约定的规则;开放协议使连接更多设备更容易。接入互联网需要连接到已接入互联网的设备。(CSN-1.B.1, CSN-1.B.2, CSN-1.B.3, CSN-1.B.4)
  • 互联网路由通常是动态的,不预先指定。可扩展性(scalability)是系统为满足新需求而改变大小或规模的能力;互联网的设计具有可扩展性。(CSN-1.B.5, CSN-1.B.6, CSN-1.B.7)
  • 互联网数据流(data stream)中的数据块被封装在数据包(packet)中。数据包携带数据和用于路由及重新组装的元数据(metadata);它们可能按序、乱序到达,也可能根本不到达。IP、TCP 和 UDP 是常见的互联网协议。(CSN-1.C.1, CSN-1.C.2, CSN-1.C.3, CSN-1.C.4)
  • 万维网(World Wide Web)是由相互链接的页面、程序和文件组成的系统。它使用互联网和 HTTP 协议。(CSN-1.D.1, CSN-1.D.2, CSN-1.D.3)

Devices, paths, and bandwidth

设备、路径与带宽

Computers, tablets, servers, routers, and smart sensors are examples of computing devices. In a network path, each consecutive pair of devices is directly connected. Routing finds a path from the sender to the receiver.

计算机、平板电脑、服务器、路由器和智能传感器都是计算设备的例子。在网络路径中,每两个相邻设备都直接相连。路由负责寻找从发送方到接收方的路径。

Bandwidth describes a maximum rate, not the amount of data in a single message. For example, a bandwidth of 8 million bits per second allows at most 8 million bits to be sent in one second.

带宽描述的是最大速率,而不是单条消息的数据量。例如,带宽为每秒 800 万比特时,一秒内最多可发送 800 万比特。

Open protocols and packets

开放协议与数据包

The Internet is a network of interconnected networks. Its open, standardized protocols let devices follow shared rules, making it easier to connect additional devices. Its design supports growth as demands change.

互联网是由相互连接的网络组成的网络。开放且标准化的协议让设备遵循共同规则,使连接更多设备更容易。互联网的设计支持随需求变化而扩展。

A data stream is sent in packets. Each packet contains a data chunk and metadata used for routing and reassembly. Routes are usually chosen dynamically, and arrival order is not guaranteed.

数据流以数据包的形式发送。每个数据包都包含一个数据块,以及用于路由和重新组装的元数据。路径通常是动态选择的,数据包不保证按序到达。

The Web and the Internet

万维网与互联网

The Web uses the Internet to connect linked pages, programs, and files. HTTP is a Web protocol. The Web is not the same thing as the Internet.

万维网使用互联网来连接相互链接的页面、程序和文件。HTTP 是万维网使用的协议。万维网与互联网不是同一个概念。

Worked Example: Routes and packet order例题:路径与数据包顺序

Sender A and receiver E are connected through routers. Direct links are A–B, B–E, A–C, C–D, and D–E. A sends a message in packets P1, P2, and P3. E receives P2 first, then P1; P3 does not arrive. What paths are possible, and can E reassemble the complete message from the received packets?

发送方 A 和接收方 E 通过路由器连接。直接连接分别为 A–B、B–E、A–C、C–D 和 D–E。A 将一条消息分成数据包 P1、P2 和 P3 发送。E 先收到 P2,再收到 P1;P3 没有到达。有哪些可能的路径?E 能否仅用收到的数据包重新组装完整消息?

  1. A–B–E and A–C–D–E are both paths because each consecutive pair is directly connected.
  2. Routing finds a path. Internet routing is usually dynamic, so do not assume a path was fixed in advance.
  3. The received packets arrived out of order. Their metadata can be used for reassembly, but P3 is missing.
  4. Answer: Both listed paths are possible. E cannot reassemble the complete message from only P1 and P2.
  1. A–B–E 和 A–C–D–E 都是路径,因为每两个相邻设备都直接相连。
  2. 路由会寻找路径。互联网路由通常是动态的,因此不要假定路径已预先固定。
  3. 收到的数据包是乱序到达的。元数据可用于重新组装,但 P3 缺失。
  4. 答案:列出的两条路径都可能使用。E 仅凭 P1 和 P2 无法重新组装完整消息。
Exam trap

A common wrong answer is that all packets must follow one fixed path and arrive in the order sent. Internet routing is usually dynamic, and packets can arrive out of order or not at all. Another trap is treating the Web as the entire Internet: the Web uses the Internet.

考试陷阱

常见错误答案是:所有数据包必须沿同一条固定路径,并按发送顺序到达。互联网路由通常是动态的,数据包可能乱序到达,也可能根本不到达。另一个陷阱是把万维网当作整个互联网:万维网使用互联网。

Going deeper

A possible path is not necessarily the path a packet takes. In the example, knowing the network links gives possible routes, but it does not reveal which route carried each packet. Similarly, bandwidth is a maximum rate, not proof that data is always sent at that rate.

深入理解

可能的路径不一定是数据包实际经过的路径。在例题中,知道网络连接只能确定可能的路线,不能确定每个数据包实际经过了哪条路线。同样,带宽是最大速率,不能证明数据总是以该速率发送。


Fault Tolerance

容错(fault tolerance)

Must know
  • The Internet is engineered for fault tolerance, using abstractions for routing and transmitting data. (CSN-1.E.1)
  • Redundancy adds components to mitigate failures. Multiple paths between connected devices are one form of network redundancy. (CSN-1.E.2, CSN-1.E.3)
  • If an Internet device or connection fails, subsequent data takes another route if one is available. (CSN-1.E.4)
  • A fault-tolerant system keeps functioning despite failures. This lets users continue using the network when components fail unexpectedly, sometimes in groups. (CSN-1.E.5)
  • Redundancy often costs extra resources but can provide fault tolerance. (CSN-1.E.6)
  • Multiple routing options increase Internet reliability and help it scale to more devices and people. (CSN-1.E.7)
必备知识
  • 互联网被设计为具有容错能力,并使用抽象(abstraction)来进行路由(routing)和数据传输。 (CSN-1.E.1)
  • 冗余(redundancy)通过增加组件来减轻故障的影响。连接的设备之间有多条路径是网络冗余的一种形式。 (CSN-1.E.2, CSN-1.E.3)
  • 如果互联网中的设备或连接发生故障,后续数据会在有其他路线可用时改走其他路线。 (CSN-1.E.4)
  • 容错系统在发生故障时仍能继续运行。这使用户在组件意外发生故障,有时甚至成组发生故障时,仍能使用网络。 (CSN-1.E.5)
  • 冗余通常需要额外资源,但可以提供容错能力。 (CSN-1.E.6)
  • 多种路由选择提高了互联网的可靠性,也帮助互联网扩展以支持更多设备和用户。 (CSN-1.E.7)

Routes, failures, and trade-offs

路线、故障与权衡

Routing abstractions help the Internet direct data without requiring users to manage each connection. If one route fails, another route can allow communication to continue. Extra connections require resources, so redundancy has a cost as well as a benefit.

路由抽象帮助互联网引导数据传输,无须用户管理每一条连接。如果一条路线发生故障,另一条路线可以让通信继续。额外连接需要资源,因此冗余既有成本,也有好处。

Exam pattern: trace the available paths after the stated failure. If every path between the devices uses the failed component, those devices cannot communicate through that network. Do not assume that an alternate path exists.

考试常见题型:在指定故障发生后,追踪仍可用的路径。如果两台设备之间的所有路径都经过发生故障的组件,它们就无法通过该网络通信。不要假设一定存在备用路径。

Worked Example: Testing alternate paths例题:检查备用路径

A network has connections A–B, B–D, A–C, C–D, and D–E. Can A still reach E if A–B fails? What if D–E fails instead?

一个网络有连接 A–B、B–D、A–C、C–D 和 D–E。如果 A–B 发生故障,A 还能到达 E 吗?如果换成 D–E 发生故障呢?

  1. Before a failure, A can reach D through either B or C, then reach E through D–E.
  2. If A–B fails, A can still reach E along A–C–D–E. The alternate path provides fault tolerance for that failure.
  3. If D–E fails instead, neither route to D can reach E. Every path from A to E uses D–E.
  4. Answer: A can reach E after A–B fails, but not after D–E fails. D–E is a vulnerability in this network.
  1. 故障发生前,A 可以经 B 或 C 到达 D,再通过 D–E 到达 E。
  2. 如果 A–B 发生故障,A 仍可沿 A–C–D–E 到达 E。备用路径使网络能够容忍这一故障。
  3. 如果换成 D–E 发生故障,两条到达 D 的路线都无法再通向 E。因为 A 到 E 的每条路径都经过 D–E。
  4. 答案:A–B 故障后,A 仍可到达 E;D–E 故障后则不能。D–E 是该网络中的一个薄弱点。
Exam trap The wrong answer is “any extra path makes the whole network immune to failure.” An alternate path helps only if it avoids the failed component and still connects the required devices.
考试陷阱 错误答案是“只要有额外路径,整个网络就不会因故障而中断”。备用路径只有在避开发生故障的组件,并且仍能连接所需设备时才有帮助。
Going deeper Failures can occur in groups. In the example, losing both A–B and A–C isolates A even though either connection alone has an alternative. Evaluate the specific failures and remaining paths, not just the number of connections.
深入理解 故障可能成组发生。在例题中,即使 A–B 和 A–C 各自都有替代路线,两者同时失效仍会使 A 与网络隔离。要分析具体发生的故障和剩余路径,而不只是数连接的数量。

Parallel and Distributed Computing

并行与分布式计算

Must know
  • Sequential computing performs operations one at a time in order. Parallel computing breaks a program into smaller sequential operations, some performed simultaneously. Distributed computing uses multiple devices to run a program. (CSN-2.A.1, CSN-2.A.2, CSN-2.A.3)
  • Compare efficiency by the time solutions take for the same task. Sequential time is the sum of all steps; parallel time is the time of the sequential portions plus the longest simultaneous task. (CSN-2.A.4, CSN-2.A.5, CSN-2.A.6)
  • Speedup equals sequential time divided by parallel time. (CSN-2.A.7)
  • Parallel solutions have sequential and parallel portions and can scale more effectively than sequential solutions. The sequential portion limits the benefit of adding more parallelism. (CSN-2.B.1, CSN-2.B.2, CSN-2.B.5)
  • Distributed computing can solve problems too demanding for one computer in processing time or storage, and can solve much larger problems faster. (CSN-2.B.3, CSN-2.B.4)
必备知识
  • 顺序计算(sequential computing)按顺序一次执行一个操作。并行计算(parallel computing)将程序分成较小的顺序操作,其中一些同时执行。分布式计算(distributed computing)使用多个设备运行程序。(CSN-2.A.1, CSN-2.A.2, CSN-2.A.3)
  • 比较完成同一任务所需的时间,可以比较解法的效率。顺序时间是所有步骤时间之和;并行时间是顺序部分的时间加上同时执行的任务中最长的时间。(CSN-2.A.4, CSN-2.A.5, CSN-2.A.6)
  • 加速比(speedup)等于顺序时间除以并行时间。(CSN-2.A.7)
  • 并行解法包含顺序部分和并行部分,通常比顺序解法更容易有效扩展。顺序部分限制了增加并行度带来的收益。(CSN-2.B.1, CSN-2.B.2, CSN-2.B.5)
  • 分布式计算可以解决单台计算机因处理时间或存储需求而无法解决的问题,也可以更快地解决规模大得多的问题。(CSN-2.B.3, CSN-2.B.4)

Compare the models

比较计算模型

A sequential solution completes each operation before the next. A parallel solution can run independent operations at the same time, while each smaller operation is itself sequential. A distributed solution uses multiple devices; using multiple devices and performing operations simultaneously describe different aspects of a solution.

顺序解法在完成一个操作后才执行下一个操作。并行解法可以同时运行相互独立的操作,而每个较小操作本身仍按顺序执行。分布式解法使用多个设备;使用多个设备与同时执行操作描述的是解法的不同方面。

To compare solutions, use the time each takes to complete the same task. For a parallel stage in which tasks start together, the stage finishes when its longest task finishes. Add that time to the time for the sequential stages.

比较解法时,要看各解法完成同一任务所需的时间。在任务同时开始的并行阶段,最长的任务完成时,该阶段才结束。将这段时间与各顺序阶段的时间相加。

Worked Example: Compare running times例题:比较运行时间

A task requires 2 seconds of preparation, three independent operations taking 4, 6, and 8 seconds, and 2 seconds to finish. A sequential solution runs every operation one at a time. A parallel solution runs the three independent operations simultaneously after preparation, then finishes. What are the times and the speedup?

一项任务需要 2 秒准备,接着完成三个相互独立的操作,分别需要 4、6、8 秒,最后需要 2 秒收尾。顺序解法一次执行一个操作。并行解法在准备之后同时执行三个独立操作,然后收尾。两种解法分别需要多少时间,加速比是多少?

  1. Sequential time: 2 + 4 + 6 + 8 + 2 = 22 seconds.
  2. The parallel stage takes 8 seconds, because the solution must wait for its longest operation.
  3. Parallel time: 2 + 8 + 2 = 12 seconds. Speedup: 22 / 12 = 11 / 6, or about 1.83.
  4. Answer: The parallel solution takes 12 seconds instead of 22 seconds and is about 1.83 times as fast for this task.
  1. 顺序时间:2 + 4 + 6 + 8 + 2 = 22 秒。
  2. 并行阶段需要 8 秒,因为解法必须等待最长的操作完成。
  3. 并行时间:2 + 8 + 2 = 12 秒。加速比:22 / 12 = 11 / 6,约为 1.83。
  4. 答案:并行解法需要 12 秒,而顺序解法需要 22 秒。对这项任务而言,前者的速度约为后者的 1.83 倍。
Exam trap Adding 4, 6, and 8 for the simultaneous stage gives the wrong parallel time: those operations overlap. Also, do not divide parallel time by sequential time for speedup. The order is sequential time divided by parallel time.
考试陷阱 把同时执行阶段的 4、6、8 秒相加,会得到错误的并行时间:这些操作的执行时间相互重叠。另外,计算加速比时不要用并行时间除以顺序时间,正确顺序是顺序时间除以并行时间。
Going deeper In the example, preparation and finishing still take 4 seconds in total. Even if the parallel stage could be reduced, those sequential steps would remain. Thus, increasing parallelism eventually stops meaningfully improving efficiency. For much larger problems, distributing work across devices can also address processing-time or storage needs that one computer cannot meet.
深入理解 在例题中,准备和收尾总共仍需 4 秒。即使并行阶段的时间可以缩短,这些顺序步骤仍然存在。因此,不断提高并行度最终会不再显著提高效率。对于规模大得多的问题,将工作分配给多个设备,也可以应对单台计算机无法满足的处理时间或存储需求。

Unit 4 MCQ Patterns That Show Up Every Year

单元 4 每年都会出现的选择题套路

Computer Systems and Networks accounts for 11–15% of the multiple-choice exam. Expect network scenarios, questions about reliability, and comparisons of computing time or speedup.

计算机系统与网络(Computer Systems and Networks)占选择题考试的 11–15%。题目可能涉及网络场景、可靠性,以及计算时间或加速比的比较。

Pattern 1: Trace packets and protocols Look for a message split across a network. Packets carry data and routing or reassembly metadata; they can take different routes and arrive out of order or not at all. Open protocols let devices follow shared rules. (See Topic 4.1.)
套路 1:分析数据包与协议 看到消息被拆分并通过网络发送时,注意数据包(packet)包含数据以及用于路由或重组的元数据。数据包可能走不同路径,乱序到达或根本未到达。开放协议(open protocol)让设备遵循共同规则。(参见 Topic 4.1。)
Pattern 2: Separate the Internet from the Web When a question mentions websites or HTTP, distinguish the Web from the network it uses. The Internet connects networks; the Web is a system of linked pages, programs, and files. (See Topic 4.1.)
套路 2:区分互联网与万维网 题目提到网站或 HTTP 时,要区分万维网(World Wide Web)与它所使用的网络。互联网(Internet)连接多个网络;万维网是由相互链接的页面、程序和文件组成的系统。(参见 Topic 4.1。)
Pattern 3: Find redundant paths and weak points For a network diagram, test whether an alternate path remains after the stated failure. Redundancy improves fault tolerance but requires extra resources, and a shared component can still be a single point of failure. (See Topic 4.2.)
套路 3:寻找冗余路径与薄弱点 面对网络图,检查指定故障发生后是否仍有替代路径。冗余(redundancy)能提高容错性(fault tolerance),但需要额外资源;共用组件仍可能成为单点故障。(参见 Topic 4.2。)
Pattern 4: Compare computing times Add all task times for a sequential solution. For tasks that run simultaneously, add the longest parallel task to the sequential portions; speedup is sequential time divided by parallel time. More parallel resources cannot remove the sequential portion. (See Topic 4.3.)
套路 4:比较计算时间 顺序计算时,将所有任务时间相加。对于同时运行的任务,将最长的并行任务时间与顺序部分时间相加;加速比(speedup)等于顺序时间除以并行时间。增加并行资源不能消除顺序部分。(参见 Topic 4.3。)

Flashcards, Click to Flip

闪卡(点击翻面)

How do a computing device, computing system, and computer network differ?计算设备、计算系统和计算机网络有何区别?
A device is a physical artifact that can run a program. A system is devices and programs working toward a common purpose. A network is interconnected devices that can send or receive data.计算设备(computing device)是能运行程序的实体。计算系统(computing system)是为共同目标协作的设备和程序。计算机网络(computer network)是能够发送或接收数据的互连设备集合。
What are a network path and routing?什么是网络路径和路由?
A path is a sequence of directly connected devices from sender to receiver. Routing finds such a path.路径(path)是从发送方到接收方的一系列直接相连的设备。路由(routing)是寻找此类路径的过程。
What does bandwidth measure?带宽衡量什么?
The maximum data that can be sent in a fixed time, usually measured in bits per second.带宽(bandwidth)衡量固定时间内最多能发送的数据量,通常以比特每秒为单位。
What is the Internet, and why do open protocols help it grow?互联网是什么?开放协议为何有助于它扩展?
The Internet is a network of interconnected networks. Open protocols provide shared rules that make connecting additional devices easier.互联网(Internet)是由多个互连网络组成的网络。开放协议(open protocol)提供共同规则,使接入更多设备更容易。
What is in a packet, and must packets arrive in order?数据包包含什么?数据包必须按顺序到达吗?
A packet contains a chunk of data and metadata for routing and reassembly. Packets can arrive out of order or not at all.数据包(packet)包含一块数据,以及用于路由和重组的元数据(metadata)。数据包可能乱序到达,也可能未到达。
How are the Web and the Internet related?万维网与互联网有什么关系?
The Web is a system of linked pages, programs, and files that uses the Internet. HTTP is a Web protocol.万维网(World Wide Web)是使用互联网、由相互链接的页面、程序和文件组成的系统。HTTP 是万维网使用的协议。
What are fault tolerance and redundancy?什么是容错性和冗余?
Fault tolerance is the ability to keep functioning despite failures. Redundancy adds components that can help mitigate failures.容错性(fault tolerance)是系统在发生故障时仍能继续运行的能力。冗余(redundancy)是增加组件,以帮助减轻故障的影响。
How can multiple network paths improve reliability?多条网络路径如何提高可靠性?
If one connection fails, data can use another path when one is available. Extra paths require resources and do not eliminate every possible failure.一条连接发生故障时,如果有其他路径,数据可以改走该路径。额外路径需要资源,也不能消除所有可能的故障。
How do sequential, parallel, and distributed computing differ?顺序计算、并行计算和分布式计算有何区别?
Sequential computing performs operations one at a time. Parallel computing performs some operations simultaneously. Distributed computing uses multiple devices to run a program.顺序计算(sequential computing)每次执行一个操作。并行计算(parallel computing)同时执行某些操作。分布式计算(distributed computing)使用多台设备运行程序。
How do you calculate time for simultaneous parallel tasks?如何计算含同时运行的并行任务的总时间?
Add the time of the sequential portions to the time of the longest simultaneous parallel task.将顺序部分的时间与同时运行的并行任务中最长的时间相加。
How is parallel speedup calculated?如何计算并行计算的加速比?
Divide the sequential solution's time by the parallel solution's time for the same task.加速比(speedup)等于完成同一任务的顺序计算时间除以并行计算时间。
What are a benefit and a limit of parallel or distributed computing?并行或分布式计算有何优势和限制?
Multiple devices can handle large processing or storage needs. In a parallel solution, the sequential portion limits further speedup.多台设备可以应对大量处理或存储需求。在并行方案中,顺序部分会限制进一步提速。

Unit 4, Practice Quiz

单元 4:练习小测

1. Which statement about packets sent over the Internet is true?1. 关于通过互联网发送的数据包(packet),哪项说法正确?
Packets contain data and metadata, and may arrive out of order.数据包包含数据和元数据,可能乱序到达。
Every packet must follow the same route and arrive in order.所有数据包必须走相同路径并按顺序到达。
Packets contain only routing information, not message data.数据包只包含路由信息,不包含消息数据。
Packets cannot be lost once they enter the Internet.数据包进入互联网后不可能丢失。
Correct! Metadata supports routing and reassembly, and packets may arrive out of order.正确!元数据有助于路由和重组,数据包可能乱序到达。
Packets carry both data and metadata. Routes and arrival order are not guaranteed, and packets may be lost.数据包同时包含数据和元数据。路径和到达顺序都不受保证,数据包也可能丢失。
2. Which statement correctly describes the Internet and the World Wide Web?2. 哪项正确描述了互联网(Internet)和万维网(World Wide Web)?
The Internet is a collection of web pages, while the Web connects physical networks.互联网是网页的集合,而万维网连接物理网络。
The Web is a system of linked resources that uses the Internet.万维网是使用互联网的相互链接的资源系统。
The Internet and the Web are two names for the same protocol.互联网和万维网是同一种协议的两个名称。
The Internet can be accessed only through HTTP.互联网只能通过 HTTP 访问。
Correct! The Web uses the Internet, and HTTP is a protocol used by the Web.正确!万维网使用互联网,HTTP 是万维网使用的协议。
The Internet connects networks. The Web is a system of linked pages, programs, and files that runs using the Internet.互联网连接多个网络。万维网是利用互联网运行的系统,包含相互链接的页面、程序和文件。
3. A network has these two-way connections: A–B, B–D, A–C, C–D, and D–E. Which single connection failure disconnects A from E?3. 某网络有以下双向连接:A–B、B–D、A–C、C–D 和 D–E。哪一条连接单独发生故障会使 A 与 E 断开?
A–B
B–D
C–D
D–E
Correct! Every path from A to E uses D–E, so its failure disconnects E.正确!从 A 到 E 的每条路径都经过 D–E,因此该连接故障会使 E 断开。
A can reach D through either B or C, but both routes depend on D–E to reach E. That shared connection is a single point of failure.A 可以通过 B 或 C 到达 D,但两条路径都依赖 D–E 才能到达 E。该共用连接是单点故障(single point of failure)。
4. A school adds a second independent network connection between two buildings. What is the most likely tradeoff?4. 一所学校在两栋楼之间增加了第二条独立的网络连接。最可能的权衡是什么?
Greater fault tolerance at the cost of additional resources以额外资源为代价,提高容错性
Guaranteed prevention of every network failure without extra resources无需额外资源,就能保证防止所有网络故障
Less reliability because data can never use an alternate path可靠性降低,因为数据永远不能使用替代路径
Elimination of the need for routing不再需要路由
Correct! An independent path can help the network keep working after a connection fails, but it costs resources.正确!独立路径可以帮助网络在一条连接故障后继续运行,但需要资源。
Redundancy can provide an alternate path, not a guarantee against every failure. Adding and maintaining a connection requires resources.冗余(redundancy)可以提供替代路径,但不能保证防止所有故障。增加和维护连接需要资源。
5. A task has a 4-second setup, three independent jobs taking 12, 8, and 4 seconds, and a 4-second finish. The jobs run one at a time in the sequential solution and all at once in the parallel solution. What is the parallel speedup?5. 一项任务包括 4 秒的准备、三个分别耗时 12、8、4 秒的独立作业,以及 4 秒的收尾。顺序方案逐个运行作业,并行方案同时运行所有作业。并行加速比(speedup)是多少?
1.2
1.6
2
3.2
Correct! Sequential time is 32 seconds; parallel time is 4 + 12 + 4 = 20 seconds. Speedup is 32 / 20 = 1.6.正确!顺序时间为 32 秒;并行时间为 4 + 12 + 4 = 20 秒。加速比为 32 / 20 = 1.6。
Include setup and finish in both solutions. In the parallel solution, the simultaneous jobs take as long as the longest job, 12 seconds. Divide sequential time by parallel time.两个方案都要计入准备和收尾时间。并行方案中,同时运行的作业耗时等于最长作业的 12 秒。用顺序时间除以并行时间。
6. A large data-processing task is divided among several computers, but part of the task must still run sequentially. Which statement is most accurate?6. 一项大型数据处理任务被分配到多台计算机,但其中一部分仍必须顺序执行。哪项说法最准确?
Adding devices always reduces total time in exact proportion to the number added.增加设备总能使总时间按增加的设备数量成比例减少。
Using multiple devices means no part of the task can run sequentially.使用多台设备意味着任务的任何部分都不能顺序运行。
Multiple devices can help meet processing or storage needs, but the sequential portion limits speedup.多台设备有助于满足处理或存储需求,但顺序部分会限制提速。
Distributed computing can help only when the data fits on one computer.只有当数据能放在一台计算机上时,分布式计算才有帮助。
Correct! Distributed resources can handle larger demands, while the sequential portion limits gains from parallelism.正确!分布式资源可以应对更大的需求,而顺序部分会限制并行带来的提速。
Distributed computing uses multiple devices and can address large processing or storage needs. A sequential portion still takes time no matter how many parallel resources are added.分布式计算(distributed computing)使用多台设备,可以应对大量处理或存储需求。无论增加多少并行资源,顺序部分仍需要时间。

AP-Style Practice Problems

AP 风格练习题

Try the 15-question practice set to test your understanding of networks, fault tolerance, and computing efficiency.

完成 15 道题的练习,检验你对网络、容错性和计算效率的理解。

Practice Problems →练习题 →

鼎睿学苑 · Dingrui Scholars

AP Computer Science Principles, Unit 4: Computer Systems and Networks · 2026 Edition

AP 计算机科学原理,单元 4:计算机系统与网络 · 2026 版