Exercises — Multi-agent collaboration
Before we begin, let us fix every symbol we will actually use on this page, so nothing appears un-defined.
Level 1 — Recognition
Exercise 1.1 — Name the pattern
For each scenario, name which of the five patterns it is (Debate, Parallel+Aggregation, Sequential Pipeline, Manager-Worker, Peer-to-peer Negotiation).
(a) Three agents each independently write a function; a majority vote picks the answer. (b) Researcher → Coder → Tester, each feeding the next. (c) A boss agent splits "build an app" into subtasks and hands them out, re-planning as results return. (d) Two agents argue opposite sides and a third merges the winning points. (e) Traffic-light agents at neighbouring intersections settle timings among themselves with no central boss.
Recall Solution
(a) Parallel with Aggregation — same problem, independent solves, then a vote. (b) Sequential Pipeline — output of one is the input of the next. (c) Manager-Worker (Dynamic Coordination) — one delegates, others execute, plan adapts. (d) Debate / Adversarial — opposing positions, then synthesis. (e) Peer-to-peer Negotiation — direct talk, no central authority.
Exercise 1.2 — Single vs multi-agent
Which statement is the correct distinction between an ensemble model and a multi-agent system?
- Ensembles are faster.
- Ensembles combine predictions statistically; agents coordinate through explicit messages.
- They are the same thing.
Recall Solution
Statement 2. An ensemble (Ensemble-methods) averages/votes over model outputs with no communication between models. Agents exchange messages () and can change what they do based on what a peer said. Speed (statement 1) is not the defining line.
Level 2 — Application
Exercise 2.1 — Should you go multi-agent? (the cost inequality)
A task needs three capabilities (say search, code, test).
- A single agent that holds all three costs units.
- Splitting into three specialists costs , , .
- Messaging costs .
Compute and decide: is multi-agent cheaper?
Recall Solution
What we do: plug into . Compare: , so multi-agent is cheaper. Why it works here: the specialisation gain is , which comfortably exceeds the of communication overhead.

Read the figure: the tall grey bar on the left is the single agent (90). The three blue bars are the specialists; the orange bar is messaging. Their stacked total sits at the green dashed line (72), visibly below the grey bar. The picture makes the inequality "sum of blues + orange < grey" literal: multi-agent wins exactly when the blue+orange stack ends below the grey top.
Exercise 2.2 — Where messaging kills the deal
Same specialists (), but now the agents must chat a lot: . Is multi-agent still worth it?
Recall Solution
Now : multi-agent is worse. The specialisation gain is still , but it is eaten by of communication overhead (). This is exactly condition 3 in the parent note — "communication overhead must not dominate."
Exercise 2.3 — Latency of parallel work
Three readers work in parallel, taking , , minutes. After they finish, exchanging results costs minutes (the messaging-latency symbol defined in the symbols box). Doing all three sequentially would take minutes plus no extra messaging.
Compute parallel time and the speed-up factor.
Recall Solution
Parallel time uses : Why , not sum? In parallel everyone runs at once, so you wait only for the slowest one (the bottleneck), then pay a single messaging-latency cost .
What "speed-up" means and why it is a ratio. Speed-up asks: how many times faster is the new method than the old one? If the old (sequential) method takes and the new (parallel) method takes , then "how many parallel runs fit into one sequential run" is the quotient We divide (rather than subtract) because we want a scale factor independent of units: a speed-up means the same whether you measure in minutes or seconds, while a difference of "11 minutes" does not. Here: So the parallel team finishes in about of the sequential time.

Read the figure: the top row shows the three tasks laid end-to-end (sequential), reaching 24. The lower rows show the same three tasks stacked vertically — they overlap in time, so the clock only reaches the end of the longest (10), after which the red messaging block (3) runs. The horizontal distance to the end of the red block, 13, is the parallel wall-clock time.
Edge case — overlapping / streaming communication: the formula assumes messaging happens strictly after every agent finishes. Real systems often let agents stream partial results and message while still working. If messaging overlaps computation, the true time is closer to alone (the term is partly or fully hidden). So is an upper bound; streaming designs can beat it, and a slow synchronising barrier (everyone must wait for the last agent before any messaging) is what makes it tight.
Level 3 — Analysis
Exercise 3.1 — Error propagation in a pipeline
In a Sequential Pipeline , each agent independently forwards correct output with probability . A single corrupted output corrupts everything downstream.
What is the probability the final output is correct? Generalise to agents.
Recall Solution
What we do: the chain is correct only if every stage is correct. Stages are independent, so multiply: For : . What it means: even with 90%-reliable agents, a 3-stage pipeline is only reliable — reliability decays geometrically with pipeline length. This is the "error propagation" risk from the parent note, made quantitative.

