U1 L5 - overflow and rounding

Can someone tell me what the students should get out of this lesson? Is it to be able to identify which type of error they are encountering (overflow or rounding) or more about why these errors occur?

Thanks

@ktpanderson Thanks for asking this question. This lesson is about limitations. The point of the lesson is to make students aware of both errors and why they occur. One of the limitations computers have is accurately rounding off some numbers. When computers deal with decimal numbers, storing them in binary gets tricky and errors occur. Using the examples from the lesson, your students know they can any number they want on the Flippy Do. They should also recognize that they cannot represent all decimal numbers on the Flippy Do Pro. This isn’t possible because of how those numbers are stored in binary. On the Flippy Do Pro, you can represent .25, .50, and, .75. However, we cannot represent .33. If the computer cannot accurately represent this number, it presents a number close to .33. This is an example of the rounding error. To explain the rounding error a little further, here is a [ link ] to a short video. The language being used is java. However, the concept applies universally.

Both of these concepts may be on the AP exam so they need to know about it. It is a nuts and bolts concept related to everything is binary.

There are two common situations where we need to deal with these two concepts. When working close to the hardware aka firmware. When working with money in a language that doesn’t explicitly handle representations of money.

In the context of programming in App Lab all numbers are double float. Overflow is unlikely and rounding isn’t noticeable very often. It is unlikely your students will encounter these problems in the programming units.

Thanks! I presented it today and was able to focus on limiting the number of bits forcing the rounding. I think the Pie slices examples helped to drill it down. We did those as a class and I felt better about my explanations.

1 Like

Does anyone have a link to a video (or any other information) for the “pie slices example”? Thank you!

One great place to go with this is the Y2K Bug. People assumed it was a rollover error because early computers were designed to save memory by not storing four-digit years, but that turns out to be wrong. The real answer requires an understanding of binary and the fact that what was REALLY being saved was people having to key in years when their computers did not have battery-operated clocks to remember the date and time.

I use a few videos:

Video 1: intro (until we flip over), then skip to T=14:23

Video 2: Start at T=74, end at 2:47

Video 3: Give this as a homework assignment, student has to explain it to the class or write an explanation or video one …