* Why* use the Mandelbrot fractal to get the students to learn some Precalculus topics?

- How often do students study math that less than 40 years old? Think about it.

What’s the most recently developed math topic that happens in your classroom? The Mandelbrot fractal was developed (discovered?) in the late 1970’s by Benoit Mandelbrot while working at IBM and through working with the Julia sets. His collegues at IBM used computers to create the first image of the Mandelbrot Set:

*The first picture of the Mandelbrot set, by Robert W. Brooks and Peter Matelski in 1978.* - There are so many great Precalculus topics addressed by the Mandelbrot set, namely:
- Complex numbers
- Arithmetic with Complex numbers
- Complex plane and Argand diagrams
- Recursive sequences
- Polar Form of Complex numbers
- Graphing using the Polar plane
- DeMoivre’s Theorem

By themselves they are interesting topics with many diverse uses, but together they can do marvelous things.

- The utter beauty and mysterious nature of the Mandelbrot set (and other related sets). It seems so inapproachable. Scary. It’s an infinite
*complex*process and has all the crazy fractal properties of self-similarity, but not really. You can zoom in forever and get more and more detail as you go. You can create (and understand?) images like so (all of these images came from my amateur code).

But these images are only*finitely*interesting. They are just pixel representations of the actual fractal. We can zoom in and get as much detail as we can handle (or more correctly, as a 32bit processing.org decimal float can handle – duh). - Lastly, be selfish, wouldn’t you like to learn something new alongside your students? Isn’t trying new things inherently a sign of youth? This might not be your thing, but if you’re interested in bringing it back to the classroom, the students will be that much more interested to see the teacher learning alongside their students.

Here are several good videos that can help you get started with the Mandelbrot set:

- The Mandelbrot Set from Numberphile and Dr Holly Krieger from MIT.
- 63 and -7/4 are special from Numberphile with Dr Holly Krieger from MIT.
- Mandelbrot Set: how it is generated.
- How to fold a Julia Fractal. Amazing website.
- And for fun, music video for Jonathan Coulton’s song Mandelbrot Set

Next, you can walk through the lesson outline that I’ve made (pdf) and through the presentation that I gave for NCTM Boston (pdf).

Here are links to all the interactives:

- Clicker
- Mandelblocks
- Mandelbrot
- MandelbrotZoom
- MandelbrotFamily
- JuliaZoom
- MandelbrotAndJulia
- MandelbrotExperimental

Everything is also found here: bit.ly/mandelbrotfractal, including all the presentation material, the walkthrough, the interactives (and all the source code).

I had a ton of fun with this project and presentation, and I hope the students did too. Please let me know if you have any questions or comments. Thanks!

]]>

We’re currently working with Power series and Taylor series in Calculus.

One particularity pretty derivation is going from the series for to the series for

Even better you can use this formula to calculate pi, since , so .

How quickly does this converge to pi? Let’s find out.

Here’s the first ten partial sums:

n= 0 and the partial sum is 4.0

n= 1 and the partial sum is 2.666666666666667

n= 2 and the partial sum is 3.466666666666667

n= 3 and the partial sum is 2.8952380952380956

n= 4 and the partial sum is 3.3396825396825403

n= 5 and the partial sum is 2.9760461760461765

n= 6 and the partial sum is 3.2837384837384844

n= 7 and the partial sum is 3.017071817071818

n= 8 and the partial sum is 3.2523659347188767

n= 9 and the partial sum is 3.0418396189294032

n= 10 and the partial sum is 3.232315809405594

Ok, that’s slow.

Here’s the first 100 terms:

n= 0 and the partial sum is 4.0

n= 10 and the partial sum is 3.232315809405594

n= 20 and the partial sum is 3.189184782277596

n= 30 and the partial sum is 3.1738423371907505

n= 40 and the partial sum is 3.1659792728432157

n= 50 and the partial sum is 3.1611986129870506

n= 60 and the partial sum is 3.157984995168666

n= 70 and the partial sum is 3.155676462307475

n= 80 and the partial sum is 3.1539378622726155

n= 90 and the partial sum is 3.1525813328751204

n= 100 and the partial sum is 3.1514934010709914

Still not to 3.14 even after adding 100 terms of this sequence?

Here’s the first 10,000 terms:

n= 0 and the partial sum is 4.0

n= 1000 and the partial sum is 3.1425916543395442

n= 2000 and the partial sum is 3.1420924036835256

n= 3000 and the partial sum is 3.1419258758397897

n= 4000 and the partial sum is 3.1418425911015158

n= 5000 and the partial sum is 3.1417926135957908

n= 6000 and the partial sum is 3.1417592924821482

n= 7000 and the partial sum is 3.141735490326666

