In the theory of communication, information is a choice: one message selected from a set of possible messages known in advance. This lesson measures that choice by counting yes-or-no questions, proves that k questions can single out one of at most 2ᵏ alternatives, and shows that the answers, written as 0s and 1s, form a binary code.
Messages chosen from a set
A weather station that sends the single word “rain” has told its receiver something only because it could have sent something else: “sun”, “cloud” or “snow”. If “rain” were the only word it ever sent, the receiver would learn nothing from it. Information theory starts from this observation. It was developed by Claude E. Shannon, whose paper “A Mathematical Theory of Communication”, published in the Bell System Technical Journal in 1948, founded the subject.[1]
A set of alternatives is a list of different possible messages, fixed before anything is sent and known to both the sender and the receiver. A message is the one alternative that is actually selected and sent. The information it carries is which of the alternatives it is.[4]
A communication system must therefore work for every alternative, because when it is designed nobody knows which one will actually be chosen.[5] The toss of a coin selects one of 2 alternatives, heads or tails; the roll of a die one of 6, the faces 1 to 6; a day of the week one of the 7 from Monday to Sunday; a capital letter one of the 26 from A to Z.
Information in this technical sense is not meaning, truth or importance. Shannon called the meaning of messages irrelevant to the engineering problem of communicating them.[6] How much information a selection carries depends only on how many alternatives there are and on how likely each of them is, not on what the alternatives are or what they mean.[7]
A sign shows the word OPEN at every hour of the day and night. How much information does a passer-by get from reading it?
- The set of alternatives the sign can show has a single member, OPEN.
- Before reading the sign, the passer-by already knows which alternative it shows: there is no other.
- Reading it rules out nothing, because nothing else was possible.
Answer: none. A message that could not have been different carries no information. Information needs at least two alternatives. (The same sign carries information if it can also show CLOSED.)
Yes-or-no questions
The amount of information in a selection can be measured by a game. The receiver asks questions that can only be answered yes or no, the sender answers truthfully, and the game ends when the receiver knows the message. Information theory studies the most efficient series of such questions for identifying an object from a class of objects,[9] and calls the game “twenty questions”.[10]
A yes-or-no question about the selected alternative divides the set of alternatives into two parts: the alternatives for which the answer would be yes, and those for which it would be no. The answer tells the receiver in which part the message lies. Any part can be asked about: the question is “Is the message in this part?”.[11]
Take eight alternatives, the numbers 0 to 7. The question “Is it at least 4?” splits them into 0 to 3 and 4 to 7. Whatever the answer, four numbers remain. A second question of the same kind leaves two, and a third leaves one. Three questions always find the number, as the figure shows.
A plan of questions says which question to ask first and, for every list of answers so far, which question to ask next: any question may depend on the answers to the questions before it.[12] A plan always singles out the message from a set of alternatives if, whichever alternative was selected, the answers leave exactly one alternative possible.
Let k be a whole number, k ≥ 0.
- Some plan of k yes-or-no questions always singles out the message from any set of at most 2ᵏ alternatives.
- No plan of k yes-or-no questions always singles out the message from a set of more than 2ᵏ alternatives.
(1) If k = 0, the set has at most 2⁰ = 1 alternative (Powers lesson 1.1), and the message is known without a question. Otherwise, split the set into two parts of at most 2ᵏ⁻¹ alternatives each; this is possible because 2ᵏ = 2ᵏ⁻¹ + 2ᵏ⁻¹. Ask whether the message is in the first part. Whatever the answer, at most 2ᵏ⁻¹ alternatives remain, and k − 1 questions are left. Repeat the step with k − 1, k − 2, and so on: after k questions at most 2⁰ = 1 alternative remains, and it is the message.
(2) If k = 0, no question is asked, so more than 2⁰ = 1 alternative would all remain possible. Let k ≥ 1, and take any plan of k questions that always singles out the message. If for some alternative it finds the message early, let it ask further questions until k have been asked: more answers cannot make a known message unknown. Each alternative now has its own list of k answers. Two different alternatives cannot have the same list: the plan would ask them the same first question, receive the same answer, ask the same second question, and so on, and in the end it could not tell them apart. Writing 1 for yes and 0 for no turns each list into a bit string of length k, and by the theorem “what k bits can name” of Number Bases lesson 1.2 there are exactly 2ᵏ such strings. If there were more than 2ᵏ alternatives, two of them would receive the same string, by the pigeonhole principle (Counting lesson 1.1):[13] a contradiction. So there are at most 2ᵏ alternatives.
Together, the two parts say that for k ≥ 1, 2ᵏ alternatives need exactly k questions: k are enough by part (1), and k − 1 are not, by part (2), because 2ᵏ is more than 2ᵏ⁻¹. Each further question doubles the number of alternatives that can be told apart.
A coin is hidden under one of the 16 squares of a board with 4 rows and 4 columns. How many yes-or-no questions always find it, and which?
- 16 = 2⁴, so by Theorem 1 four questions are enough and three are not (2³ = 8 < 16).
- “Is it in the top two rows?” leaves 8 squares, two rows of four.
- “Is it in the left two columns?” leaves 4 squares, a block of two by two.
- “Is it in the upper row of the block?” leaves 2 squares; “Is it the left one?” leaves 1.
Answer: 4 questions, each halving what remains. No plan of 3 questions can always find the coin.
How many equally possible alternatives can twenty yes-or-no questions always tell apart?
- By Theorem 1, the answer is 2²⁰, a product of twenty factors 2.
- Group the factors into two groups of ten: 2²⁰ = 2¹⁰ × 2¹⁰. Powers lesson 1.1 computed 2¹⁰ = 1,024, so 2²⁰ = 1,024 × 1,024.
- 1,024 × 1,024 = 1,024 × 1,000 + 1,024 × 24 = 1,024,000 + 24,576 = 1,048,576.
Answer: 1,048,576 alternatives. Twenty questions cannot always single out one of 1,048,577: that takes a twenty-first.
Splitting an ordered list in half again and again, as in the next game, is the binary search algorithm: it searches an ordered list by successively splitting it in half.[14] It is studied in the Mathematics unit Algorithms, in the lesson “Searching and sorting algorithms”.
In the game below the questions are all of one kind: “Is the secret at most x?”. The keeper of the secret answers truthfully, but does not commit to a number: it always gives the answer that leaves more candidates. Whatever is asked, at least half of the candidates remain after each question, so no plan beats this keeper with fewer questions than Theorem 1 requires. To beat it within k questions, every question must leave few enough candidates in both parts to be finished with the questions still left; questions chosen in that way would find any secret within k questions.
Halve the candidates
- Round
- 1
- Score
- 0
- Streak
- 0
The keeper holds a secret number from 1 to 30. Find it in at most 5 questions. Tap a number to ask “Is the secret at most that number?”, then press Ask.
The keeper answers truthfully but has not fixed its number: it always gives the answer that leaves more candidates. So every question must leave few enough candidates in both parts; questions that beat this keeper would find any secret in time.
30 candidates remain (1–30). Questions asked: 0. Choose where to split.
When the number of alternatives is not a power of two
Most sets of alternatives do not have 2, 4, 8, 16, … members. Theorem 1 still settles how many questions they need, because every whole number N ≥ 2 lies between two neighboring powers of two: the powers 1, 2, 4, 8, … double at each step, so there is exactly one k with 2ᵏ⁻¹ < N ≤ 2ᵏ.
Let N ≥ 2 be a whole number, and let k be the whole number with 2ᵏ⁻¹ < N ≤ 2ᵏ. Then k yes-or-no questions always single out one of N alternatives, and k − 1 questions do not. (For N = 1, no question is needed.)
N ≤ 2ᵏ, so k questions are enough by part (1) of Theorem 1. N > 2ᵏ⁻¹, so by part (2), applied to k − 1, no plan of k − 1 questions always succeeds.
The number of questions found in this way is a worst case: a good plan may find some alternatives sooner, but there is always some alternative that takes all k questions.
How many yes-or-no questions always find the face of a die that has been rolled?
- N = 6, and 2² = 4 < 6 ≤ 8 = 2³, so k = 3.
- A plan: “Is it at least 4?” leaves 1, 2, 3 or 4, 5, 6. In 1, 2, 3 ask “Is it at least 2?”: no gives 1 at once; yes leaves 2, 3, and “Is it at least 3?” decides. The other half is treated in the same way.
- Faces 1 and 4 take two questions and faces 2, 3, 5 and 6 take three.
Answer: 3 questions in the worst case. Two questions cannot always succeed, since they tell apart at most 4 alternatives.
Someone works out that 100 alternatives need 7 questions and concludes that 200 alternatives need 14. What is the right number?
- For 100: 2⁶ = 64 < 100 ≤ 128 = 2⁷, so 7 questions. This part is right.
- For 200: 2⁷ = 128 < 200 ≤ 256 = 2⁸, so 8 questions, not 14.
- The reason: a first question can split the 200 into two parts of 100. Whatever the answer, 100 remain, and they need 7 more questions.
Answer: 8. Doubling the number of alternatives adds one question; it does not double the number of questions.
A die is rolled three times. Asking about each roll separately takes 3 + 3 + 3 = 9 questions in the worst case. Can a plan for the three rolls together do better?
- Each of the 6 results of the first roll can be followed by each of the 6 results of the second, giving 6 × 6 = 36 pairs; each pair can be followed by 6 results of the third roll: 36 × 6 = 216 alternatives.
- 2⁷ = 128 < 216 ≤ 256 = 2⁸, so by the Proposition 8 questions always suffice for the three rolls together, and 7 do not.
- Six questions, 2 per roll, are far from enough: they tell apart at most 2⁶ = 64 alternatives, fewer than 216.
Answer: yes, 8 questions instead of 9. Per roll that is 8 ÷ 3 = 2.666…, about 2.67 questions (a repeating decimal). Asking about the rolls together brings the number of questions per roll below 3, although one roll alone needs 3. It never brings it down to 2: for any number of rolls, 2 questions per roll multiply the alternatives that can be told apart by at most 2 × 2 = 4 per roll, while each roll multiplies the alternatives by 6. A single roll’s share of the questions lies between 2 and 3: the information in one roll is not a whole number of questions.
The exact amount of information in one roll, and in selections whose alternatives are not equally likely, is measured with logarithms. Shannon asked for a measure of how much choice is involved in a selection, or how uncertain we are of its outcome, when the alternatives have known probabilities.[15] The answer, the entropy, is a lower bound on the average number of questions needed to identify the outcome in a game of twenty questions.[10] It is taught in the Mathematics units Logarithms and Information Theory, and used in this unit’s lesson “Why data can be compressed”.
The answers form a code of 0s and 1s
Write 1 for each yes and 0 for each no. The answers that lead to an alternative then form a bit string, and, as part (2) of the proof of Theorem 1 showed, different alternatives receive different strings. So a plan of questions gives the set of alternatives a binary code.[16]
A binary code for a set of alternatives gives each alternative a different bit string, called its codeword.[16]
Conversely, a binary code gives a plan: the first question asks whether the first bit of the selected alternative’s codeword is 1, the second asks about the second bit, and so on.[17] When all the codewords have the same length n, for example the n-bit binary numerals of the numbers below 2ⁿ, written with zeros on the left, n such questions reveal the whole codeword and so the alternative.[18]
With codewords of different lengths the converse needs a condition: no codeword may be the beginning of another. In the code A = 0, B = 01, C = 1, the answer “no” to the first question leaves both A and B possible, and for A there is no second bit to ask about. A code in which no codeword is a prefix of another is called a prefix code.[19] Every plan that stops as soon as one alternative remains gives a prefix code: if the codeword of X were the beginning of the codeword of Y, then Y would still be possible when the plan stops at X. The plan for a die in Section 3, with codewords 00, 010, 011, 10, 110 and 111, is an example.
The plan of the first figure has a remarkable property: the codeword of each number is its binary numeral. This holds for every power of two.
Number 2ᵏ alternatives 0, 1, …, 2ᵏ − 1, and let each question ask whether the selected number is in the upper half of the numbers that remain. Then the answers, written 1 for yes and 0 for no, are the binary numeral of the selected number, with zeros written on the left to make k bits.
The upper half of 0, …, 2ᵏ − 1 is 2ᵏ⁻¹, …, 2ᵏ − 1. By the theorem “what k bits can name” of Number Bases lesson 1.2, the numbers below 2ᵏ⁻¹ have at most k − 1 bits, so their k-bit strings begin with 0; the numbers from 2ᵏ⁻¹ to 2ᵏ − 1 need k bits, so their strings begin with 1. So the first answer is the first bit.
If the answer was no, the numbers 0 to 2ᵏ⁻¹ − 1 remain, and the same argument with k − 1 in place of k shows that the next answer is the next bit. If it was yes, every remaining number is 2ᵏ⁻¹ + r with r from 0 to 2ᵏ⁻¹ − 1. The bits of r lie in the places 0 to k − 2, so adding 2ᵏ⁻¹ only puts a 1 in place k − 1 (Number Bases lesson 1.2, sums of different powers of two): the remaining bits are those of r, and the next question, about the upper half, asks about the first of them. Continuing in this way, each answer is the next bit.
The keeper’s number is 38, one of the 64 numbers 0 to 63. Run the halving plan and read the answers.
- “Is it at least 32?” Yes, 1. The numbers 32 to 63 remain.
- “Is it at least 48?” No, 0. The numbers 32 to 47 remain.
- “Is it at least 40?” No, 0. The numbers 32 to 39 remain.
- “Is it at least 36?” Yes, 1. The numbers 36 to 39 remain.
- “Is it at least 38?” Yes, 1. The numbers 38 and 39 remain.
- “Is it at least 39?” No, 0. Only 38 remains.
Answer: the answers are 100110, and 100110₂ = 32 + 4 + 2 = 38, as Theorem 2 says. Six questions, because 64 = 2⁶.
Someone records the answers of the last example from the last question to the first, 011001, and reads 011001₂ = 16 + 8 + 1 = 25. What went wrong?
- The first question decides between the lower and upper half, a difference of 32: it is the bit of place 5, worth 2⁵ = 32.
- The last question decides between two neighbors, 38 and 39: it is the bit of place 0, worth 1.
- So the first answer is the leftmost bit of the numeral, and the last answer the rightmost.
Answer: the answers must be read in the order they were given, 100110₂ = 38. Reversed, they name a different number.
The number of questions now has a name. Shannon’s paper of 1948 says that its units of information, measured on the scale used here, may be called binary digits, or more briefly bits, a word suggested by J. W. Tukey.[20]
The information in a selection from 2ᵏ equally likely alternatives is k bits. In particular, one bit is the information in a single choice between two equally likely alternatives, such as the toss of a fair coin.[20]
The name fits Theorem 2: a selection from 2ᵏ equally likely alternatives is described exactly by k binary digits. A selection from 16 equally likely alternatives carries 4 bits; from 2, one bit; from a single alternative, 0 bits.
Counting questions measures information only when all the alternatives are equally likely; Shannon’s first measure, the number of possible messages, assumes exactly that.[7] If one alternative is much more likely than the others, a clever plan asks about it first and needs fewer questions on average. The Looking-ahead note of Section 3 names the units where this is treated.
The word bit also names the binary digit itself, 0 or 1 (Number Bases lesson 1.2). The next lesson, “Bits and bytes”, explains how the two meanings are related, how a computer holds bits and how it groups them.
Answers as bits
- Round
- 1
- Score
- 0
- Streak
- 0
You keep the secret number 19, one of the numbers 0 to 31. Answer the plan’s questions truthfully. Each yes is written 1 and each no 0.
Question 1 of 5: is it at least 16?
Exercises
How many yes-or-no questions always single out one of (a) 64 equally possible alternatives; (b) the 7 days of the week; (c) 1,000 alternatives?
▸ Show solution
(a) 64 = 2⁶: 6 questions.
(b) 2² = 4 < 7 ≤ 8 = 2³: 3 questions.
(c) 2⁹ = 512 < 1,000 ≤ 1,024 = 2¹⁰: 10 questions.
The four seasons are Winter, Spring, Summer and Autumn. Give a plan of two yes-or-no questions that always finds the season, and explain why one question cannot.
▸ Show solution
Two questions: “Is it Winter or Spring?” and then, in the remaining pair, “Is it the first of the two?” (for example “Is it Winter?”). Whatever the season, two answers leave one.
One question is not enough: a single question splits the four seasons into two parts, and some part holds at least two seasons, because 4 is more than 2¹ = 2 (Theorem 1, part 2).
The halving plan is used on the numbers 0 to 15. The answers are no, yes, yes, no. Which number was selected? Check your answer by following the questions.
▸ Show solution
By Theorem 2 the answers no, yes, yes, no are the bits 0110, and 0110₂ = 4 + 2 = 6.
Check by narrowing: “at least 8?” no leaves 0 to 7; “at least 4?” yes leaves 4 to 7; “at least 6?” yes leaves 6 and 7; “at least 7?” no leaves 6.
Someone thinks of a whole number from 1 to 100. Show that 7 questions of the form “Is it at most x?” always find it, and that no plan of 6 yes-or-no questions always does.
▸ Show solution
2⁶ = 64 < 100 ≤ 128 = 2⁷, so by the Proposition 7 questions always suffice and 6 do not. Asking “Is it at most x?” with x near the middle of what remains leaves at most 50, 25, 13, 7, 4, 2 and finally 1 candidate: 7 questions.
No plan of 6 questions always succeeds, by part (2) of Theorem 1, because 100 > 2⁶ = 64. The keeper of the game in Section 2 shows the failure in practice: it keeps the larger part after every question, so at least 50, 25, 13, 7, 4 and 2 candidates remain after the first six questions.
How many yes-or-no questions always find the results of (a) two rolls of a die together, (b) five rolls together? Compare with asking about each roll separately.
▸ Show solution
Two rolls: 6 × 6 = 36 alternatives, and 2⁵ = 32 < 36 ≤ 64 = 2⁶, so 6 questions, the same as 3 + 3. Grouping two rolls saves nothing.
Five rolls: 6 × 6 × 6 × 6 × 6 = 7,776 alternatives. 2¹² = 4,096 < 7,776 ≤ 8,192 = 2¹³, so 13 questions instead of 5 × 3 = 15.
Prove that no plan of 3 yes-or-no questions always singles out one of 9 alternatives. How many questions are needed?
▸ Show solution
Suppose a plan of 3 questions always singled out one of 9 alternatives. By the proof of Theorem 1, part (2), each alternative would get its own list of 3 answers, that is, a bit string of length 3. There are only 2³ = 8 such strings, so by the pigeonhole principle two of the 9 alternatives would get the same string, and the plan could not tell them apart.
A plan of 4 questions works, since 9 ≤ 16 = 2⁴: for example, halve 9 into 5 and 4, then 5 into 3 and 2, and so on.
Turn the binary code Winter 00, Spring 01, Summer 10, Autumn 11 into a plan of two yes-or-no questions, and check that it always finds the season.
▸ Show solution
Give the four seasons the codewords 00, 01, 10, 11 (Winter, Spring, Summer, Autumn). The plan asks “Is the first bit 1?”, that is, “Is it Summer or Autumn?”, and then “Is the second bit 1?”, that is, “Is it Spring or Autumn?”.
Different codewords give different answers, so the plan always finds the season. The second question does not depend on the first answer: with a code, the questions can even be fixed in advance.
Summary
- In the theory of communication, a message is one alternative selected from a set of possible messages known in advance. Its information is which alternative it is; its meaning plays no part.
- A yes-or-no question splits the alternatives into two parts. A plan of k questions always singles out one of at most 2ᵏ alternatives, and never of more: each question at most doubles what can be told apart.
- For N alternatives with 2ᵏ⁻¹ < N ≤ 2ᵏ, k questions are needed in the worst case. Doubling the alternatives adds one question.
- Written as 1 for yes and 0 for no, the answers form a binary code. For the numbers 0 to 2ᵏ − 1, the halving plan’s answers are the k-bit binary numeral of the selected number.
- A selection from 2ᵏ equally likely alternatives carries k bits of information; one bit is one choice between two equally likely alternatives.
Sources
- 1.J. J. O’Connor and E. F. Robertson, “Claude Elwood Shannon”, MacTutor History of Mathematics Archive, University of St Andrews (October 2003).
“Shannon published A Mathematical Theory of Communication in the Bell System Technical Journal (1948). This paper founded the subject of information theory”
Used for: Claude E. Shannon published “A Mathematical Theory of Communication” in the Bell System Technical Journal in 1948, and the paper founded information theory. - 2.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter Preface, p. viii (the whole topic: pp. vii–viii).
“While it is clear that Shannon was motivated by problems in communication theory when he developed information theory, we treat information theory as a field of its own”
Used for: information theory was developed by Shannon, motivated by problems of communication. - 3.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section Introduction, p. 379. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“The fundamental problem of communication is that of reproducing at one point either exactly or approximately a message selected at another point.”
Used for: Shannon (1948) described the fundamental problem of communication as reproducing at one point a message selected at another point. - 4.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section Introduction, p. 379. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“The significant aspect is that the actual message is one selected from a set of possible messages.”
Used for: the significant aspect of a message is that it is one selected from a set of possible messages; the definition of a set of alternatives and a message. - 5.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section Introduction, p. 379. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“The system must be designed to operate for each possible selection, not just the one which will actually be chosen since this is unknown at the time of design.”
Used for: the set of alternatives is fixed in advance and the system must work for every alternative, because which one will be chosen is not known when it is designed. - 6.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section Introduction, p. 379. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“These semantic aspects of communication are irrelevant to the engineering problem.”
Used for: Shannon called the meaning of messages irrelevant to the engineering problem of communication. - 7.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section Introduction, p. 379. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“If the number of messages in the set is finite then this number or any monotonic function of this number can be regarded as a measure of the information produced when one message is chosen from the set, all choices being equally likely.”
Used for: how much information a selection carries depends on the number of alternatives (when all are equally likely); Shannon’s first measure, the number of possible messages, assumes that all choices are equally likely. - 8.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 2, “Entropy, Relative Entropy and Mutual Information”, section 2.1, “Entropy”, p. 13 (the whole topic: pp. 12–14).
“It does not depend on the actual values taken by the random variable X, but only on the probabilities.”
Used for: the amount of information (the entropy) depends only on the probabilities of the alternatives, not on what the alternatives are. - 9.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 5, “Data Compression”, section 5.7, “Some Comments on Huffman Codes”, item 1, “Equivalence of source coding and 20 questions”, p. 94 (the whole topic: pp. 94–95).
“Supposing we wish to find the most efficient series of yes-no questions to determine an object from a class of objects.”
Used for: information theory studies the most efficient series of yes-or-no questions for identifying an object from a class of objects. - 10.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 1, “Introduction and Preview”, section 1.1, “Preview of the Book”, p. 6 (the whole topic: pp. 5–6).
“we show that the entropy of a random variable is a lower bound on the average number of bits required to represent the random variable and also on the average number of questions needed to identify the variable in a game of “twenty questions.””
Used for: the questioning game is called “twenty questions”; the entropy is a lower bound on the average number of questions needed to identify the outcome. - 11.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 5, “Data Compression”, section 5.7, “Some Comments on Huffman Codes”, item 3, “Huffman coding and ‘slice’ questions”, p. 95 (the whole topic: pp. 94–95).
“However, Huffman codes ask arbitrary questions of the form “Is X ∈ A?” for any set A ⊆ {1, 2, . . . , m}.”
Used for: a yes-or-no question may ask whether the message lies in any chosen part of the set of alternatives (“Is X ∈ A?”). - 12.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 5, “Data Compression”, section 5.7, “Some Comments on Huffman Codes”, item 1, “Equivalence of source coding and 20 questions”, p. 94 (the whole topic: pp. 94–95).
“Any question depends only on the answers to the questions before it.”
Used for: in a plan of questions, each question may depend on the answers to the questions before it. - 13.Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).Chapter 6, “Counting”, section 6.2, “The Pigeonhole Principle” (6.2.1, “Introduction”), p. 420 (the whole topic: pp. 420–421).
“If k is a positive integer and k + 1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects.”
Used for: the pigeonhole principle used in the proof of Theorem 1, part (2): more alternatives than bit strings means two alternatives share a string. - 14.Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).Chapter 3, “Algorithms”, section Key Terms and Results, p. 244 (the whole topic: pp. 205–206).
“binary search algorithm: a procedure for searching an ordered list by successively splitting the list in half”
Used for: the binary search algorithm searches an ordered list by successively splitting it in half (it is described in section 3.1, pp. 205–206). - 15.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section 6, “Choice, Uncertainty and Entropy”, p. 392. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“Can we find a measure of how much “choice” is involved in the selection of the event or of how uncertain we are of the outcome?”
Used for: Shannon asked for a measure of how much choice is involved in a selection, or how uncertain we are of its outcome, when the probabilities are known. - 16.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 5, “Data Compression”, section 5.7, “Some Comments on Huffman Codes”, item 1, “Equivalence of source coding and 20 questions”, p. 94 (the whole topic: pp. 94–95).
“Since the sequence of answers uniquely determines the object, each object has a different sequence of answers, and if we represent the yes-no answers by 0’s and 1’s, we have a binary code for the set of objects.”
Used for: written as 1s and 0s, the answers give each alternative a different bit string: a binary code for the set; the definition of a binary code. - 17.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 5, “Data Compression”, section 5.7, “Some Comments on Huffman Codes”, item 1, “Equivalence of source coding and 20 questions”, p. 94 (the whole topic: pp. 94–95).
“The first question in this scheme becomes “Is the first bit equal to 1 in the object’s codeword?””
Used for: conversely, a binary code gives a plan of questions, each asking about one bit of the selected alternative’s codeword; the word codeword. - 18.Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).Chapter Answers to Odd-Numbered Exercises, section Chapter 4, Supplementary Exercises, answer 11, pp. S-29 (the whole topic: pp. S-29).
“We ask the person to write the number in binary, using leading 0s if necessary to make it n bits long. We then ask, “Is the first bit a 1?”, “Is the second bit a 1?”, “Is the third bit a 1?”, and so on.”
Used for: with codewords of the same length n, such as the n-bit binary numerals (with zeros on the left) of the numbers below 2ⁿ, n questions about the bits reveal the codeword and so the alternative. - 19.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 5, “Data Compression”, section 5.1, “Examples of Codes”, p. 81 (the whole topic: pp. 79–81).
“A code is called a prefix code or an instantaneous code if no codeword is a prefix of any other codeword.”
Used for: a code in which no codeword is a prefix of another is called a prefix code. - 20.C. E. Shannon, “A Mathematical Theory of Communication”, The Bell System Technical Journal 27(3) (1948), 379–423.Section Introduction, p. 380. doi.org/10.1002/j.1538-7305.1948.tb01338.x · open at the quoted passage.
“If the base 2 is used the resulting units may be called binary digits, or more briefly bits, a word suggested by J. W. Tukey.”
Used for: Shannon’s 1948 paper says that its units of information may be called binary digits, or more briefly bits, a word suggested by J. W. Tukey (with base 2, the measure of a choice among 2ᵏ equally likely alternatives is k). - 21.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 2, “Entropy, Relative Entropy and Mutual Information”, section 2.1, “Entropy”, p. 13 (the whole topic: pp. 12–14).
“For example, the entropy of a fair coin toss is 1 bit.”
Used for: one bit is the information in a single choice between two equally likely alternatives, such as the toss of a fair coin. - 22.Thomas M. Cover and Joy A. Thomas, Elements of Information Theory (1st ed., John Wiley & Sons, New York, 1991).Chapter 1, “Introduction and Preview”, section 1.1, “Preview of the Book”, p. 5 (the whole topic: pp. 5–6).
“Consider a random variable which has a uniform distribution over 32 outcomes. To identify an outcome, we need a label that takes on 32 different values. Thus 5-bit strings suffice as labels.”
Used for: a selection from 2ᵏ equally likely alternatives is described by k bits: k-bit strings suffice to label the alternatives (the source’s case is 32 = 2⁵ outcomes and 5 bits; it goes on to compute the entropy of this choice as log 32 = 5 bits, “which agrees with the number of bits needed to describe X”).