solving maths problems without the techniques you learned at … · 2019. 12. 7. · solving maths...

28
Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted Education Jonathan Tsai University of Hong Kong [email protected] 7 December, 2019 Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 1 / 28

Upload: others

Post on 11-Apr-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Solving maths problems WITHOUT the techniquesyou learned at school.

Hong Kong Academy of Gifted Education

Jonathan Tsai

University of Hong Kong

[email protected]

7 December, 2019

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 1 / 28

Page 2: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Solving equations exactly

At school, you learned various techniques for solving equations such as:

2x2 + x − 6 = 0 (factorize or quadratic formula)

4x = 37 (logarithms)

cos 4x = sin x (trigonometric identities)

and more...

Furthermore, there are techniques for solving other equations which youare not taught at school e.g.

2x3 − 30x2 + 162x − 350 = 0

cubic formula−−−−−−−−→ x =3

√10 +

√108− 3

√−10 +

√108 + 5

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 2 / 28

Page 3: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Most equations cannot be solved exactly

Many more equations cannot be solved exactly such as

x sin x = x2 + cos x or x5x = x2 + 2x .

In fact, even polynomial equations of degree 5 (quintic) and above such as

x5 + 2x4 − 4x3 + 6x2 − x − 10 = 0

cannot be solved exactly in general*. (The reason for this is the result of adeep theory called Galois theory).

Suppose that a critical mission depends on being to solve a particularequation. What do we do?

* There is a quartic formula though!

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 3 / 28

Page 4: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Solving equations numerically

The critical mission probably doesn’t require an exact solution!

Most likely, an approximate solution to a particular degree of accuracy(e.g. 10 significant figures) is sufficient.

Methods that can find approximate solutions are called numericalmethods.

We now consider the most basic numerical method for solving equations...

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 4 / 28

Page 5: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Trial and error!

We can just try out numbers until we get closer and closer to a solution.

However, numerical methods are applied using computers, we want asystematic method so that one can program a computer to implement it.

Interval bisection

We wish to solve an equation f (x) = 0.

1 Guess the solution to be between two numbers, a0 and b0.

2 Cut the interval into 2 halves: from a0 to the midpoint m0 and fromm0 to b0.

3 Check which half the solution is in by checking the sign of f (x) atthese three points.

4 Name the end points of the new interval a1, b1 and its midpoint m1.

5 Repeat the above steps for the smaller interval.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 5 / 28

Page 6: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Example

Consider the equationx2 = 2⇔ x2 − 2 = 0

A solution is (obviously)√

2 = 1.4142. Let f (x) = x2 − 2.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 6 / 28

Page 7: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Iterative methods

We want to solve an equation of the form

x = f (x).

Convert this to a recurrence relation

xn+1 = f (xn)

1 Start with a guess for the starting value x1.

2 Substitute x1 into this equation to get x23 Substitute x2 into this equation to get x34 Repeat until desired accuracy is reached.

This method works because if xn → x when n→∞, then

xn+1 = f (xn)→ x = f (x)

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 7 / 28

Page 8: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Example

Consider the equation

x2 = 2⇔ x2 − 1 = 1⇔ (x − 1)(x + 1) = 1⇔ x =1

x + 1+ 1.

This becomes

xn+1 =1

xn + 1+ 1.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 8 / 28

Page 9: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Stability

We want numerical methods be fast. But besides this, we want themethod to be stable.

A method is stable if small changes in the input data do not change theoutput data.Method 1: xn+1 = 1

xn+1 + 1

Method 2: xn+1 = 5(x2n − 2)2 + xn

Extreme example: https://www.desmos.com/calculator/unan9xh0og

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 9 / 28

Page 10: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Secant method

We now look at a better numerical method for solving equations:

Secant method

Solve: f (x) = 0

1 Start with two values x1 and x2. Let y1 = f (x1) and y2 = f (x2) bethe respective y -coordinates.

