Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTENT_SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ license: CC-BY-SA-4.0

| Field | Required | Type | Notes |
|-------|----------|------|-------|
| `id` | yes | string | Unique. Must equal the filename without `.md`. Format: `<section>-<topic>-<subtopic>-NNNN`. |
| `id` | yes | string | Unique. Must equal the filename without `.md`. Format: `<section>-<topic>-<subtopic>-NNNN`. `NNNN` is a 4-digit sequence number **unique within the subtopic** — pick the next unused number for that exact subtopic (a brand-new subtopic starts at `0001`). Per-subtopic numbering keeps parallel branches from colliding; see [CONTRIBUTING.md](CONTRIBUTING.md#file-naming--location). |
| `section` | yes | enum | `quant` \| `verbal` \| `data-insights`. |
| `topic` | yes | string | A topic slug from [`curriculum.md`](curriculum.md). |
| `subtopic` | yes | string | A subtopic slug from [`curriculum.md`](curriculum.md). |
Expand Down
38 changes: 37 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,19 @@ content/lessons/<section>/<topic>-<subtopic>.md

- `<section>` is `quant`, `verbal`, or `data-insights`.
- `<topic>` / `<subtopic>` must be slugs that exist in [`curriculum.md`](curriculum.md).
- `NNNN` is a zero-padded sequence number, unique within the section (pick the next unused one).
- `NNNN` is a zero-padded sequence number, **unique within the subtopic** — pick the next unused
number *for that exact subtopic*. A brand-new subtopic starts at `0001`; a subtopic that already
has `...-0001` and `...-0002` continues at `0003`.

Example: `content/questions/quant/quant-algebra-linear-equations-0001.md`

> **Why per-subtopic and not per-section?** Contributors (and automated runs) work on separate
> branches that haven't merged yet. A single section-wide counter makes every open branch grab the
> same "next" number, so two PRs collide the moment they touch the same section. Numbering *within
> the subtopic* means two PRs only ever collide if they target the **same subtopic** — which the
> coordination rules below already tell you to avoid. Existing files are already unique within their
> subtopic, so nothing needs renaming.

---

## The review workflow
Expand Down Expand Up @@ -119,6 +128,33 @@ If unsure, tag `medium` and note your uncertainty in the PR — reviewers can ad

---

## Automated & daily-run contributions

Some content is added by automated "daily run" agents. Because every run works on its **own
branch** and those branches are **not merged between runs**, a run that only looks at `main` is
blind to what other in-flight runs have already produced — which historically led to several PRs
re-seeding the same subtopic and colliding on sequence numbers. If you run one of these agents (or
review their output), follow this protocol so parallel work doesn't duplicate:

1. **Check what's already in flight, not just `main`.** Before choosing a subtopic, list the
repository's **open pull requests** and read their titles/branches. Treat any subtopic that an
open PR already covers as *taken* — do not seed it again. (`main` alone is not the current state
of the world; most content lives in unmerged branches.)
2. **One subtopic per run, and prefer genuine gaps.** Pick a subtopic that is uncovered on `main`
**and** not claimed by any open PR. Run `node scripts/coverage.mjs` to see per-subtopic counts
and gaps on the current checkout, then cross-check against open PRs for the in-flight ones.
3. **Number within the subtopic.** Follow the [file-naming rule](#file-naming--location):
`NNNN` is the next unused number *for that subtopic*. Since rule 2 keeps runs on distinct
subtopics, per-subtopic numbering makes filename collisions between branches impossible without
having to inspect other branches' numbers.
4. **Keep each run on its own branch and its own PR.** Don't stack a new run's content onto another
run's branch, and don't reuse a merged PR — start fresh from the latest default branch.
5. **Stop at "open PR."** Opening the draft PR is the end of a run's job. Don't re-seed a subtopic
that any open PR (including your own from a previous run) already handles.

Reviewers/maintainers: merging or closing the open backlog promptly is what makes rules 1–2
reliable — the longer PRs sit unmerged, the more the "check open PRs" step has to compensate for.

## Code of conduct

Participation is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). Be kind; assume good
Expand Down
88 changes: 88 additions & 0 deletions content/lessons/quant/quant-counting-probability-combinatorics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
id: quant-counting-probability-combinatorics
section: quant
topic: counting-probability
subtopic: combinatorics
title: "Combinatorics: Counting Without Listing"
tags: [combinatorics, counting, permutations, combinations, factorials]
author: openmat
reviewers: []
status: in-review
original: true
license: CC-BY-SA-4.0
---

## Overview

Combinatorics is the art of counting arrangements and selections without writing them all out.
Almost every Focus counting problem reduces to two questions: **do I multiply or add?** and **does
order matter?** Get those two right and the formulas fall into place.

## Core concepts

**Fundamental counting principle (multiply for "and").** If one choice can be made \(m\) ways and
an independent next choice \(n\) ways, the two together can be made \(m \times n\) ways. Multiply
stages that happen *together*; **add** only mutually exclusive *cases* ("or").

**Factorial — arranging distinct things in a row.** \(n\) distinct items in a row:

\[n! = n \times (n-1) \times \cdots \times 2 \times 1\]

By convention \(0! = 1\).

**Permutations — order matters.** Choosing and arranging \(k\) of \(n\) distinct items:

\[P(n, k) = \frac{n!}{(n-k)!} = n(n-1)\cdots(n-k+1)\]

**Combinations — order does not matter.** Choosing \(k\) of \(n\) with no regard to order:

\[C(n, k) = \binom{n}{k} = \frac{n!}{k!\,(n-k)!} = \frac{P(n,k)}{k!}\]

A combination is a permutation with the \(k!\) internal orderings divided out. "Committee,"
"group," "selection," "handshake" → combination. "Ranking," "arrangement," "line," "code" →
permutation.

**Identical items.** Arranging \(n\) items where some repeat (\(a\) alike, \(b\) alike, …):

\[\frac{n!}{a!\,b!\,\cdots}\]

Divide out the interchangeable duplicates. (This is why `LEVEL` has \(5!/(2!\,2!)\) arrangements,
not \(5!\).)

**Restrictions — two standard moves.**
- *Must be together:* glue the group into one block, arrange the blocks, then multiply by the
internal arrangements of the block.
- *Must be apart (no two adjacent):* seat the unrestricted items first, then drop the restricted
ones into the **gaps** between and around them.

## Worked examples

**Multiply.** A menu has 4 breads, 3 fillings, 2 spreads; one of each → \(4\times 3\times 2 = 24\)
sandwiches.

**Combination vs. permutation.** From 8 people, a *committee* of 3 is \(C(8,3) = 56\); a *ranked*
top-3 is \(P(8,3) = 336\). The ratio is \(3! = 6\), the orderings a committee ignores.

**Together.** Six people in a row with two specific people adjacent: treat the pair as one block →
\(5!\) arrangements of the 5 units, times \(2!\) for the pair's order \(= 240\).

## Common traps

- **Adding when you should multiply.** Independent successive choices multiply; \(4+3+2\) is wrong
for the sandwich count.
- **Permutation vs. combination.** Using \(P(n,k)\) for an unordered selection over-counts by
\(k!\); using \(C(n,k)\) for an ordered one under-counts.
- **Forgetting to divide out identical items.** \(5!\) over-counts `LEVEL` because swapping the two
L's (or two E's) changes nothing.
- **"At least one" head-on.** Counting cases one by one invites double-counting. Use the
complement: (total) − (none) is almost always cleaner.
- **Restriction, then forget the internal order.** After gluing a block, remember to multiply by
the block's own arrangements.

