CS I · Fri Oct 16 · 11.3 · We Do

Before the bell

You are responsible for all of this before the end of class.

  1. The discussion form in the I Do deck. All three sections. If you are here, this should be done.
  2. Your classwork. This form on the right. Section 1 before the exit ticket pops up; Section 2 past the floor.
  3. No Bench Basics today — this is a short or catch-up day.
  4. The exit ticket. It opens 20 minutes before the bell and lives on the last slide of this deck.
Classwork

Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.

One Wrong Character

This reading describes three kinds of data in which a single changed character makes the information incorrect. Each example is presented once in its correct form and once with exactly one character changed.

A Bank Record and a Password

A bank record stores an account balance as a number, written to the cent. Suppose the correct record reads 1,250.00 dollars and one digit is changed, so the record reads 7,250.00 dollars. The record now reports 6,000 additional dollars that the account does not actually contain. NIST describes data integrity as the property that data has not been changed, destroyed or lost by accident or without permission. A bank record with one changed digit has lost its integrity.

A password follows the same principle. NIST guidelines require an authentication system to verify the entire password a person enters, without cutting off any part of it. If an account's password is Lake7river and a person types Lake8river, one character is different, and the sign-in fails.

A Line of HTML

The third example is a line of HTML from Picking Fruits, a student game built in September for the class arcade. The correct line is `<h1>Picking Fruits</h1>`, which makes the game's title a heading. In the changed line, the slash in the closing tag is missing, so it reads `<h1>Picking Fruits<h1>`. Without the slash, the browser interprets the second tag as the beginning of a new heading instead of the end of the first one.

The HTML standard tells the browser exactly what to do next. First, the browser closes the first heading. Then it opens a second heading, and every element after it on the page is placed inside that second heading. When both versions were tested on a plain page in the Chrome browser, the broken page still loaded and displayed no error message. However, the game's instruction "Tap the screen to start" appeared in large bold heading type instead of ordinary paragraph text.

Sources: NIST, Data integrity (n.d.); NIST, SP 800-63B-4 (2025); WHATWG, HTML Parsing (2026); Muggivan, HTML test (2026).

Lossy Compression in Everyday Use

This section explains where lossy compression is used in everyday life and where it cannot be used. Compression is a way of making a file smaller so that it takes less space and sends faster. Lossless compression makes a file smaller in a way that lets the computer rebuild the original file exactly. Lossy compression also makes a file smaller, but the file that comes back is not identical to the original, because some detail has been removed.

File Size and Quality

File size is the amount of storage space a file takes up, counted in units such as kilobytes (KB), megabytes (MB) and gigabytes (GB). Quality is how much of the original detail a copy keeps. For example, Netflix lists its basic video quality at up to 0.3 GB of data per hour and its high-definition quality at up to 3 GB per hour. The high-definition copy keeps more detail, so its file size is larger. Music works the same way. Spotify lists its Low setting at about 24 kilobits per second and its Very high setting at about 320 kilobits per second. A copy that keeps every detail and stays the same size is not an example of lossy compression, because nothing was removed.

Lossy Compression in Everyday Places

Lossy compression is used in many everyday places. The first is a song on a streaming app. Apple Music offers lossless audio only as a setting the listener turns on, and Apple states that lossless streaming uses significantly more data and more storage space. A song at a lower setting is a smaller file that does not keep every detail of the original recording.

The second is a video that turns blurry when the wifi gets weak. A streaming service stores the same video as several versions, and each version is encoded at a different bit rate. When the connection gets weak, the video player switches to a lower-quality version of the video that needs less data each second. The service is sending a different, smaller version that was prepared in advance.

The third is a photo in a group chat. Google Messages offers two choices when a person sends a photo. The "optimized for chat" choice sends faster and uses less data, and the "original quality" choice sends the photo at its full resolution. Google also states that phone carriers compress photos sent as MMS messages, which can lower image quality.

The fourth is a one-page summary of a long book. A summary is not compression in the technical sense, because no computer method is applied to a file. It works like lossy compression, though. A summary gives only the main points of a text and leaves out the details, and those details cannot be rebuilt from the summary alone.

Trade-offs

Each of these four cases is a trade-off. A trade-off is a choice in which getting more of one thing means getting less of another. In lossy compression, the file size gets smaller and the quality gets lower. Spotify states the trade-off directly: higher streaming quality uses more data, and higher download quality uses more space. A person or a program chose how much quality to give up. The listener picks a setting, the video player picks a version and the sender picks a photo choice. Figure 1 shows the four everyday examples placed along a slider, with a smaller file at one end and higher quality at the other.

Data That Cannot Lose Detail