2 Find the line (secant) through (x1, y1) and (x2, y2). We call the pointwhere this line intersects the x-axis x2. Let y2 = f (x2).

3 Find the line through (x2, y2) and (x3, y3). We call the point wherethis line intersects the x-axis x3. Let y3 = f (x3).

4 Repeat until desired accuracy is reached.

Formula:

xn+1 = xn − f (xn)xn − xn−1

f (xn)− f (xn−1)

https://www.desmos.com/calculator/vhuefrwqpf

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 10 / 28

Page 11: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

A modification: Newton-Raphson method *calculus*

Replacing the secants in the previous with tangents we get the followingmethod:

Newton-Raphson method

Solve: f (x) = 0

1 Start with x1. Let y1 = f (x1) be the y -coordinate of this point.

2 Find the tangent to the graph through (x1, y1). We call the pointwhere this line intersects the x-axis x2. Let y2 = f (x2).

3 Find the tangent to the graph through (x2, y2). We call the pointwhere this line intersects the x-axis x3. Let y3 = f (x3).

4 Repeat until desired accuracy is reached.

Formula:

xn+1 = xn −f (xn)

f ′(xn)

https://www.desmos.com/calculator/d4bo9wz49j

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 11 / 28

Page 12: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

A change of direction: finding areas

We now turn to a different problem. Suppose we have a ”strange shape”,for example:

Question: How can we find the area of this shape?

Unless the shape is a ”standard shape” (e.g. circle, polygon,...) or somecombination of these ”standard shapes”, we are unlikely to be able to getthe exact value of its area.

Question: How can we approximate the area of these shapes?

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 12 / 28

Page 13: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Approximating areas

We can do what we did in primary school!

Draw the shape in a grid and count the number squares containing part ofthe region.

To get a more accurate approximation, we simply use a finer grid.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 13 / 28

Page 14: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Example: a circle

As an example, we will calculate the area of a circle of radius 1 in this way(Area = π ≈ 3.1415). Counting the squares that contain part of thecircle:

The method can be improved by using polygons to ”approximate” thecircle instead - this technique was known to the ancient Greeks who usedit to get the formula for the area of a circle.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 14 / 28

Page 15: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Extension to volumes

We can also extend this method to approximate volumes.

Instead of using a 2 dimensional grid, we use a 3 dimensional grid instead.

This is a lot harder to visualize! A computer would have to be used.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 15 / 28

Page 16: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

(Real) motivation *calculus*

Finding areas and volumes don’t seem that useful. However, there is ahidden and extremely important application of this.

You may have learnt that integration may be used to calculate area undera graph. However, this idea is actually the reverse of what happens inpractice. In real-life applications, we use areas to calculate integrals!

This is made extra important by the fact that in many fields of maths, wedon’t want to just solve an equation; we want to solve a differentialequation.

For example, find a function y = f (x) that satisfies:

x2d2y

dx2+ x

dy

dx+ (x2 − v2)y = 0

This the Bessel differential equation.Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 16 / 28

Page 17: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

(Real) motivation *calculus*

Applications of the Bessel differential equation (alone) include:

Electromagnetic waves in a cylindrical waveguide.

Heat conduction in a cylindrical object.

Solutions to the radial Schrodinger equation (in spherical andcylindrical coordinates) for a free particle.

Dynamics of floating bodies

Diffraction from helical objects, including DNA

and more...

Since integration is the reverse operation of differentiation, it plays acentral role in solving differential equations.

Thus we want to calculate integrals - we want to be able to approximatethe areas represented by them.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 17 / 28

Page 18: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Another new direction: finding probabilities

You may have seen fairground games like this:

You drop a ball down the slope and you score points based on whichcolour the ball lands on.

Question: How can we find the probability that the ball falls on the whitesquare?

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 18 / 28

Page 19: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Aside

A producer for a TV game show actually asked a similar question to aprofessor I work with at HKU.