## Key takeaways

- Decide multiply-vs-add and order-matters-vs-not *before* reaching for a formula.
- \(C(n,k) = P(n,k)/k!\) — a combination is a permutation with the orderings removed.
- Identical items: divide \(n!\) by the factorial of each repeat count.
- "At least one" → subtract the complement from the total.
- Restrictions: glue for "together," use gaps for "apart."
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: quant-counting-probability-combinatorics-0001
section: quant
topic: counting-probability
subtopic: combinatorics
type: problem-solving
difficulty: easy
tags: [combinatorics, counting-principle]
choices:
A: "8"
B: "9"
C: "12"
D: "24"
E: "48"
answer: D
author: openmat
reviewers: []
status: in-review
original: true
license: CC-BY-SA-4.0
---

## Question

A café builds a sandwich by choosing exactly one of 4 breads, one of 3 cheeses, and one of 2
spreads. How many distinct sandwiches can be made?

## Explanation

The three choices are made **together** (one bread *and* one cheese *and* one spread), so by the
fundamental counting principle you **multiply**:

\[4 \times 3 \times 2 = 24\]

**Traps:**
- **B (9)** *adds* the options \((4 + 3 + 2)\) — addition is for mutually exclusive cases ("or"),
not for independent successive choices ("and").
- **C (12)** multiplies only bread and cheese \((4 \times 3)\), forgetting the spread.
- **A (8)** multiplies only bread and spread \((4 \times 2)\), forgetting the cheese.
- **E (48)** double-counts the spread \((4 \times 3 \times 2 \times 2)\).

## Hints

- Each independent choice made together multiplies the count — decide multiply vs. add first.
- Include every stage: bread × cheese × spread.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
id: quant-counting-probability-combinatorics-0002
section: quant
topic: counting-probability
subtopic: combinatorics
type: problem-solving
difficulty: easy
tags: [combinatorics, permutations, factorial]
choices:
A: "15"
B: "20"
C: "24"
D: "25"
E: "120"
answer: E
author: openmat
reviewers: []
status: in-review
original: true
license: CC-BY-SA-4.0
---

## Question

In how many different ways can 5 distinct books be arranged in a row on a shelf?

## Explanation

Arranging \(n\) distinct items in a row is \(n!\). With 5 books:

