AP COMP SCI UNIT 1 Q&A
When you use licensed material
always make sure to cite where you found your sources
Lossy Compression
A process for reducing the number of bits needed to represent something in which some information is lost or thrown away. This process is not reversible.
Lossless Compression
A process for reducing the number of bits needed to represent something without losing any information. This process is reversible.
Binary
A way of representing information using only two options.
At what value would the number of bits reset to zero with 4 bits?
16 (the maximum value that can be represented with 4 bits is 2^4-1=15)
DIGITAL IMAGE LAYER
Displays a digital approximation based on a sampling of an analog image
DEvelop a protocol that allows the user to send a time(use 24h military time hh:mm:ss). What is the minimum number of bits necessary?
# of Hours=24=5 bits, # of min=60=6 bits, # of sec=60=6 bits (SO) 5+6+6=17 bits
How many bits are required to encode 14 possibilities?
(2^3=8 too little) 2^4=16 (4 bits is enough to encode 16 possibilities) 16>14
How many bits are required to encode 28 possibilities?
(2^4=16) 2^5=32 (enough to encode 28 possibilities)
what is 0.5 in binary?
2^-1 (2^-1=1/2)
what is 0.25 in binary?
2^-2 (2^-2=1/4)
How many different values (including zero) can you represent with 6 bits?
2^6-1=63+1=64
How many would you encode n possibilities?
2^n-1
The highest value that can be represented in n bits is
2^n-1
What is the highest number you can count to with 3 bits (not including 0)
7 (2^3-1=7)
How many bits are in a byte?
8
When counting using 3 bits, what is the smallest number that will cause an overflow error?
8 (2^3-1 is the largest number that you can represent with 3 bits = 7 so plus one would be 8)
What is the highest number you can count to with 3 bits (including 0)
8 (2^3-1=7 (1,2,3,4,5,6,7) 7+1=8 (0,1,2,3,4,5,6,7) (8 values)
Bit
A contraction of "Binary Digit". A bit is the single unit of information in a computer, typically represented as a 0 or 1.
Sampling
A process for creating a digital representation of analog data by measuring the analog data at regular intervals called samples.
ASCII
American Standard Code for Information Interchange; the universally understood raw text format that any computer can understand.
Each time we add another bit, what happens to the amount of numbers we can make?
As the number of bits increases, the number of numbers we can make increases
Digital Data
Data that changes discreetly through a finite set of possible values
Analog Data
Data with values that change continuously, or smoothly, over time. Some examples of analog data include music, colors of a painting, or position of a sprinter during a race.
What are the similarities and differences between the binary and decimal systems?
Differences: Binary= 2 number system while Decimal= 10 number system (0,1,2,3,4,5,6,7,8,9), The Decimal system holds more information than the Binary system. Similarities: Both represent information, both have different patterns to find out different numbers in both systems, and both have different ways to break down the numbers(bits, bytes & hundreds, tens, etc) .
PIXEL LAYER
Each pixel is represented by levels of red, green, and blue light.
overflow error
Error from attempting to represent a number that is too large.
Round-Off Error
Error from attempting to represent a number that is too precise. The value is rounded.
Layers of Abstraction
Hiding the details of implementation of the user; separating the human from the inner workings of the machine (Text--> ASCII-->, Binary)
Imagine you were using some of our pixelation tools to create an image and you posted it online for your friends to see - but, a week later you find out someone took that image and put it on a T-shirt that they're selling for $10 each. Now that we understand Copyright, what would need to change in order for the scenario from the warm-up to be okay?
If I give consent that anyone can use this image however they want then as long as this person cited who created the image on the T-shirt then its okay if they use it.
What does abstraction involve doing?
It involves creating simple representations of more complex phenomena so that people can more easily work with, communicate about, and learn about anything. (example on Code.org)
When is it a good idea to use lossless compression?
It is a good idea to use lossless compression when you want to preserve the entire image as best as possible.
You've been given a new cell phone with a 2 gigabyte data plan. You plan to use your phone for text messages, images, video, and music. Which of these categories are best compressed using lossless compression? Which of these categories are best compressed using lossy compression? Why?
Messages and music are best used with lossless compression because the original message can still be stored while with lossy compression your taking out the main meaning behind the message so the meaning can be interpreted in many ways. Video and images are best used with lossy compression because you can still interpret the video even if you can't go back to the original so the main meaning is not lost so it doesn't make sense to use lossless compression in this case.
Abstraction
Reducing information and details to focus on the important concepts when understanding and solving problems.
How is a Creative Commons license different from a regular copyright?
Regular copyright can be used to determine who uses what you created and how they use it. A creative commons license allows you to use other peoples creations as long as you have a citation of who made the original creation. The difference is that a creative commons license is for someone to use the creations of others while copyright is used when you make a creation
SAMPLING LAYER
Samples of equal size are read from the analog image and assigned to pixels.
What is the most important quality of lossless compression?
The data is transformed to usually make it smaller. It can always be re-constructed back to the original.
Creative Commons
a license that allows you to freely use materials created by others.
Modern car odometers can record up to a million miles driven. What happens to the odometer reading when a car drives beyond its maximum reading?
The odometer resets to zero when a car drives beyond the odometers maximum reading possible( a million miles).
BINARY LAYER
The red, green, and blue values are represented using a sequence of binary numbers and sent out via electrical signals.
"The binary pattern 01000001 represents the number 65." Write a brief response explaining whether you believe this statement is always true. Explain your reasoning.
This statement is not always true because you have to know the coding scheme first beforehand to know what the binary number for 65 is.
When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
You cannot create all possible fractions because their are fractions such as 1/3 which is 1.333... to infinity so no number of digits in the decimal and binary system can represent 1/3.
What forms of citations are there?
link, description of where you found the source
Develop a protocol that allows the user to send a calendar date (mm/dd). What is the minimum number of bits necessary?
month (12 values, 4 bits) Day (31 values, 5 bits) 4+5=9 bits
How many bits would it take to encode 2^n-1 posibilities?
n bits
Open Access
online research output free of restrictions to access and use
What are the pros and cons of sampling an image more frequently?
pro: more detailed image con: more time and effort goes into making image
Open Source
programs that are made freely available and may be redistributed and modified
what is the most important thing to remember when citing your sources?
provide as much information as possible about the materials you are using.
An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When they attach the file to their email, it shows as 750 bytes. The author gets very upset because they are concerned that part of their book has been deleted by the email address. If you could talk to this author, how would you explain what is happening to their book?
words that are repeated in your book and other patterns are being decompressed but it is the same book, the same text.
When should you use lossy compression?
you should use lossy compression when the image your representing is not very important.