1. Home
  2. Explore
  3. Computer Science
  4. Limits of Text Compression

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Limits of Text Compression

  • 61Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Compression Codes
In the default ASCII encoding described, each character is represented using
bits.

61 questions

  1. 1
    In the default ASCII encoding described, each character is represented using
    _____
    bits.
    Hint

    This is the fixed size of the encoding discussed in the passage.

    Answer

    eight

    Explanation

    The passage describes the default ASCII encoding as using eight full bits for each character.

  2. 2
    Associating shorter bit strings with common characters can reduce text encoding to an average of around
    _____
    bits per character.
    Hint

    This is about half the number of bits used by the default encoding described.

    Answer

    four

    Explanation

    A simple frequency-aware encoding can reduce the average from eight bits to around four bits per character.

  3. 3
    The robot can receive one of four movement instructions, each with a fixed
    _____
    size.
    Hint

    The instructions specify movement in one of four directions.

    Answer

    step

    Explanation

    The robot's possible instructions are move up, down, left, or right, each by a fixed step size.

  4. 4
    In the robot example, the probabilities of up, down, left, and right are respectively 12\frac{1}{2}21​, 14\frac{1}{4}41​, 18\frac{1}{8}81​, and
    _____
    .
    Hint

    The two least frequent directions have equal probabilities.

    Answer

    18\frac{1}{8}81​

    Explanation

    Left and right each account for one eighth of the instructions.

  5. 5
    The robot's instructions are assumed to be
    _____
    ; each instruction is sampled without depending on preceding instructions.
    Hint

    The assumption rules out using earlier moves to predict later ones.

    Answer

    independent

    Explanation

    The example assumes that every instruction is independent of the preceding context.

  6. 6
    A straightforward fixed-length code for four possible instructions uses
    _____
    bits per instruction.
    Hint

    Four distinct possibilities can be represented by all combinations of a short fixed-length bit string.

    Answer

    two

    Explanation

    The straightforward encoding assigns one of the four two-bit strings to each instruction.

  7. 7
    In the clever robot code, the bit string 0 represents
    _____
    and the bit string 10 represents down.
    Hint

    The most frequent movement receives the shortest code word.

    Answer

    up

    Explanation

    The code assigns 0 to up and 10 to down.

  8. 8
    In the clever robot code, left is represented by 110 and right by
    _____
    .
    Hint

    The two least frequent movements receive distinct three-bit code words.

    Answer

    111

    Explanation

    The code assigns 110 to left and 111 to right.

  9. 9
    The clever robot code has an average length of
    _____
    bits per instruction.
    Hint

    Compute a weighted average using the instruction probabilities and code-word lengths.

    Answer

    1.75

    Explanation

    The average is 12(1)+14(2)+18(3)+18(3)=1.75\frac{1}{2}(1)+\frac{1}{4}(2)+\frac{1}{8}(3)+\frac{1}{8}(3)=1.7521​(1)+41​(2)+81​(3)+81​(3)=1.75 bits per instruction.

  10. 10
    A bit string used to represent one instruction in a code is called a
    _____
    .
    Hint

    It is the encoded representation assigned to a symbol.

    Answer

    code word

    Explanation

    The passage uses the term code word for each bit string that encodes an instruction.

  11. 11
    A code is prefix-free when no code word is a
    _____
    of another code word.
    Hint

    The condition prevents a decoder from mistaking a complete code word for the beginning of a longer one.

    Answer

    prefix

    Explanation

    A prefix-free code has no code word that begins another code word, allowing the receiver to identify complete words as bits arrive.

  12. 12
    If 10 represents down, assigning 100 to an additional instruction creates ambiguity because 10 is a
    _____
    of 100.
    Hint

    After reading 10, the receiver would not know whether to stop or continue.

    Answer

    prefix

    Explanation

    The receiver could interpret 10 as the complete code word for down or as the beginning of 100.

  13. 13
    A receiver can decode a prefix code by reading bits until they form a complete
    _____
    and then starting again.
    Hint

    The rule identifies the point at which one encoded symbol is complete.

    Answer

    code word

    Explanation

    Because no code word is a prefix of another, the receiver can register a complete word as soon as it appears.

  14. 14
    In the binary-string diagram, assigning a one-bit code word beginning with 0 rules out all other code words that begin with
    _____
    .
    Hint

    Every string in that half of the diagram has the selected code word as a prefix.

    Answer

    0

    Explanation

    With 0 assigned as a complete code word, any longer string starting with 0 would violate the prefix-free condition.

  15. 15
    In the robot example, the space consumed by each code word matches the probability of its instruction: the code for up uses half the space, while each of the least common directions uses
    _____
    .
    Hint

    Compare the three-bit code words with the four-way probability distribution.

    Answer

    one eighth

    Explanation

    The code words for left and right each occupy one eighth of the binary-string space, matching their probabilities.

  16. 16
    An ideal compressed bitstream is modeled as independent bits, each of which is 0 or 1 with
    _____
    probability.
    Hint

    The model treats each bit as a fair coin flip.

    Answer

    50%

    Explanation

    Random noise in the passage means independent bits with a 50% chance of being 0 and a 50% chance of being 1.

  17. 17
    The robot's clever encoding produces a bitstream that is indistinguishable from independent fair-bit
    _____
    .
    Hint

    The encoded output behaves like repeated fair coin flips.

    Answer

    random noise

    Explanation

    At each step, the next bit is 0 or 1 with equal probability, independent of the previously generated bits.

  18. 18
    A string of nnn bits can represent one of 2n2^n2n possible bit strings of the same
    _____
    .
    Hint

    All strings in this set have the same number of bits.

    Answer

    size

    Explanation

    There are 2n2^n2n distinct binary strings of length nnn.

  19. 19
    If all 2n2^n2n bit strings of length nnn are equally likely, each has probability
    _____
    .
    Hint

    The probabilities of all equally likely possibilities must add up to one.

    Answer

    12n\frac{1}{2^n}2n1​

    Explanation

    Dividing total probability one equally among 2n2^n2n strings gives probability 12n\frac{1}{2^n}2n1​ for each.

  20. 20
    Under perfect compression, an encoded message of nnn bits corresponds to an original message with probability
    _____
    .
    Hint

    The ideal output assigns equal likelihood to every bit string of that length.

    Answer

    12n\frac{1}{2^n}2n1​

    Explanation

    If the compressed output behaves like random noise, each length-nnn encoding is equally likely, so its underlying message has probability 12n\frac{1}{2^n}2n1​.

  21. 21
    For equally likely messages, the most efficient arrangement gives each message a code of the same
    _____
    .
    Hint

    A uniform set of possibilities does not favor any one message over another.

    Answer

    length

    Explanation

    When all messages are equally likely, assigning them equal-length code words avoids the trade-offs created by unequal lengths.

  22. 22
    In the binary-string diagram, shortening one message's code can force other messages to use longer codes to remain
    _____
    .
    Hint

    The code still must let the receiver distinguish every original message.

    Answer

    unambiguous

    Explanation

    Moving one encoding to a shorter string takes space that may overlap with other messages, so those messages must be moved to longer strings to preserve unambiguous decoding.

  23. 23
    The idea that saving one bit for one message can cost multiple bits elsewhere illustrates a trade-off in the allocation of binary-string
    _____
    .
    Hint

    The diagram represents all possible code words as regions that can be used or ruled out.

    Answer

    space

    Explanation

    A shorter code word consumes a larger share of the available binary-string space, forcing other code words to use more of it.

  24. 24
    The information of an event with probability ppp is defined as the
    _____
    .
    Hint

    The expression increases as the event becomes less probable.

    Answer

    negative log base 2 of p

    Explanation

    Shannon defined an event's information as the negative log base 2 of its probability.

  25. 25
    An event with a lower probability carries
    _____
    information than a highly expected event.
    Hint

    Unexpected events reduce uncertainty more when they occur.

    Answer

    more

    Explanation

    The information value increases as probability approaches zero, so unlikely events contain more information.

  26. 26
    As an event's probability approaches 100%, its information approaches
    _____
    .
    Hint

    A nearly certain event provides little new information when it occurs.

    Answer

    zero

    Explanation

    Highly expected messages have very low information; the negative log of a probability of one is zero.

  27. 27
    The negative logarithm in the information formula can be understood as counting how many times the space of possibilities is chopped in
    _____
    .
    Hint

    Think of repeatedly dividing a set of possibilities into equal-sized groups.

    Answer

    half

    Explanation

    The passage interprets the base-two logarithm as counting successive halvings of the possibility space.

  28. 28
    When perfect compression is possible, the number of bits assigned to a full message equals its
    _____
    .
    Hint

    The encoded length is tied to how probable the message is.

    Answer

    information content

    Explanation

    For a perfectly compressed message, its bit length is the negative log base 2 of its probability, which is its information content.

  29. 29
    For probabilities that are not powers of two, information values can be
    _____
    rather than whole numbers of bits.
    Hint

    The logarithm need not produce an integer for an arbitrary probability.

    Answer

    fractional

    Explanation

    A message's information can be a fractional number of bits even though an actual code word has a whole-number length.

  30. 30
    When perfect compression is not possible, average information gives a
    _____
    on how much messages can be compressed.
    Hint

    An encoding cannot reliably use fewer bits on average than the information requires.

    Answer

    lower bound

    Explanation

    The information of messages provides a lower bound on achievable compression when averaged over possible messages.

  31. 31
    For a sequence of letters, the probability of a full phrase is found by multiplying successive letter probabilities conditioned on what came
    _____
    .
    Hint

    Each next-letter probability depends on the preceding context.

    Answer

    before

    Explanation

    The chain rule expresses a phrase's probability as a product of successive conditional probabilities.

  32. 32
    Because logarithms turn multiplication into addition, the information of a full phrase equals the sum of the information of its individual
    _____
    .
    Hint

    Apply the logarithm to the product of conditional probabilities for the sequence.

    Answer

    letters

    Explanation

    Taking the negative logarithm of the product of conditional letter probabilities turns it into a sum of the letters' information values.

  33. 33
    In natural language, the probability of the next letter is highly dependent on the preceding
    _____
    .
    Hint

    The same letter can be more or less predictable depending on what came earlier.

    Answer

    context

    Explanation

    Unlike the independent robot instructions, language probabilities are strongly conditioned on prior text.

  34. 34
    A model that tracks statistics for sequences of a fixed number of characters is using
    _____
    .
    Hint

    This term names short character sequences whose following characters are analyzed.

    Answer

    n-grams

    Explanation

    Shannon examined statistics of short sequences, often called n-grams, to estimate what characters tend to follow them.

  35. 35
    Raw counts from books become unreliable for longer character sequences because many possible sequences may never appear in the analyzed
    _____
    .
    Hint

    The problem is that a limited sample may not include every longer string.

    Answer

    books

    Explanation

    For long contexts, the observed sample may contain no instances of a particular string, even though it is reasonable to ask what would follow it.

  36. 36
    Longer context windows can improve compression because text is often more
    _____
    when more preceding letters are known.
    Hint

    More context can help constrain which symbol is likely next.

    Answer

    predictable

    Explanation

    The passage notes that longer contexts are often the most predictable and therefore offer greater potential compression.

  37. 37
    In Shannon's early human-based experiment, his wife Betty guessed each next letter while Shannon transcribed the guesses and supplied the correct letter whenever she was
    _____
    .
    Hint

    The transcript marked successful guesses differently from unsuccessful ones.

    Answer

    incorrect

    Explanation

    When Betty guessed incorrectly, Shannon wrote the correct letter; when she guessed correctly, he used a dash.

  38. 38
    In the Betty experiment, a reduced transcript could reproduce the original for a duplicate guesser because the supplied letters provided the needed
    _____
    .
    Hint

    The missing predictable letters could be generated from the guesser's language ability and context.

    Answer

    prompting

    Explanation

    Shannon's idea was that a replica of Betty could use the supplied letters as prompts to reconstruct the original text.

  39. 39
    Shannon's later language experiments recorded how many
    _____
    a human needed to guess the correct next letter.
    Hint

    This was more detailed than recording only whether a prediction was right or wrong.

    Answer

    guesses

    Explanation

    In the later method, Shannon interviewed multiple people and recorded the number of guesses required to reach the correct letter.

  40. 40
    Shannon used the number of guesses required to infer an implicit probability assigned by the human
    _____
    .
    Hint

    The experiment treated people's predictions as evidence about their expectations.

    Answer

    guesser

    Explanation

    Shannon had a method for relating the number of guesses to the probability a person implicitly assigned to the correct next letter.

  41. 41
    In these language experiments, a person's brain was treated as a black box with an ability to predict characters from
    _____
    .
    Hint

    The human predictor used preceding letters to anticipate what came next.

    Answer

    context

    Explanation

    Shannon probed an underlying model of language by treating interviewees' brains as sophisticated predictors conditioned on context.

  42. 42
    The average information per symbol for a fixed symbol distribution is called
    _____
    .
    Hint

    This quantity is used to describe the average information and compression limit of a signal.

    Answer

    entropy

    Explanation

    Entropy measures the average information per symbol for a probability distribution.

  43. 43
    For symbol probabilities ppp, entropy is calculated by summing each probability times its negative log base 2: the weighted sum of
    _____
    .
    Hint

    Each symbol's information value is weighted by how often that symbol occurs.

    Answer

    information

    Explanation

    The entropy formula is the sum of ppp times the information value of each outcome, namely the negative log base 2 of ppp.

  44. 44
    Entropy can be visualized as the total area of rectangles whose widths are symbol probabilities and whose heights are their
    _____
    .
    Hint

    The height corresponds to the negative logarithm of the probability.

    Answer

    information values

    Explanation

    In the passage's graphic, each rectangle's area is probability times information, and the total area is the weighted average information.

  45. 45
    A more evenly distributed probability distribution has
    _____
    entropy than a highly uneven one.
    Hint

    When probability is spread among outcomes, uncertainty tends to increase.

    Answer

    higher

    Explanation

    A more even distribution raises average information, while a dominant highly probable event lowers it.

  46. 46
    If one event dominates a probability distribution, its entropy is low because the dominant event carries
    _____
    information.
    Hint

    An event that is very likely is not surprising.

    Answer

    little

    Explanation

    A highly probable event has a low information value, reducing the distribution's total entropy when it dominates.

  47. 47
    Distributing probability over more possible symbols generally makes entropy
    _____
    .
    Hint

    With more possible outcomes, each outcome tends to carry more uncertainty.

    Answer

    higher

    Explanation

    The passage notes that dividing probability space among more possible symbols increases the total entropy.

  48. 48
    Entropy is qualitatively understood as a measure of the amount of
    _____
    in a distribution.
    Hint

    It reflects how difficult it is to predict which outcome will occur.

    Answer

    uncertainty

    Explanation

    Entropy measures uncertainty, with more even distributions having greater uncertainty than highly skewed ones.

  49. 49
    The noiseless coding theorem says no encoding can use fewer bits per symbol on average than the entropy limit, but an encoding can get
    _____
    close to it.
    Hint

    The theorem gives both a lower bound and a result about achievable efficiency.

    Answer

    arbitrarily

    Explanation

    Shannon showed that no encoding is more efficient than the entropy limit and that it is always possible to approach the limit arbitrarily closely.

  50. 50
    The simple entropy formula applies directly when every new symbol follows the same
    _____
    .
    Hint

    This condition holds in the independent robot example but not generally in English.

    Answer

    distribution

    Explanation

    The basic expression describes cases in which each symbol is governed by an identical probability distribution.

  51. 51
    For a stochastic process whose symbol probabilities vary with context, the relevant generalization is the
    _____
    .
    Hint

    It extends the idea of average information per symbol to dependent sequences.

    Answer

    entropy rate

    Explanation

    The entropy rate measures average information per symbol for a stochastic process, averaging over possible messages.

  52. 52
    The entropy rate for a process asks for average information per symbol while averaging over all possible
    _____
    .
    Hint

    The general setting accounts for sequences generated by the process, not just one fixed sequence.

    Answer

    messages

    Explanation

    For context-dependent processes, the average information per symbol is considered over all possible messages.

  53. 53
    An exact entropy calculation for natural language is difficult because there is no simple known formula for its probability
    _____
    .
    Hint

    The challenge is specifying how likely every possible language sequence is.

    Answer

    distribution

    Explanation

    The entropy of language cannot be obtained by a clean calculation when the underlying probability distribution for language is not known exactly.

  54. 54
    With at least 100 preceding letters of context, Shannon estimated English entropy at about
    _____
    bit per character.
    Hint

    The estimate is remarkably low compared with the number of bits in a typical character encoding.

    Answer

    one

    Explanation

    Shannon's estimate was about one bit per character when the human interviewee had at least 100 prior letters of context.

  55. 55
    Shannon's estimate of English entropy relied on observations and human judgments rather than only on statistical analysis of a text
    _____
    .
    Hint

    He used people as models capable of predicting language from context.

    Answer

    corpus

    Explanation

    Shannon probed human language predictors instead of treating entropy estimation as merely a function applied to a collection of text.

  56. 56
    In large language model pre-training, the commonly described objective is next
    _____
    prediction.
    Hint

    The model is trained to predict the next unit in a sequence.

    Answer

    token

    Explanation

    The passage describes pre-training for large language models as next token prediction.

  57. 57
    The loss commonly associated with next-token prediction in language-model pre-training is called
    _____
    .
    Hint

    Its name comes from a concept with roots in information theory.

    Answer

    cross-entropy loss

    Explanation

    Large language models are usually described as using cross-entropy loss during pre-training for next-token prediction.

  58. 58
    Information theory shows that prediction and compression are mathematically
    _____
    .
    Hint

    They can be understood as two sides of the same coin.

    Answer

    equivalent

    Explanation

    The passage states that prediction and compression are mathematically equivalent, allowing a prediction objective to be reframed as compression.

  59. 59
    Under the compression perspective, language-model pre-training can be viewed as creating an efficient text
    _____
    .
    Hint

    The alternative framing focuses on representing text with as little data as possible.

    Answer

    compressor

    Explanation

    Because prediction and compression are equivalent, next-token pre-training can be viewed as learning an efficient text compressor.

  60. 60
    The phrase “compression is intelligence” is difficult to evaluate rigorously because intelligence is a
    _____
    and ill-defined term.
    Hint

    The passage describes the concept as hard to define precisely.

    Answer

    squishy

    Explanation

    The claim is difficult to judge because intelligence lacks a precise, agreed-upon definition.

  61. 61
    A more cautious conclusion is that the mathematical theory of compression is highly relevant to
    _____
    .
    Hint

    This is the field whose modern methods use information-theoretic mathematics.

    Answer

    artificial intelligence

    Explanation

    The passage presents the theory of compression as strikingly relevant to artificial intelligence without requiring the stronger claim that compression is intelligence.

1 of 61
Question 1 of 61

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent