AP Computer Science Review PDF
Document Details
Uploaded by FlatterLouisville9222
Florida Virtual School
Tags
Summary
This document is a set of review questions in computer science, covering topics such as computer hardware, software, digital information in various forms (decimal, binary, hexadecimal), compression, and encryption.
Full Transcript
Unit 7 - Review Section 1 In this section, we discussed the basics of computer hardware and software. We then began discussing digital information in the form of counting systems such as decimal, binary, and hexadecimal. Each counting system has a unique base (decimal: base 10, binary: base 2, hexa...
Unit 7 - Review Section 1 In this section, we discussed the basics of computer hardware and software. We then began discussing digital information in the form of counting systems such as decimal, binary, and hexadecimal. Each counting system has a unique base (decimal: base 10, binary: base 2, hexadecimal: base 16). To count, a digit is incremented up, and when a digit has reached the highest value it can hold, it resets to 0 and increments the next place value up one. Different counting systems can be converted between each other, with each conversion having a different method for how to do it. Binary numbers are often grouped together in groups of 8 bits, creating a byte. 8-bit binary can hold 256 total values, from 0 to 255. To hold higher values, more bits are required. Section 2 In this section, we discussed different forms of compression, namely lossless and lossy. Lossless compression uses an algorithm that allows for complete duplication of the original data. Lossy, on the other hand, find data that is not necessary and throws it out. Lossy compression allows the selection of how much data can be removed. Both compression methods result in smaller file sizes, but lossy tends to have significantly smaller sizes than lossless. We also discussed cryptography and encryption. More bits equals a stronger encryption. Public and private keys allow for information to be encrypted between parties that can only be decrypted by the person with the private key. 1. What is the base value for each of the following? Decimal Binary Hexadecimal 2. Railways have devices called "axle counters" that count up how many train axles have passed by, and helps decide if a train has fully passed part of a track. However, because of a bug in the design of the axle counter logic, a train that has exactly 256 axles will result in a count of 0, and its existence will be ignored. Thus, trains that run on these buggy railways must have less than 256 axles. What is the most likely cause of this bug? 3. How many bits are in 4 bytes? 4. Nora is learning to use image editing applications and doesn't understand when to lower the quality setting for JPEG saving. What's a good use case for using a lower quality setting? 5. Byte pair encoding is a compression algorithm that replaces the most common pairs of characters in a string with a character that isn't in the data, and creates a table of replacement mappings.Here's the output from a byte pair encoding: One ZY Two ZY Red ZY Blue ZY Is it possible to decode this? If so, what was the original string? If not, why not?