64
Peter Fox [email protected] MAWA 2017

Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

  • Upload
    lykhanh

  • View
    216

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Peter [email protected]

MAWA 2017

Page 2: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Coding

Critical Thinking

Reasoning

Problem Solving

Page 3: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Coding

Contextualise and de-contextualise problems

Page 4: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Coding

Persevere on a Task

Page 5: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Coding

Design

Build

Test

Page 6: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

ProgrammingTI-CodesFree getting started lessons and activities, complete with teacher notes!

http://education.ti.com/aus-nz/ticodes

Page 7: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

100 Problems worth Coding

Page 8: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

100 Problems worth Coding

Page 9: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

100 Problems worth Coding

Page 10: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

What’s so special about: 739 397 ?

Special Numbers

Is 739 397 prime?Successively removing the most significant digit (left) and the resulting number is still prime!

Page 11: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

What’s so special about: 739 397 ?

Special Number

Is 739 397 prime?Successively removing the least significant digit (right) and the resulting number is still prime!

Page 12: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Can you find some other numbers that are left and right reducing prime? Could you write a program to search?

Special Number

TI-Nspire is a mathematics tool and includes an ‘IsPrime’ command.

Write a program to check primality and use it as a ‘sub-routine’.

Page 13: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Six ‘random’ numbers are drawn consisting of a nominated quantity of ‘large’ and corresponding quantity of small numbers.Large: {25, 50, 75, 100}Small: {1, 2, 3 … 9, 10}

No RepeatsRepeats Allowed

Letters & Numbers

Page 14: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

A three digit target number is generated. Contestants use the numbers and basic operations: { + – × ÷ ( ) } to form an equation equal to, or as close to, the target number.

Letters & Numbers

Page 15: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Let’s play a game!60 seconds on the clock!100 Pts = Exactly correctOne point is deducted for each unit away from

Letters & Numbers

Page 16: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

STARTSTOP

Letters & Numbers

Page 17: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Sometimes it can be very difficult to solve the problem in the allocated time.

Letters & Numbers

Page 18: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

How many points would it be worth if you could ‘buy’ an extra number?How many points would it be worth to buy an extra mathematical operator?

Letters & Numbers

Page 19: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Mathematical expressions can only use: + − ÷ × ()

The problem is not always solvable … particularly in 60 seconds!

Letters & Numbers

Page 20: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Find a rule that uses the prime factorisationof a number to predict the total quantity of factors for the given number.

Factors in their Prime

Page 21: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Write a program that determines the quantity of factors for a given number.

Factors in their Prime

Page 22: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Use the factor command to determine the prime factorisation of each of the following numbers: 36, 196, 1089, 484Check the number of factors for each.

Factors in their Prime

Page 23: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Use the factor command to determine the prime factorisation of each of the following numbers: 252, 300, 1575, 1452Check the number of factors for each.

Factors in their Prime

Page 24: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Look at the data.What part(s) of the prime factorisationshould we explore if we are seeking to find a ‘rule’ for the quantity of factors?

Factors in their Prime

Page 25: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Roll a die … you score the number appearing uppermost, unless it is a two. If you roll a two your out and your score is set to zero. You keep rolling, adding to your score … until you decide to ‘sit’.

Greedy Pig

Page 26: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Play a game, highest score wins!If you played lots of games and the overall winner was the person with the highest average score … what would be a winning strategy?

Greedy Pig

Page 27: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Start with any positive integer n, • If n is even then divide by 2.• If n is odd, multiply by 3 and add 1.Repeat this process... you will eventually arrive at 1. (Conjecture)

Collatz Conjecture

Page 28: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Collatz ConjectureNumber

x 3 + 1

= 1 ?

NO÷ 2

YESEVEN

Number

FinishYES

Input "NUMBER ",NWhile N>1

If remainder(N,2)=0 : ThenN/2→N

Else3*N+1→N

EndDisp NEnd

Page 29: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Let’s write some code …

Collatz Conjecture

Page 30: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

What is the largest sequence produced by a two digit number?

Collatz Conjecture

Page 31: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Graph the term number against the value of the term … Why does the sequence always decrease immediately after an increase?

Collatz Conjecture

Page 32: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Do prime numbers generate longer sequences than composite numbers?What types of numbers generate the longest sequences?

Collatz Conjecture

Page 33: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Can you have a sequence with more odd numbers than even?Compare the occurrence of odd numbers and even numbers in sequences.

Collatz Conjecture