n= 8000 and the partial sum is 3.1417176379662446

n= 9000 and the partial sum is 3.1417037523562383

n= 10000 and the partial sum is 3.1416926435905346

Two factors of ten more than the last set and still not to 5 digits of precision?

Lastly, here’s the first ten million approximations:

n= 0 and the partial sum is 4.0

n= 1000000 and the partial sum is 3.1415936535887745

n= 2000000 and the partial sum is 3.1415931535894743

n= 3000000 and the partial sum is 3.1415929869229293

n= 4000000 and the partial sum is 3.1415929035895926

n= 5000000 and the partial sum is 3.1415928535897395

n= 6000000 and the partial sum is 3.141592820256488

n= 7000000 and the partial sum is 3.1415927964468655

n= 8000000 and the partial sum is 3.141592778589681

n= 9000000 and the partial sum is 3.141592764700862

n= 10000000 and the partial sum is 3.1415927535897814

I really don’t want to calculate this by hand if after 10,000,000 additions, we only have 7 digits of precision.

(Question: why are all these even terms an over-estimate of pi?)

Graph of the first 1000 partial sums:

Let’s compare that to Chudnovsky’s algorithm:

Chudnovsky

n= 1 3.1415926535897342076684535915782983407622332609156

n= 2 3.1415926535897932384626433835873506884758663459963

n= 3 3.1415926535897932384626433832795028841971676788547

n= 4 3.1415926535897932384626433832795028841971693993750

n= 5 3.1415926535897932384626433832795028841971693993750

n= 6 3.1415926535897932384626433832795028841971693993750

n= 7 3.1415926535897932384626433832795028841971693993750

Wow, this algorithm maxed out the 51 digits of precision after **4** iterations. Crazy.

Here’s the python code for using arctan to approximate pi:

from decimal import * #Sets decimal to 50 digits of precision getcontext().prec = 50 #This program uses the power series for arctan to calculate pi #arctan(x) = sum (n = 0 to infinity) (-1)^n * (x^(2n+1))/(2n+1) #So to calculate pi, compute (arctan (1)) = pi/4 = 1 - 1/3 + 1/5 - 1/7 +... quarterpi = Decimal(0) n = 0 while True: quarterpi = quarterpi + Decimal(-1)**n / (Decimal(2*n + 1)) #this line allows the code to print only every 10 lines, increase this number #to speed up the calculations and reduce the printing if (n % 10 == 0): print((quarterpi*Decimal(4))) n += 1

And here’s the chudnovsky python code:

from decimal import * #Sets decimal to 50 digits of precision getcontext().prec = 50 def factorial(n): if n<1: return 1 else: return n * factorial(n-1) def chudnovskyBig(n): #http://en.wikipedia.org/wiki/Chudnovsky_algorithm pi = Decimal(0) k = 0 while k < n: pi += (Decimal(-1)**k)*(Decimal(factorial(6*k))/((factorial(k)**3)*(factorial(3*k)))* (13591409+545140134*k)/(640320**(3*k))) k += 1 pi = pi * Decimal(10005).sqrt()/4270934400 pi = pi**(-1) return pi print ("Chudnovsky") for i in range(1,50): print ("n=",i," ", chudnovskyBig(i))]]>

Here’s a sample of the stuff going up on that site. ]]>

Code is found here.

Edit:

Pulsar 2:

Code is found here.

TOM: Three guys go out fishing. They decide in advance that whatever they catch, they’re going to divvy it up equally.

So, they finish fishing for the day. They pull back into port, and they’re going to sleep on the boat overnight. They’re going to get up in the morning, divvy up the fish, and go home. In the middle of the night, however, one of the guys has a severe hemorrhoidal flare-up, and he’s got to get to the drugstore right away to buy some stuff.RAY: Right.TOM: So, he goes to take his third of the fish, and he notices that the number that they caught is not divisible by three, unless he throws one of the fish overboard. So, he throws one of the fish overboard, takes his third and leaves. A few hours later, in the middle of the night, another guy wakes up with horrible stomach pains. He’s gotta have the Kaopectate. So he goes to take his third of the fish, and he notices, interestingly, the same thing — he can’t take a third unless he throws one fish overboard. He throws one fish overboard, takes his third, and goes home.

Third guy gets up in the morning and figures the other guys are still sleeping. So he figures, “I’ll just take my third, and I’ll go. When they wake up, they can take their third.” However, he realizes that he can’t take a third.It’s not divisible by three.RAY: Sonja Henie’s…! What are the chances of that?TOM: He throws one fish overboard, takes his third, and leaves. Question: What is the smallest number of fish by which this little scenario could have taken place?

