**SETS & BOOLEAN ALGEBRA**

Sets of numbers are beautiful, especially on a grid.

**EXPLORE SETS AND SUBSETS ON A GRID**

**1.** Go to researchideas.ca/numbers. Click on Example #1. Notice that the conditional statement **if-do** determines which numbers are decorated. Change values and click Run Code to see the effect. For example, change the Repeat number or Gork colour.

a) What do you think **number mod 3 = 0** means?

b) Edit the code to get the pattern below.

**2.** Go to researchideas.ca/numbers. Click on Example #2.

a) Run the code to see the pattern created.

b) Notice that the conditional statement **if-do-else**. Edit the code to get this pattern:

**3. **Go to researchideas.ca/numbers.** **Click on Example #3.

a) Run the code to see the pattern created.

b) What does the conditional code **if ___ and ___** do?

c) Edit the code to get this pattern.

**SOLVE PUZZLES**

The Numbers Patterns app has built-in puzzles to challenge you.

Puzzles look like the image below, where the number pattern you have to match is circled.

The code below would solve the puzzle, by shading the circled squares.

**4.** Try a puzzle. Go to researchideas.ca/numbers. Click on New Puzzle.

a) Study the pattern of circled numbers.

b) Create code that decorates the circled numbers.

**CREATE PUZZLES FOR OTHERS TO SOLVE**

**5.** Go to researchideas.ca/numbers.

a) Create your own puzzle. Then, save and share for others to solve.

b) Here is some sample code to try. The puzzle it would create is shown below the code.

c) Here is some sample code to try. The puzzle it would create is shown below the code. Notice that this puzzle uses circles of 2 different colours.

**NAMING AND SAVING YOUR PROJECT**

You can change the name of your project by clicking on Project Name.

To save your project, click on Save Code.

- You will have the chance to rename your project when saving.
- After saving your project, a link to it will appear below the project name.
- Copy and share this link for others to see see your work or to solve a puzzle you have created.

**VENN DIAGRAMS**

We can use Venn diagrams to visually represent relationships between sets of numbers.

For example, the overlapping region below represents all the numbers that belong to both set A and set B.

A = {1, 2, 3, 4}

B = {3, 4, 5, 6}

Let’s look at two new sets, C and D:

C = {20, 30, 40}

D = {40, 50, 60, 70}}

Where would these numbers fit in the Venn diagram below?

**BOOLEAN ALGEBRA**

Let’s look at sets A and B:

A = {1, 2, 3, 4}

B = {3, 4, 5, 6}

Here are 3 examples of relationships:

A

ANDB = {3, 4}A

ORB = {1, 2, 3, 4, 5, 6}A

NOTB = {1, 2}

**AND**, **OR** and **NOT** are 3 examples of **operators** we can use to create relationships between sets.

Let’s look at two new sets, C and D:

C = {20, 30, 40}

D = {40, 50, 60, 70}}

What would be the resulting sets in each of these relationships?

C

ANDD = { …………….}C

ORD = { …………….}C

NOTD = { …………….}

All of this is part of the branch of mathematics called **Boolean Algebra**.