instagram

(Also available in WeScheme)

Students build upon their understanding of Booleans and simple inequalities to compose compound inequalities using the concepts of union and intersection.

Lesson Goals

Students will be able to:

  • Understand how the conjunctions and and or differ

  • Describe how functions can work together

  • Describe the solution set of a compound inequality

Student-Facing Lesson Goals

  • Let’s use two or more inequalities together.

  • Let’s learn the difference between how and and or are used in programming.

  • Let’s find solutions and non-solutions for compound inequalities.

Materials

Supplemental Materials

Glossary
compound inequality

an inequality that combines two simple inequalities using and or or

function

a relation from a set of inputs to a set of possible outputs, where each input is related to exactly one output

union

the set of values that makes either or both of a set of inequalities true

🔗Introducing Compound Inequalities

Overview

Students consider the need to compose inequalities, and think about how to write them.

Launch

We use inequalities for lots of things:

  • Is it hot out? (๐‘ก๐‘’๐‘š๐‘๐‘’๐‘Ÿ๐‘Ž๐‘กu๐‘Ÿ๐‘’ > 80ยฐ)

  • Did I get paid enough for painting that fence? (๐‘๐‘Ž๐‘–๐‘‘ โ‰ฅ $100)

  • Are the cookies finished baking? (๐‘ก๐‘–๐‘š๐‘’๐‘Ÿ = 0)

What other examples can you come up with?

Many times we need to combine inequalities:

  • Should I go to the beach? (๐‘ก๐‘’๐‘š๐‘๐‘’๐‘Ÿ๐‘Ž๐‘กu๐‘Ÿ๐‘’ > 80ยฐ and ๐‘ค๐‘’๐‘Ž๐‘กโ„Ž๐‘’๐‘Ÿ = "๐‘ u๐‘›๐‘›๐‘ฆ")

  • Was this burrito worth the price? (๐‘ก๐‘Ž๐‘ ๐‘ก๐‘’ = "๐‘‘๐‘’๐‘™๐‘–๐‘๐‘–ou๐‘ " and ๐‘๐‘Ÿ๐‘–๐‘๐‘’ leq $15)

Can you think of examples of when we might want to combine inequalities?

Guide students through other examples of and and or with various statements, such as:

  • "I’m wearing a red shirt AND I’m a math teacher, true or false?"

  • "I’m an NBA basketball star OR I’m having pizza for lunch, true or false?"

This can make for a good sit-down, stand-up activity, where students take turns saying compound Boolean statements and everyone stands if that statement is true for them.

Investigate

Both mathematics and programming have ways of combining - or composing - inequalities.

Synthesize

Be really careful to check for understanding here.

  • Expressions using and only produce true if both of their sub-expressions are true.

  • Expressions using or produce true if either of their sub-expressions are true.

Strategies for English Language Learners

When describing compound inequalities, be careful not to use "English shortcuts". For example, we might say "I am holding a marker and an eraser" instead of "I am holding a marker and I am holding an eraser." These sentences mean the same thing, but the first one obscures the fact that "and" joins two complete phrases. For ELL/ESL students, this is unecessarily adds to cognitive load!

🔗Solutions and Non-Solutions of Compound Inequalities

Launch

Investigate

When students click "Run", four graphs will appear. The top two are the simple inequalities they’ve just discussed. Encourage students to verify that their solutions and non-solutions are correct.

  • The bottom two graphs are produced by the special functions and-intersection and or-union.

  • Read the comments in the Definitions area with your partner to learn how these functions are supposed to work.

  • Then complete Exploring Compound Inequality.

  • Why is the circle on 5 red and the circle on 15 green?

    • The circle on 5 is red because 5 is not part of the solution - it is not bigger than itself.

    • The circle on 15 is green because 15 is part of the solution - it is less than or equal to 15.

  • Why isn’t there a solution to ๐‘ฅ < 5 ๐‘Ž๐‘›๐‘‘ ๐‘ฅ โ‰ฅ 15

    • There aren’t any numbers that are both smaller than 5 and greater than or equal to 15, so there is no solution!

or-union takes in two functions and a list of numbers and produces a graph with the points and the shaded union of values that make either or both of the inequalities true.

In order to make an or statement true, a value only has to make one of the inequalities true.

A compound inequality displayed on a number line, shaded when numbers are below 5 or greater than 15. The dot on 5 is red and the dot on 15 is green.x < 5 or x ≥ 15

Sometimes unions are represented by two separate arrows pointing in opposite directions with a gap between their starting points.

A compound inequality displayed on a number line, shaded when numbers are below 3. The dots on 3, 3.5, 4 and 5 are red and the dots on -5, -2.1, 0 and 1 are green.x < 1 or x < 3

Sometimes unions overlap and appear as a single arrow pointing in one direction.

A compound inequality displayed on a number line, showing an infinite unionx > 5 or x ≤ 15

Sometimes unions overlap and cover the entire number line!

  • Why is the whole graph of ๐‘ฅ > 5 o๐‘Ÿ ๐‘ฅ โ‰ค 15 shaded blue?

    • Because every number in the universe is either greater than 5 or less than or equal to 15, so there aren’t any non-solutions!

Once students are familiar with the starter file, they are ready to use it as they practice identifying solutions and non-solutions for compound inequalities.

Instead of defining two functions as simple inequalities, we can produce an inequality graph by defining one function to be a compound inequality!

In the following activity, we’ll analyze inequality graphs and define a single function that produces the graph.

Walk students through the completed first example before they attempt to write this code on their own.

Synthesize

  • How did the graphs of intersections and unions differ?

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.