A bit is the smallest unit of information a computer can store or transmit, holding a single binary value of 0 or 1. In AP Computer Science Principles, all data (numbers, text, images, sound) is ultimately represented as sequences of bits, and compression works by reducing how many bits that data needs.
A bit (short for binary digit) is the most basic unit of information in computing. It can hold exactly one of two values, 0 or 1. That's it. Everything your computer does, from streaming video to running an app, comes down to manipulating enormous strings of these 0s and 1s.
Why only two values? Because computer hardware is built on switches that are either off or on, and 0/1 maps perfectly to that. On its own, one bit can only answer a yes/no question. The power comes from combining bits. Two bits give you 4 possible values, three bits give you 8, and in general n bits give you 2^n distinct values. That doubling pattern is the foundation of binary representation in Unit 2, and it's why questions about "how many bits do you need to represent X things" show up so often. In Topic 2.2, bits become the measuring stick for data compression. The whole point of compression is to represent the same information using fewer bits (EK DAT-1.D.1), and the CED's big idea is that fewer bits does not necessarily mean less information (EK DAT-1.D.2).
Bits live in Unit 2: Data and directly support learning objective AP Comp Sci P 2.2.A, which asks you to compare data compression algorithms and decide which is best in a given context. You can't reason about compression without thinking in bits, because compression is literally measured as a reduction in the number of bits stored or transmitted (EK DAT-1.D.1). The CED also wants you to internalize a counterintuitive idea here. A compressed file with fewer bits can carry the exact same information as the original, because the original representation had redundancy that the algorithm squeezed out (EK DAT-1.D.2, DAT-1.D.3). Whether that squeeze is reversible is the lossless vs. lossy distinction (EK DAT-1.D.4 and DAT-1.D.5). Bits are also the conceptual floor for everything else in Unit 2, including binary number conversions and how text, images, and sound get encoded as data.
Keep studying AP Computer Science Principles Unit 2
Binary (Unit 2)
Binary is the base-2 number system, and a bit is one digit of it. When you convert a number like 13 into 1101, each of those four digits is a bit. Bits are the alphabet; binary is the language written in that alphabet.
Bytes (Unit 2)
A byte is a group of 8 bits, and it's the unit file sizes are usually measured in. When an exam question says an image was compressed from 5MB to 1MB, that's millions of bytes, which means tens of millions of bits got reduced.
Lossless data compression (Unit 2)
Lossless algorithms cut the number of bits while guaranteeing you can rebuild the original data perfectly. They work by removing redundancy, like replacing a repeated word with a short code, so the same information rides on fewer bits.
Lossy data compression (Unit 2)
Lossy algorithms go further, throwing away some bits permanently to get a much smaller file. The trade-off is that the original can't be fully reconstructed, which is fine for a streamed photo but not for source code.
Bits show up on the AP CSP exam in two main ways. First, in straight binary representation questions, like figuring out how many distinct values n bits can represent (the answer is 2^n). Second, and more heavily in Topic 2.2, as the unit of measurement in compression scenarios. Multiple-choice stems give you a situation, such as a developer transmitting large image files from a mobile app or compressing a 5MB image down to 1MB, and ask you to reason about the relationship between bit count and information content. The classic trap answer assumes fewer bits automatically means lost information. It doesn't. A dictionary-based algorithm that swaps common words for shorter codes shrinks the bit count without losing anything, because the redundancy was doing no informational work. Be ready to identify which compression approach fits a context (lossless when you need perfect reconstruction, lossy when smaller size matters more) and to explain why redundancy in the original data determines how much the bit count can shrink.
A bit is a single 0 or 1. A byte is 8 bits grouped together. Computers process data bit by bit at the lowest level, but storage and file sizes are reported in bytes (and kilobytes, megabytes, etc.) because bytes are a more practical chunk size. If a question mixes the two, multiply bytes by 8 to get bits. A 1MB file is roughly 8 million bits, not 1 million.
A bit is the smallest unit of information in computing and holds exactly one of two values, 0 or 1.
With n bits you can represent 2^n distinct values, so each added bit doubles what you can encode.
Compression reduces the number of bits needed to store or transmit data, and fewer bits does not necessarily mean less information (EK DAT-1.D.2).
How many bits compression can save depends on how much redundancy exists in the original data and which algorithm you apply.
Lossless compression shrinks the bit count while guaranteeing perfect reconstruction; lossy compression shrinks it more but permanently discards some bits.
A byte is 8 bits, so always convert when a question gives file sizes in bytes but asks about bits.
A bit (binary digit) is the smallest unit of information a computer can store, holding a single value of 0 or 1. All data on the AP CSP exam, including numbers, text, images, and sound, is represented as sequences of bits.
No, and this is exactly what EK DAT-1.D.2 wants you to know. Compression can remove redundancy from data, so a file with fewer bits can carry the same information. A dictionary algorithm replacing 'the' with a 2-bit code loses nothing.
A bit is one binary digit (0 or 1), while a byte is a group of 8 bits. File sizes are usually given in bytes, so a 1MB file contains about 8 million bits.
n bits can represent 2^n distinct values. So 1 bit gives 2 values, 4 bits give 16, and 8 bits (one byte) give 256. This doubling rule is one of the most-tested ideas in Unit 2.
Computer hardware is built from switches that are either on or off, and two states map cleanly to 1 and 0. Binary is simply the most reliable way to represent information with physical hardware.