Problem Set: Counting and Permutations
1. API Endpoints
A REST API has 12 GET endpoints and 8 POST endpoints. A monitoring tool selects one endpoint to probe.
(a) How many endpoints could be selected?
(b) The tool now probes one GET endpoint and one POST endpoint per cycle. How many distinct probe pairs are possible?
2. Playlist Shuffle
You have 8 songs in a playlist. Your music app plays them in a random order (no repeats).
(a) How many possible play orders are there?
(b) What if you only have time for 3 songs—how many possible 3-song sequences?
3. Color Codes
A design system uses hex color codes of the form #RRGGBB, where each of R, G, B is a hex digit (0–9, A–F).
(a) How many distinct color codes are possible?
(b) How many codes use only digits (no letters)?
(c) How many codes use at least one letter?
4. Anagram Count
How many distinct arrangements (anagrams) can be formed from the letters of:
(a) GRAPH (b) COFFEE (c) BANANA
5. Meeting Scheduling
A team of 10 people must choose a subcommittee of 3 to attend a conference. The subcommittee then designates one member as spokesperson.
How many ways can the team choose the subcommittee and its spokesperson?
6. Log File Entries
A log analyzer flags entries that start with ERROR or end with TIMEOUT. In a batch of 5000 entries:
- 420 start with
ERROR - 315 end with
TIMEOUT - 87 do both
How many entries does the analyzer flag?
7. Server Rack
A data center has 20 server slots in a rack and 25 servers to assign.
Prove that at least two servers must share a slot (be co-located).
8. Seating Arrangement
Six students sit around a circular table for a group project.
(a) How many distinct seating arrangements are there? (Rotations of the same arrangement are considered identical.)
(b) What if two particular students (Alice and Bob) refuse to sit next to each other?
9. Feature Flags
A software product has 7 independent feature flags, each either ON or OFF.
(a) How many distinct configurations are possible?
(b) How many configurations have exactly 3 flags ON?
(c) How many have at least 1 flag ON?
10. The Birthday Puzzle (variant)
In a class of 40 students, each student picks a favorite day of the week (Mon–Sun).
(a) What is the minimum number of students guaranteed to share the same favorite day?
(b) If there were 50 students, what would the answer be?