# '16-'17 General Discussion for Lesson 2.2

**URL:** <https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149>\
**Category:** Unit and Lesson Discussion\
**Tags:** csp-unit-2, csp-unit-2-lesson-2\
**Created:** [August 19, 2016, 2:17am UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149 "2016-08-19T02:17:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brook](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/brook/32/88_2.png) [@brook](https://forum.code.org/u/brook)\
**Post date:** [August 19, 2016, 2:17am UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/1 "2016-08-19T02:17:09Z")

</div>

Use this thread to discuss your questions and comments about **_how to run the lesson._**

---

<div class="post-metadata">

**Author:** ![brook](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/brook/32/88_2.png) [@brook](https://forum.code.org/u/brook)\
**Post date:** [September 28, 2016, 2:21pm UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/2 "2016-09-28T14:21:44Z")

</div>



---

<div class="post-metadata">

**Author:** ![carmichaelc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/carmichaelc/32/921_2.png) [@carmichaelc](https://forum.code.org/u/carmichaelc)\
**Post date:** [October 7, 2016, 3:29pm UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/3 "2016-10-07T15:29:12Z")

</div>

Yes! Questions for the responses are now in the downloadable csv file! I hope this is throughout. I download the questions to review the responses and sometimes several stages at a time so this is a big help! Thanks so much!

---

<div class="post-metadata">

**Author:** ![cgjkdale](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cgjkdale](https://forum.code.org/u/cgjkdale)\
**Post date:** [January 15, 2017, 9:55pm UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/4 "2017-01-15T21:55:35Z")

</div>

For my heuristic,  
I. compressed phrases that repeated  
2. compressed words that repeated  
3. compressed parts of words that appear repeatedly  
watch how much each of these contribute to the compression. My compression was 34.17%.

I realized that some words actually reduced rather than increasing the text compression.

Is the data getting lost? redirecting-why or why not would this process result in data being lost?  
How can data be reconstructed? Using the dictionary

---

<div class="post-metadata">

**Author:** ![lisha.johnson](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/32.png) [@lisha.johnson](https://forum.code.org/u/lisha.johnson)\
**Post date:** [February 7, 2017, 3:10am UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/5 "2017-02-07T03:10:41Z")

</div>

I compressed the poem, “She Sells Sea Shells”. I was able to get 25.84%. However, as I tried to add additional repeated patterns to the dictionary, the compression percentage went down.

My heuristic boiled down to the following steps:

1. I looked for repeated phrases first and added them to the dictionary
2. As I added phrases and/or words to the dictionary, I monitored the Compression %.
3. If something I put in reduced the compression rate, I took it out of the dictionary.
4. I continued compressing with additional repeated words.

Reminding the students that trial and error is okay and that it will add to the challenge of these activities.

---

<div class="post-metadata">

**Author:** ![baker](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/baker/32/1229_2.png) [@baker](https://forum.code.org/u/baker)\
**Post date:** [February 7, 2017, 3:43am UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/6 "2017-02-07T03:43:25Z")

</div>

So this is the thing about this kind of text compression…there is always a tipping point where the amount of stuff in the dictionary overwhelms the benefits of the compression. (extreme example: if you added each individual character of the alphabet to the dictionary, you’ve now at least doubled the size of the “compressed” version since you now have to account for two characters were there was just one.

So what you want is to substitute a single characters for as many large groups of characters as possible.

What’s nuts is that there is no way to know what’s best, and what you choose to substitute first makes a difference. But you always reach the tipping point. For example, I’ve attached a screenshot of a way to do “she sells sea shells” that gets ~40% compression. And I followed basically the same heuristic you outlined!

 ![](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/7/74e68fc3625175a813a24ab1d8ba372987e6be77.png)

---

<div class="post-metadata">

**Author:** ![jbeckenbach](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jbeckenbach](https://forum.code.org/u/jbeckenbach)\
**Post date:** [February 25, 2017, 2:03am UTC](https://forum.code.org/t/16-17-general-discussion-for-lesson-2-2/5149/7 "2017-02-25T02:03:34Z")

</div>

My heuristic was to:  
Look for repeating word combinations  
Look for basic words