\[5! = 5 \times 4 \times 3 \times 2 \times 1 = 120\]

Think of it as filling positions left to right: 5 choices for the first slot, 4 for the next, then
3, 2, 1 — multiplied together.

**Traps:**
- **A (15)** *adds* \(5 + 4 + 3 + 2 + 1\) instead of multiplying.
- **B (20)** stops after two factors \((5 \times 4)\).
- **C (24)** is \(4!\) — arranging only 4 of the books.
- **D (25)** is \(5^2\), treating each slot as having all 5 books available (no removal after
placing one).

## Hints

- "Arrange all \(n\) distinct items in a row" is exactly \(n!\).
- Each book used up reduces the choices for the next slot: \(5 \times 4 \times 3 \times 2 \times 1\).
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: quant-counting-probability-combinatorics-0003
section: quant
topic: counting-probability
subtopic: combinatorics
type: problem-solving
difficulty: medium
tags: [combinatorics, combinations]
choices:
A: "24"
B: "56"
C: "112"
D: "168"
E: "336"
answer: B
author: openmat
reviewers: []
status: in-review
original: true
license: CC-BY-SA-4.0
---

## Question

A committee of 3 people is to be selected from a group of 8. How many different committees are
possible?

## Explanation

A committee is an **unordered** selection — the same three people form the same committee no matter
what order they're picked in — so this is a combination:

\[C(8,3) = \frac{8!}{3!\,5!} = \frac{8 \times 7 \times 6}{3 \times 2 \times 1} = \frac{336}{6} = 56\]

**Traps:**
- **E (336)** is \(P(8,3) = 8 \times 7 \times 6\) — treating order as mattering, so each committee is
counted \(3! = 6\) times.
- **C (112)** divides by 3 instead of \(3! = 6\) \((336/3)\).
- **D (168)** divides by \(2!\) instead of \(3!\) \((336/2)\).
- **A (24)** just computes \(8 \times 3\).

## Hints

- "Committee," "group," "selection" → order doesn't matter → combination.
- A combination is the permutation \(P(n,k)\) divided by \(k!\) to remove the internal orderings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
id: quant-counting-probability-combinatorics-0004
section: quant
topic: counting-probability
subtopic: combinatorics
type: problem-solving
difficulty: medium
tags: [combinatorics, permutations, identical-items]
choices:
A: "10"
B: "20"
C: "30"
D: "60"
E: "120"
answer: C
author: openmat
reviewers: []
status: in-review
original: true
license: CC-BY-SA-4.0
---

## Question

How many distinct arrangements can be made of the letters in the word LEVEL?

## Explanation

LEVEL has 5 letters, but they are not all distinct: **L** appears twice, **E** appears twice, and
**V** once. When items repeat, divide \(n!\) by the factorial of each repeat count:

\[\frac{5!}{2!\,2!} = \frac{120}{2 \times 2} = \frac{120}{4} = 30\]

The two L's are interchangeable (swapping them gives the same word), and likewise the two E's, so
each distinct arrangement was counted \(2! \times 2! = 4\) times in the raw \(5!\).

**Traps:**
- **E (120)** is \(5!\) — treating all five letters as distinct.
- **D (60)** divides by only one \(2!\) \((120/2)\), correcting for the L's but not the E's (or vice
versa).
- **A (10)** over-divides, e.g. by an extra factor.
- **B (20)** divides by \(3!\) \((120/6)\), as if three letters repeated.

## Hints

- Repeated, interchangeable letters mean the plain \(5!\) over-counts.
- Divide \(5!\) by \(2!\) for the two L's **and** another \(2!\) for the two E's.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
id: quant-counting-probability-combinatorics-0005
section: quant
topic: counting-probability
subtopic: combinatorics
type: problem-solving
difficulty: medium
tags: [combinatorics, permutations, restrictions]
choices:
A: "120"
B: "240"
C: "360"
D: "480"
E: "720"
answer: B
author: openmat
reviewers: []
status: in-review
original: true
license: CC-BY-SA-4.0
---

## Question

Six friends are to be seated in a row of 6 chairs. If two particular friends insist on sitting
next to each other, how many seating arrangements are possible?

## Explanation

Use the "glue" method for a must-be-together restriction. Treat the two friends as a single block,
so you're now arranging **5 units** (the block plus the other 4 people):

\[5! = 120 \text{ ways to arrange the units}\]

The two friends inside the block can also swap seats, which is \(2! = 2\) arrangements:

\[120 \times 2 = 240\]

**Traps:**
- **E (720)** is \(6!\) — ignoring the restriction entirely.
- **A (120)** is \(5!\) — gluing the pair but forgetting they can be ordered two ways inside the
block.
- **C (360)** halves \(6!\) \((720/2)\), a common but incorrect fix.
- **D (480)** doubles the correct count, applying the internal \(\times 2\) one time too many.

## Hints

- "Must sit together" → glue the pair into one block and arrange the resulting units.
- Don't forget the pair can be ordered two ways inside their block.
Loading