A prize is given out depending on where the ball lands in the game in theabove photo. The producer wanted to make sure that the grand prizewould not be won too often (so they wouldn’t lose money!).

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 19 / 28

Page 20: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Back to the question

Question: How can we find the probability that the ball falls on the whitesquare?

It is very very difficult to handle this problem using the techniques ofprobability you have learnt (compound events, tree diagrams,...). Thereare simply too many factors that one needs to take into account.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 20 / 28

Page 21: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Simulation

The best way is to use a technique called simulation. In this case,

1 Repeatedly roll balls down the slope a large number of times (say1000 times).

2 Each time, record the location that the ball lands.

3 The probability of the ball landing in the white square isapproximately the proportion of times in the 1000 trials in which thatball lands in the white square.

For example, if the ball lands in the white square 83 times out of the 1000,then the probability is approximately 83/1000 = 0.083.

To get a better approximation of the probability, we just repeat theexperiment even more times.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 21 / 28

Page 22: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Simulation

In practical examples, a computer would repeat the experiment usingrandom numbers a huge number of times.

Understanding random events using simulation is very important in fieldssuch as finance, weather forecasting, telecommunications...

In this picture released by the Hong Kong Observatory, the path oftyphoon is simulating using complicated computer models: the black pathis the ”average” predicted path of the typhoon; and the yellow ”cone” isthe margin of error introduced by randomness.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 22 / 28

Page 23: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Back to areas

Simulation can even be used to find areas and volumes! Here’s how:

1 Place the shape whose area you want in a square (of known size).

2 Pick a ”random point” in the square, the probability that this pointlies in the shape is given by:

Probability =Area of shape

Area of square

3 If we know this probability, we can find the area of the shape.

How do we find the probability? By simulation!

We could throw darts at the square repeatedly and and count the numberthat land in the shape...

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 23 / 28

Page 24: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Finding areas using simulation

Of course, in practice, we would use a computer.

In this picture, the red dots lie inside the circle; the blue dots lie outside.40 out of 50 of the dots lie inside square which has area 4. So

40

50≈ Area of circle

4⇒ Area of circle ≈ 0.8× 4 = 3.2

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 24 / 28

Page 25: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Monte Carlo Integration *calculus*

This method can also be used with volumes (just choose random points ina cube).

Now remember that areas can be used to calculate integrals. This methodof calculating integrals using simulation is called Monte CarloIntegration.

Areas represent ”2-dimensional integrals”, volumes represent”3-dimensional integrals” but actually, integrals of higher dimensions arealso important!

Approximating the region by simple regions still works to calculate theseintegrals but...

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 25 / 28

Page 26: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Monte Carlo Integration *calculus*

Monte Carlo integration has a huge advantage for high dimensionalintegrals!

The method of approximating by simple regions takes longer and longer toapproximate the integral (to a desired accuracy) as the dimensionincreases.

Monte Carlo integration is NOT affected by the dimension, in other words,the number of dimensions of the integral do not affect the time required tocalculate the integral!

However, there are other considerations when applying simulation.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 26 / 28

Page 27: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

Summary and conclusion

In this talk, you have seen:

actual numerical methods being applied to solve equations;

how primary school maths can be used to approximate areas;

how approximating areas is actually very important;

the use of simulation to calculate probabilities;

and how simulation can even be used to calculate areas.

After this talk, I hope you realize that the techniques you learn at schoolmay not be the actual techniques that are used in real-life applications.

However, you still need to learn those techniques because they often formthe theoretical basis for these numerical methods.

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 27 / 28

Page 28: Solving maths problems WITHOUT the techniques you learned at … · 2019. 12. 7. · Solving maths problems WITHOUT the techniques you learned at school. Hong Kong Academy of Gifted

The end

Thanks for listening!

Any questions?

[email protected]

Jonathan Tsai (HKU) Solving problems without school techniques 7 December, 2019 28 / 28