π txt cmprssn
Unit 4 β Representation | February 06π― Learning Targets
AP
I can analyze how data representation, storage, security, and transmission of data involve computational manipulation of information.
AP
I can use computers to process information, find patterns, and test hypotheses about digitally processed information to gain insight and knowledge.
I can develop a strategy (heuristic algorithm) for compressing text.
Do now
SMH. LOL.
Why do we use abbreviations in texts?
πText Compression
We βcompressβ txt 2 save time. Computers do it too, to save time and space.
Compression: represent data with fewer bits. Why might that be useful? Think about the Bytes & File Sizes research that you did.
Decode Text
I wish I was a little bit taller
I wish I was a baller
I wish I had a girl who looked good, I would call her
I wish I had a rabbit in a hat with a bat
And a six four Impala
Symbol | Value |
---|---|
β | I_ |
β | wish_ |
β | aller_ |
β | was_a_ |
β | had_a_ |
β | _a_ |
ββββlittle_bit_tβββββbβββββ girl_who_looked_good,βwould_call_herββββ rabbit_inβhat_withβbat_Andβsix_four_Impala
Original text size: 172 bytes
Compressed text size: 111 bytes
So we saved 61 bytes, right?
WRONG
We also need to let our recipient decode our message.
Dictionary size: 34 bytes
Total: 145 bytes
Compression: 27 bytes, or 15.75% !!
π txt cmprssn
Choose a text from English class and try to compress
it.
Your goal is to get the highest compression rate. Keep note of your strategy.
Whatβs the best compression scheme?
Heuristic
a problem solving approach (algorithm) to find a satisfactory solution where finding an optimal or exact solution is impractical or impossible.
What kind of scenarios is our heuristic good for?
You could very easily create a βcompressedβ file thatβs BIGGER than the original!
Questions
- What did all groupsβ processes for compression have in common?
- Will following this process always lead to the same compression?
- If you send the compressed poem, would your friend will be able to read it? Why is the dictionary important?
- Why do you want to compress anything? Whatβs the point?
Case Study
A simple message has been compressed below:
What was the original message?
What was the compression rate?