Mathematical Methods - mav.vic.edu.au · PDF fileJosephus Problem. The siege at Yodfat:...

Preview:

Citation preview

Peter Foxp-fox@ti.com

MAWA 2017

Coding

Critical Thinking

Reasoning

Problem Solving

Coding

Contextualise and de-contextualise problems

Coding

Persevere on a Task

Coding

Design

Build

Test

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

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

100 Problems worth Coding

100 Problems worth Coding

100 Problems worth Coding

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!

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!

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’.

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

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

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

Letters & Numbers

STARTSTOP

Letters & Numbers

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

Letters & Numbers

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

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

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

Letters & Numbers

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

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

Factors in their Prime

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

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

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

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

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

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

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

Let’s write some code …

Collatz Conjecture

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

Collatz Conjecture

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

Collatz Conjecture

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

Collatz Conjecture

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

Collatz Conjecture

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

Collatz Conjecture

Which numbers can be approached from above and below?

Collatz Conjecture

Write and code your own exploration.

Collatz Conjecture

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

Goldbach Conjecture

For i, 1, n

isPrime(i)

NoDisplay i,n

YesisPrime(n-i)

Next i

No sol.

No

Yes

Goldbach Conjecture

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

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

EndIfEndFor

Goldbach Conjecture

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

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

EndIfEndFor

Goldbach Conjecture

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

Goldbach Conjecture

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

Goldbach Conjecture

Is this the same conjecture?

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

How Long

Generate a sample of size n and compute the average.

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

How Long

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

Chaos

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

Chaos

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

• Selected locations forming a pattern

Chaos

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

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

Drinking Game

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

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

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

Drinking Game

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

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

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

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

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.

Factor Game

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

Player 2:Selects 38

Player 1:Player 2:

49846

70

Factor Game

Player 1:Selects 45

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

Player 1:Player 2:

7046

11578

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

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

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

Factor Game

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

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.

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.

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