Can this happen with 4 people? 5? 6? n?

]]>Learning to code is like learning a natural language: it’s quite hard and slow at first but if you hold on just a little then suddenly you start seeing all the beauty of it and you’re amazed about how you suddenly understand what’s going on and how you can create stuff (designs or sentences) on your own!

Start with something that you understand and then, VERY IMPORTANT, play with it! What I often do is that I simply add a new instruction, maybe one from a previous tutorial or sketch, to see how that will look. Or I wonder: what will the animation look like if I use very big ellipses? or very small ones? only 10 of them? or a 1000? What if I make this rectangles rotate a bit? A lot? What if I apply this to only some of them?

]]>So it’s not just about staring at the screen. It’s also about sketching stuff on paper and about letting yourself be inspired by everything you see in the world around you! Look at all the patterns that you can see in the natural world, day in and day out: in buildings, on the sidewalks, in the behaviour of cars or birds. Try to recreate those patterns. Start with the easy ones, obviously Look at Muslim art, lots of patterns to be found there. Or the art of Sol Levitt. And go to art museums, they can be very inspiring anyway!

]]>RAY: There are a lot of our little children who listen to Car Talk who are studying Algebra, so I thought I would ask them to simplify the following polynomial.

TOM: Let me just write this down. OK.

RAY: X plus A in parentheses times X minus B in parentheses times X plus C in parentheses, dot, dot, dot, times X minus Z.

Here’s how it looks: (X+A)(X-B)(X+C) … (X-Z)

TOM: So you want —

RAY: I want the product of all those terms.

Best spirograph app ever. http://t.co/lejJ7TQXw9 Thanks for the tip @DrOlsen314!

— John Golden (@mathhombre) November 6, 2014

Great activity for kids (and adults) of many levels:

]]>How many rotations until the loop is closed?

]]>RAY: This puzzler is from a fellow named Jerry Olsen. Ed and his two sons, Biff and Skip, have been hired to paint the floor of a merry-go-round. They want to make sure they measure the floor area exactly, because they don’t want to buy any extra paint. The carousel, of course, is a circle. Here’s the catch: In the middle of the carousel is a smaller circle, which contains all the machinery for the carousel.

TOM: An annulus, in other words.

RAY: Exactly. It’s a ring we’re dealing with. Ed tells Biff, “We need to know the area of the carousel, including the area of the big outer circle that we’re going to paint and the area of the inner circle where there’s nothing but the machinery. “Once we have the areas of both circles we can subtract the inner circle from the other circle and we’ll know how much paint we need.”

Biff goes to the carousel and says to himself, “I can’t do this. All the machinery is in the middle. I can’t get to the center to measure the diameter.” He thinks, “I’ll cheat. The old man will never know!” Biff measures a straight line from one edge of the carousel to the other edge, not going through the center.

TOM: In other words he’s going to make what’s called a chord of the big circle.

RAY: Right. Any line that goes from one edge of the circle to the other that isn’t a diameter is a chord. As luck would have it, the tape measure touches the inner circle, or in geometric terms, is tangent to the inner circle at one point.

Biff returns to his dad and says, “I couldn’t do what you wanted me to do. I got this measurement and it’s 70 feet.” The old man administers a swift dope slap. He says, “How the heck are we going to figure this out. We don’t know either diameter.”

The other brother Skip says “I think I can figure it out. ”

Can he or can’t he?

The Introduction to Computer Programming Class had a Skype Q and A with Jason from Dark Sky (Dark Sky is an iOS weather app, check it out, it’s fantastic. They also make the great weather site forecast.io.) Super nice guy, I just emailed and asked, and it was scheduled a day later. Great experience for these kids.

Here’s some student responses to the prompt: “**What blew your socks off? What’d advice/stories/information was surprising?**”

- When how he told that if you really want to learn something. you need to be able to do it on your own time
- I think it is motivational that someone who is successful had a hard time and still does sometimes and still does what he wants to do.
- I thought it was really interesting when he talked about “reverse engineering” video games, and that was how he learned trigonometry. But now that I think about it, it isn’t surprising that it was easier for him to learn something difficult while immersing in something he was passionate about.
- The most surprising fact was that he wrote 45,000 lines of code to make the app originally, and then he modified it to do more, but only required 8,000 lines of code. I also really liked how he encouraged people to go on their own and explore other programs by themselves.
- What I guess what surprised me the most was how he compared computer programming to dance or singing or art. Going into this class I perceived computer programming as a very technical and systematic subject…that everything is by the book. While this may be true… talking to the developer brought to my attention that computer programming can be largely reliant on self discovery and self error.
- I was shocked when Jay told us how long it took to create his app and how many lines of code it required (45,000).