Page 34: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Are the any sequences that share the same value as the starting number?

Collatz Conjecture

Page 35: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Which numbers can be approached from above and below?

Collatz Conjecture

Page 36: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Write and code your own exploration.

Collatz Conjecture

Page 37: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Every even number greater than 2 can be written as the sum of two prime numbers.

Goldbach Conjecture

Page 38: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

For i, 1, n

isPrime(i)

NoDisplay i,n

YesisPrime(n-i)

Next i

No sol.

No

Yes

Goldbach Conjecture

Page 39: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Request "Enter a number",nFor i,2,n

If isPrime(i) and isPrime(n – i) ThenDisp i, n – i

EndIfEndFor

Goldbach Conjecture

Page 40: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Request "Enter a number",nFor i,3,n,2

If isPrime(i) and isPrime(n – i) ThenDisp i, n – i

EndIfEndFor

Goldbach Conjecture

Page 41: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

As the magnitude of n increases, on average, are there more or less solutions?

Goldbach Conjecture

Page 42: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

“Every odd number greater than 5 can be written as the sum of three primes.”

Goldbach Conjecture

Is this the same conjecture?

Page 43: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Two points are placed randomly inside a 1cm x 1cm square. What is the average distance between the two points?

How Long

Page 44: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Generate a sample of size n and compute the average.

Generate multiple samples of size n and store them in a list.

How Long

Page 45: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

A triangle with vertices A, B & C is drawn on the Cartesian plane. Point P is randomly placed within the triangle.

Chaos

Page 46: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Randomly select a vertex. Point P is relocated half way between the current location and the vertex. This process is repeated …

Chaos

Page 47: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Where will the points appear in the triangle?• Everywhere – randomly

• Selected locations forming a pattern

Chaos

Page 48: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

1 2 3 4 5 61

Roll the dice… if the glass is empty, fill it up; if the glass is full… drink the contents. The game ends the instant all glasses are full. How many glasses would you expect to drink?

354516213

Drinking Game

Page 49: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Consider a list:cups:={0,0,0,0,0,0}

Drinking Game

What is this command doing?While sum(cups)<6 …

Page 50: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

What about this set of commands?c:=randint(1,6)If cups[c]=0 Then

cups[c]:=1Elsecups[c]:=0Endif

Drinking Game

Page 51: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Write a program that generates a simulation of the drinking game displaying the progressive results and … when the game is over … the number of glasses consumed.

Drinking Game

Page 52: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Edit the program so that it generates multiple results from games and stores them in a list. Note: Do not display progressive glass status.

Drinking Game

Page 53: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Alex and his friend Gustav have a wager … They toss a single coin repeatedly until their selected sequence of 3 events is generated. Gustav says he would like to bet on the sequence: “H, T, H”. Alex chooses “T, T, H”. Is the game fair?

Penny’s Problem

Page 54: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Edit the program so that it generates multiple results from games and stores them in a list. Note: Do not display progressive glass status.

Activity coming soon …

Penny’s Problem

Page 55: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor Game

Player 1:Selects 49

Player 2:Sum of factors: {1, 7}

Player 1:Player 2:

498

Must select a number that has a proper factor available.

Page 56: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor Game

Player 1:Sum of factors: {2, 19}

Player 2:Selects 38

Player 1:Player 2:

49846

70

Page 57: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor Game

Player 1:Selects 45

Player 2:Sum of factors: {3,5,9,15}

Player 1:Player 2:

7046

11578

Page 58: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor GameYour turn…Play against a partner or play against the calculator.

Page 59: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor GameDoes an automatic scoring system change the level of thinking?

Page 60: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor GameDoes an automatic scoring system change the level of thinking?

Page 61: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Factor Game

Write a program … so a single user can play against the calculator. This is a level of ‘artificial intelligence’.

Page 62: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Josephus ProblemThe siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier, he killed the soldier sitting to his left (soldier 2) and so forth around the circle leaving only one soldier to be captured.

Page 63: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Josephus ProblemThe siege at Yodfat: As Josephus lived to tell of the ritual, where was he sitting?Write a program to explore ‘any’ number of soldiers.

Page 64: Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat: Preferring suicide to capture, the 40 soldiers stood in a circle. Starting with the first soldier,

Josephus ProblemActivity coming soon …You may also like to explore LUA coding. A sample code in Lua (not for TI but helpful) can be found at: https://rosettacode.org/wiki/Josephus_problem#Lua