AP CSP topic 4.3
Parallel and Distributed Computing
Sequential computing runs one step at a time, while parallel computing splits a task so several processors work at the same time. Distributed computing spreads work across many separate computers, which allows problems too big for one machine. Speedup is the sequential time divided by the parallel time. Adding processors helps only up to a point, because some steps must still happen in order and processors must coordinate.
Parallel and Distributed Computing vocabulary
- Sequential computing: Running operations one at a time, in order.
- Parallel computing: Breaking a task into parts that run at the same time on multiple processors.
- Distributed computing: Using many networked computers to work on one problem.
- Speedup: Sequential running time divided by parallel running time.
AP-style practice questions
Try each one, then open the answer. To save your progress, take this quiz in the interactive course.
A task has three steps that each take 30 seconds when done one after another (90 seconds total). With two processors, two of the steps can run at the same time, and the third must run afterward.
1. What is the parallel running time?
- (A) 30 seconds
- (B) 45 seconds
- (C) 60 seconds
- (D) 90 seconds
Show answer
(C) 60 seconds Two steps run together in 30 seconds, then the third takes 30 more: 60 seconds.
2. A task takes 120 seconds sequentially and 40 seconds in parallel. What is the speedup?
- (A) 3
- (B) 40
- (C) 80
- (D) 160
Show answer
(A) 3 Speedup = sequential time / parallel time = 120 / 40 = 3.
3. Which of the following is the best example of distributed computing?
- (A) A calculator adding two numbers
- (B) Thousands of volunteers' computers each analyzing part of a huge set of space telescope images
- (C) A student typing an essay
- (D) A phone playing one song
Show answer
(B) Thousands of volunteers' computers each analyzing part of a huge set of space telescope images Distributed computing spreads one large problem across many separate computers.
4. Why does adding more processors eventually stop making a parallel program faster?
- (A) Processors get tired
- (B) Some steps must still run in order, and processors spend time coordinating
- (C) More processors use more Wi-Fi
- (D) Parallel programs cannot use more than two processors
Show answer
(B) Some steps must still run in order, and processors spend time coordinating Sequential parts and overhead limit how much speedup is possible.