Read the figure: each coloured curve is for a fixed per-stage reliability , plotted against pipeline length . Notice all curves fall, and the lower curves crash faster — doubling the pipeline length roughly squares the failure. The green dot marks our answer . The takeaway you can see: long pipelines are fragile, so keep them short or harden the weakest stage.
Exercise 3.2 — Majority vote beats one agent
Three independent agents each answer correctly with probability . The system takes a majority vote (correct if at least 2 of 3 are correct). Is the vote more reliable than one agent?
Recall Solution
What we do: majority-of-3 is correct if exactly 2 or all 3 are correct. With : Compare: — the vote is better. This is the Parallel+Aggregation robustness gain, and it's exactly the same maths as Ensemble-methods (Condorcet's jury theorem): voting helps when agents are better than a coin-flip and reasonably independent.
Level 4 — Synthesis
Exercise 4.1 — Design a hybrid architecture
You must build a system that (a) summarises 6 long papers and (b) must produce a high-confidence final claim. You have a budget: parallelism is cheap, but you fear a single reader hallucinating. Design a pattern combining two of the five patterns and justify it.
Recall Solution
A defensible design: Parallel + Aggregation nested inside a Sequential Pipeline, in three numbered stages.
- Stage 1 — Searcher: finds the 6 papers.
- Stage 2 — Paired Readers (parallel + agreement): for each paper, run 2 Reader agents in parallel and keep their summary only if they agree (a mini agreement vote → catches hallucination).
- Stage 3 — Synthesizer: merges the 6 agreed summaries into the final claim.
Why this combination: the parallel-agreement step in Stage 2 buys reliability (Exercise 3.2 logic) exactly where hallucination is dangerous; the pipeline gives clean stage separation and specialisation. This mirrors the parent's Worked Example 2 but hardened against single-reader bias. Related idea: a Debate stage could replace agreement in Stage 2 if you want the readers to argue rather than just vote — see Game-theory for why adversarial pressure surfaces weak claims.
Exercise 4.2 — Break-even messaging budget
A task's specialists cost and the single agent costs . Derive the maximum message cost for which multi-agent still wins, in terms of . Then evaluate for .
Recall Solution
What we do: start from the win condition and solve for the messaging budget. Why this is useful: is exactly the specialisation gain defined at the top of the page — the effort you saved by splitting. You are allowed to spend up to that saving on communication and no more. For : , so . (Matches Ex 2.1 where won, and Ex 2.2 where lost.)
Level 5 — Mastery
Exercise 5.1 — Manager utility assignment
A Manager must assign one task to the best worker. Utilities are , , . The rule is . Who gets it, and why is (not ) the right operator?
Recall Solution
over the utilities is ; but we don't want the value, we want the worker who achieves it. That is — "the argument (agent) that maximises." So is assigned. Mastery point: answers "how good is the best?"; answers "who is the best?". The assignment function needs the who.
Exercise 5.2 — Full-stack reasoning: end-to-end reliability + cost
A 4-stage Sequential Pipeline runs Planner → Coder → Tester → Reviewer. Each of the four base stages succeeds independently with probability .
To make the system more reliable you replace the single Coder with 3 parallel Coder agents plus a majority vote (Pattern 2). Each of those three coders succeeds independently with probability , and the voted Coder stage is "correct" if at least 2 of the 3 are correct.
Costs: every base stage costs units; each extra coder (the 2 added beyond the original) costs units; the messaging needed to run the vote costs units.
Compute: (a) the success probability of the new voted-Coder stage; (b) the whole-pipeline success probability (Planner, voted-Coder, Tester, Reviewer, all independent); (c) the total cost of the upgraded system.
Recall Solution
(a) Voted-Coder stage. Same majority-of-3 form as Exercise 3.2, with :
(b) Whole pipeline. The four stages are independent, so multiply their success probabilities — Planner , voted-Coder , Tester , Reviewer : Compute step by step: ; then ; then .
(c) Total cost. Four base stages ; two extra coders ; vote messaging :
Mastery synthesis: we traded 25 extra cost units to lift the Coder stage from to , nudging end-to-end reliability up. Whether that trade is worth it depends on the value of a correct output — exactly the cost/reliability reasoning that governs all of multi-agent design.
Recall Quick self-test
Multi-agent beats single when messaging cost is below the... ::: specialisation gain, . Parallel wall-clock time uses which operator over agent times? ::: (plus one messaging-latency cost , as an upper bound). Pipeline reliability with stages of success ? ::: (geometric decay). The operator that returns who is best, not how good? ::: .
Parent: Multi-agent collaboration · Hinglish: 6.2.06 Multi-agent collaboration (Hinglish) · Prompting these agents: 6.3.01-Prompt-engineering-for-agents