Some kinds of data cannot lose any detail at all. A bank balance must keep every digit, even if a smaller file size were possible, because a balance of 1,250 dollars with one digit changed is a different amount of money. The National Institute of Standards and Technology (NIST) describes data integrity as the property that data has not been changed, destroyed or lost by accident or without permission. A password has no lower-quality version, because NIST guidelines require a system to check the entire password that a person types. A line of code is not a trade-off case, since nothing in it can be given up. The HTML standard sets exact rules for reading every tag, so a tag with one missing character can make the browser build a different page. Figure 1 lists these three cases below the slider as data that allows no loss.

Two questions apply to any copy of a file. The first asks what detail was lost. The second asks whether that detail matters for the way the copy will be used.

Summary

Lossy compression makes files smaller by giving up detail, and it is used for songs, streaming video and photos in chats. Each use is a trade-off between file size and quality that a person or a program chose. Bank balances, passwords and code cannot lose a single digit or character, so they are never stored with lossy compression.

Sources: ITU-T, T.81 (1992); Pantos and May, RFC 8216 (2017); Netflix, Data use (n.d.); Spotify, Audio quality (n.d.); Apple, Lossless audio (2026); Google, Messages photos (n.d.); Oxford, summary (n.d.); NIST, Data integrity (n.d.); NIST, SP 800-63B-4 (2025); WHATWG, HTML Parsing (2026); CompTIA, Tech+ Objectives (2023); Muggivan, HTML test (2026).

Classwork · Section 1 — Reading 2

Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.

MC 1. (Case 1 · group-chat photo) You send a photo to a group chat, and the app sends a smaller copy that is optimized for chat. Is loss fine here, or is no loss allowed?

  • Loss is fine here
  • No loss allowed

CR 1. (Case 1 · reason) Give one reason for your answer to MC 1. Use one fact from Reading 2, the passage or Figure 1.

Write your answer in your lab notebook, labeled CR 1.

MC 2. (Case 2 · bank balance) A bank stores the balance of your savings account. Is loss fine here, or is no loss allowed?

  • Loss is fine here
  • No loss allowed

CR 2. (Case 2 · reason) Give one reason for your answer to MC 2. Use one fact from Reading 2.

Write your answer in your lab notebook, labeled CR 2.

MC 3. (Case 3 · song on a playlist) A song on your streaming playlist plays at the app's Normal quality setting instead of Lossless. Is loss fine here, or is no loss allowed?

  • Loss is fine here
  • No loss allowed

CR 3. (Case 3 · reason) Give one reason for your answer to MC 3. Use one fact from the passage or Figure 1.

Write your answer in your lab notebook, labeled CR 3.

MC 4. (Case 4 · password) A website stores the password for your school account. Is loss fine here, or is no loss allowed?

  • Loss is fine here
  • No loss allowed

CR 4. (Case 4 · reason) Give one reason for your answer to MC 4. Use one fact from Reading 2.

Write your answer in your lab notebook, labeled CR 4.

MC 5. (Case 5 · line of code) Your game is saved as HTML, and one of its lines is <h1>Picking Fruits</h1>. Is loss fine here, or is no loss allowed?

  • Loss is fine here
  • No loss allowed

CR 5. (Case 5 · reason) Give one reason for your answer to MC 5. Say what the browser did with the broken line in Reading 2.

Write your answer in your lab notebook, labeled CR 5.

MC 6. (Case 6 · video call) During a video call on a weak connection, the call app lowers the picture's resolution so the call keeps going. Is loss fine here, or is no loss allowed?

  • Loss is fine here
  • No loss allowed

CR 6. (Case 6 · reason) Give one reason for your answer to MC 6. Use Figure 1 or the passage's weak-wifi video example.

Write your answer in your lab notebook, labeled CR 6.

Figure 1. Three everyday uses of lossy compression and a book summary sit on a slider between a smaller file and higher quality, and three kinds of data that allow no loss sit below the slider.
Classwork · Section 2 — Past the floor

Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.

CR 7. (Trade-off 1 · song on a playlist) For the song in Case 3, say what was traded away and what was gained. Use the words file size and quality. Use one fact from the passage.

Write your answer in your lab notebook, labeled CR 7.

CR 8. (Trade-off 2 · video call) For the video call in Case 6, say what was traded away and what was gained. Use the words file size and quality. Explain how this is like the weak-wifi video in the passage.

Write your answer in your lab notebook, labeled CR 8.

Bench Basics

No bench today

There is no bench on this day. Finish your classwork and move to the exit ticket.

No bench today — the bench pop-up is off for this day.

Classwork

Sign out of Google when you finish on a shared computer, so the next student can sign in as themselves. Google then shows a "Redirect notice" page. Click the muggsofcompsci.net/cs1 link on it to come back.

Exit Ticket

This opens during your class period.