๐Ÿ‘ฉโ€๐Ÿซ

Coding + Math = Super Powers!

Applying Coding to Solve Math Problems
With your kind teacher Mrs. Brenda โค๏ธ

Hi my brilliant Grade 6 mathematicians and coders! ๐Ÿ‘‹

Today weโ€™re going to discover how coding helps us solve math problems quickly and accurately! Instead of doing long calculations by hand, we can write a short program that does the hard work for us. This is real-life math + coding magic! โœจ

๐Ÿง  + ๐Ÿ’ป = ๐Ÿš€

1. Why Use Coding for Math?

2. Example 1: Sum of First N Numbers

Find the sum of numbers from 1 to 20.

total = 0
for number from 1 to 20:
    total = total + number
print("The sum is", total)

3. Example 2: Multiplication Table

Create the 7 times table up to 12.

for i from 1 to 12:
    print(7, "ร—", i, "=", 7 * i)

4. Example 3: Finding Factors of a Number

Find all factors of 36.

number = 36
for i from 1 to number:
    if number % i == 0:
        print(i)

5. Letโ€™s Practice Together! ๐ŸŽ‰

Practice 1

What is the sum of numbers from 1 to 50?

1275
(We can use the formula nร—(n+1)/2 = 50ร—51/2 = 1275)

Practice 2

Write a small code idea to check if 48 is even or odd.

if 48 % 2 == 0:
    print("Even number!")
โ†’ Even number!

Challenge

How many multiples of 5 are there from 1 to 100?

20 multiples
(100 รท 5 = 20)

6. Real Life in Canada ๐Ÿ‡จ๐Ÿ‡ฆ

โ€ข Calculating total cost with taxes
โ€ข Finding how many school days are left in the year
โ€ข Making a simple budget planner for your allowance
โ€ข Predicting patterns in sports scores

You are now a Math + Coding Superstar! ๐ŸŒŸ

Every time you use coding to solve a math problem, you become smarter and faster!

Keep practicing and you can create anything you imagine.

Love and proud high-fives,
Mrs. Brenda โค๏ธ

๐Ÿงฎ๐Ÿ’ปโœจ