Hacking Math Class, The Book

105 views
Skip to first unread message

Peter Farrell

unread,
Feb 28, 2015, 8:58:30 PM2/28/15
to mathf...@googlegroups.com
Hello again to the Math-Futurists,

I'm usually writing to share some new computer-related exploration but this time it's a little different. I've collected a wide assortment of my Python programs to help math students (and teachers) explore math topics from arithmetic to calculus. I envision it as an enrichment tool for schools and it'll be the textbook to my Math Through Technology program I put on here in the San Francisco Bay Area. It's called Hacking Math Class with Python; Exploring Math Through Computer Programming. It's available for download from my website www.farrellpolymath.com

Let me know if you have any questions, comments or suggestions. I might even offer up a sample chapter if you ask nicely!

Thanks,

Peter Farrell

Donald Cohen

unread,
Feb 28, 2015, 10:53:37 PM2/28/15
to mathf...@googlegroups.com
Peter,

I'd like to buy a copy now via PayPal, if you tell me the price and convince me I will be able to programm in Python!

I bought your book!! How many pages? Will you give me permission toI print it out?

Don

--
You received this message because you are subscribed to the Google Groups "MathFuture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathfuture+...@googlegroups.com.
To post to this group, send email to mathf...@googlegroups.com.
Visit this group at http://groups.google.com/group/mathfuture.
For more options, visit https://groups.google.com/d/optout.



--
"Learning, Living and Loving mathematics.."- the core of Don's teaching and books, observed by Seth Nielson.

Donald Cohen
1905 S. Prairie Winds Dr. Apt. 204
Urbana, IL 61802
Tel. 217-840-4559
Email: doncohe...@gmail.com   
Don's Mathman website URL: http://www.mathman.biz
See Don's new clickable  A Map to Calculus with student works and sample problems from Don's books at every node


 

Peter Farrell

unread,
Mar 1, 2015, 1:27:45 AM3/1/15
to mathf...@googlegroups.com
Hi, Don,

"Thank you so much for your purchase!" I'm having a good laugh because here you are buying my book and you're mentioned (twice!) in the Matrices chapter. Somebody said all rock and roll is a footnote to Chuck Berry, and my book is but a footnote to Calculus by and for Young People.

It has around 130 pages, and yes, you can print out a copy! I had a meetup of 3 boys working through chapter 1 today on turtle graphics and they were proudly sharing their creations with each other. I first learned to program by making Logo turtles walk around a screen and Python has a turtle module built right in when you download it. Turtles are certainly not intimidating to work with, and I set them to some pretty heavy tasks later in the book like graphing and drawing fractals.

If anybody can learn it, the Mathman can. Let me know if you have any problems!

Thanks again, Don.

Peter

--
You received this message because you are subscribed to a topic in the Google Groups "MathFuture" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathfuture/SvmtuJTUDw8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathfuture+...@googlegroups.com.

Donald Cohen

unread,
Mar 1, 2015, 11:27:22 AM3/1/15
to mathf...@googlegroups.com
Peter, you know I've paid for your new book. Where do I go to download it?

Don

Peter Farrell

unread,
Mar 1, 2015, 12:09:52 PM3/1/15
to mathf...@googlegroups.com
I just sent it to you. Did you receive it?

Maria Droujkova

unread,
Mar 2, 2015, 8:06:53 AM3/2/15
to mathf...@googlegroups.com
Do you want to run an online course to go with it? If so, let's talk! In any case, we should do a Math Future event to introduce this work.

Cheers,
Dr. Maria Droujkova
NaturalMath.com
919-388-1721
-- .- - ....
--


 

Peter Farrell

unread,
Mar 2, 2015, 9:09:59 AM3/2/15
to mathf...@googlegroups.com
Hi, Maria,

That's a great idea! I will call you today. 

Thanks so much,

Peter

--

Paul Libbrecht

unread,
Mar 2, 2015, 1:05:25 PM3/2/15
to mathf...@googlegroups.com
I'm interested to that.
I would be happy to see that Europe-compatible in time.

paul
You received this message because you are subscribed to the Google Groups "MathFuture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathfuture+...@googlegroups.com.

roberto

unread,
Mar 7, 2015, 12:11:45 PM3/7/15
to mathf...@googlegroups.com
Hi Peter, your book is probably what I've been looking for! But the link you gave just keeps showing me the homepage of your site. Is there anything I'm missing?

Thank you.

--
Roberto

kirby urner

unread,
Mar 7, 2015, 12:30:39 PM3/7/15
to mathf...@googlegroups.com

Roberto, there's a buy the PDF button that may not be showing up in your browser?

I like the Tinket plug-in here:   http://www.farrellpolymath.com/code

The Earth-around-Sun graphic suggests maybe Vpython? 

An Earth that close to our Sun would fry to a cinder in no time.  Glad it's not real.  :-D

Wasn't sure if the version of Python was going to matter a lot. 

I'd refer some of my adult students if it were 3.x, still checking into it. **

I'm enjoying Anaconda a lot, for what it give me:  a whole Python ecosystem in a giant ball.

http://worldgame.blogspot.com/2015/02/anaconda-fat-python-for-you.html

Kirby

** we are now open to younger people as well, thanks to recent changes


Peter Farrell

unread,
Mar 7, 2015, 1:55:45 PM3/7/15
to mathf...@googlegroups.com
Hi, Roberto and Kirby,

Thanks for the feedback! Yes, the book is available on the homepage (http://farrellpolymath.com/). Definitely let me know if the all-important "Buy Now" button is not showing up! It works on my browser.

It was my plan to write a math book that students, parents and teachers are "looking for" in 2015. Last weekend I had a small bunch of boys working through the turtle explorations and showing off their creations to each other. That was a good sign.

I haven't seen any other books addressing how to apply Python to math learning in the same way: writing programs to "automate the boring stuff"* in math class so you can get to the fun stuff quicker. Solve algebraic equations and geometry problems, graph functions, transform graphs using matrices, draw fractals (even complex ones), create 3D models and animations, not to mention the calculus tools you'll learn to create.

Kirby, I agree; I would have done it all in Python 3, since it solves the problems with division and the turtle graphics freezing up. But as you correctly pointed out, VPython is one of my major tools for exploration, which requires Python 2.7. Pygame also doesn't work on Python 3.

I had Anaconda for a while, then had some problems so I switched to WinPython. You're right, it's great to have a ready-to-run Python environment.

Thanks again for the input and talk soon!

Peter Farrell

* expression swiped from Al Sweigart


Oleg Gleizer

unread,
Mar 7, 2015, 7:39:58 PM3/7/15
to mathf...@googlegroups.com
Dear Peter,

Is it possible to look at the Intro and the first couple of chapters of your book before buying it?

Very Truly Yours,

Oleg Gleizer.

Peter Farrell

unread,
Mar 7, 2015, 9:27:27 PM3/7/15
to mathf...@googlegroups.com
Hi, Oleg, and the group,

Just for you Math Futurists, here's a pdf of the first 2 chapters. Please let me know what you think either way.

If anyone promises me a substantial, constructive review, positive or negative, that I can quote, I'll email you a complete copy.

Peter
HMCCh1and2.pdf

Oleg Gleizer

unread,
Mar 8, 2015, 4:08:33 PM3/8/15
to mathf...@googlegroups.com
Hi Peter,

I feel like trying the book at the UCLA Math Circle. I would be able to write a substantial review based on kids' reaction to the book. However, it may take a while. I am not sure I would go through the entire book, but I will use some parts.

I plan to study continued fractions with my Math Circle class next quarter. I'd like to teach them a bit of Python by your book parallel to it and then use Python for playing with continued fractions, possibly ending up with a continued fractions' calculator.

Another project that I have in the plans for some later time is teaching my class the Rubik group, first for a 2 by 2 cube, then for a 3 by 3, and then possibly for some other Rubik-type groups not realizable in 3D. It would be great if you could write the code showing how the group generators, as well as general group elements, act on the cube. I'd teach both the group action and the code. Would you be interested in cooperating along these lines?

I'd be happy to have the book either way. If you want me to pay, could you please give me some mailing address where I could mail a check? I have no PayPal account and have no plans of setting one.

Very Truly Yours,

Oleg Gleizer.

 

Maria Droujkova

unread,
Mar 8, 2015, 4:16:54 PM3/8/15
to mathf...@googlegroups.com
Glad these connections are happening! I think groups like Rubik's lend themselves so well to computer math.

You can pay with any credit card - just choose "Pay with a credit card" after clicking that Buy button. Peter, I found you need to explain that next to the button, or people don't see it because PayPal is evilly hiding the option at the bottom of the screen :-)

Peter Farrell

unread,
Mar 8, 2015, 4:21:53 PM3/8/15
to mathf...@googlegroups.com
Thanks for the heads up! I'll get to work on that.

--

Peter Farrell

unread,
Mar 8, 2015, 4:37:32 PM3/8/15
to mathf...@googlegroups.com
I put a message that by clicking the button, you can pay by credit card or paypal.

I've been getting a bunch of clicks to my site, but few sales, so I'm looking for positive reviews I can post. Like I said, I'll send a free copy to anybody who promises me a constructive review (positive or otherwise) I can quote.

I should also post the Table of Contents to let shoppers know what's included.

Looking forward to hearing from you!

Peter

Peter Farrell

unread,
Mar 8, 2015, 7:07:30 PM3/8/15
to mathf...@googlegroups.com
Hi, Oleg,

I've sent a copy to your email account. 

I love the idea of a continued fractions calculator! That's exactly the kind of exploration that could be challenging and rewarding using Python. 

I'd definitely be interested in collaborating on the Rubik's cube project. I know I'd learn a lot! VPython would be great for visualizing the 3D versions of the cube.

So many ideas. I'm psyched. Feel free to email me personally or start a new "Continued Fractions" thread.

Peter

kirby urner

unread,
Mar 8, 2015, 11:21:31 PM3/8/15
to mathf...@googlegroups.com
On Sat, Mar 7, 2015 at 10:55 AM, Peter Farrell <peterfa...@gmail.com> wrote:
Hi, Roberto and Kirby,

Thanks for the feedback! Yes, the book is available on the homepage (http://farrellpolymath.com/). Definitely let me know if the all-important "Buy Now" button is not showing up! It works on my browser.


Better than a "Buy Then!" button. :-D

Good for people to have their PDF books for sale easily, no need to swamp Amazon with orders.  :-D

They're huge already, eh?
 
It was my plan to write a math book that students, parents and teachers are "looking for" in 2015. Last weekend I had a small bunch of boys working through the turtle explorations and showing off their creations to each other. That was a good sign.


How much POV-Ray do you have? **  I tried to guess from the cover.   Maybe you say explicitly that you do (they have a cool logo).

Probably not though, as POV-Ray is obscure and has no special connection to Python e.g. Ruby or Perl could do the same work.  Any language.

What one gets from POV-Ray are some really nice stills (animations also possible) and that frees you up to not ask permission for that nice parabola or sine curve or whatever, i.e. you get to own your own graphics and have them look magazine / web quality.

Not that you can't just do screen shots from SketchPad or whatever (Geogebra and so on) -- talking about one possible image source among many.

In my Saturday Academy classrooms (a Silicon Forest outreach to kids), I went on a lot about how real time fast action gaming requires real time computation, so the graphics may not be as photo-realistic when you hit pause, as a frame of a Disney or Dreamworks film or whatever, i.e. render farms take their time.

I'd harp on "real time" versus "render time" graphics.  Of course with GPUs, the real time stuff is getting better all the time.

 
I haven't seen any other books addressing how to apply Python to math learning in the same way: writing programs to "automate the boring stuff"* in math class so you can get to the fun stuff quicker. Solve algebraic equations and geometry problems, graph functions, transform graphs using matrices, draw fractals (even complex ones), create 3D models and animations, not to mention the calculus tools you'll learn to create.

What I consider boring is hand-writing a lot of low level scene description stuff based on computations done by hand.

Python does the computations and writes the .pov or .vrml or whatever (.png or .jpg if using something like Python Imaging Lab -- or PIL itself!)

Of course at some level the I'm the one who has to know the math, and that's why I suggest tools like POV-Ray for reinforcing math skills.  You wondered what that XYZ coordinate system was good for.  Here's a case where all that high school geometry terminology is going to pay off.
 

Kirby, I agree; I would have done it all in Python 3, since it solves the problems with division and the turtle graphics freezing up. But as you correctly pointed out, VPython is one of my major tools for exploration, which requires Python 2.7. Pygame also doesn't work on Python 3.


I hope Bruce Sherwood et al jump on the 3.x track again, however the big push of late has been integration with wxPython.

Visual Python is popular in physics classrooms for what it allows, in terms of simulations.  However I think VPython (same thing) would catch on a lot more if more students coming in already had some of these basic language skills.  PDFs like yours will make physics teachers happy.
 
I had Anaconda for a while, then had some problems so I switched to WinPython. You're right, it's great to have a ready-to-run Python environment.


Anaconda comes the Qt for widgets but I didn't see wxPython go by as "the mother lode" installed.  I could main that pile of free gems for a long time.  I feel like Smaug (on a good day -- I'm sure he had a few, before the Desolation chapter).

[ FYI I tend to use dragon imagery for server-side Python anyway:

http://worldgame.blogspot.com/2013/09/leveraging-python.html  ]
 
Thanks again for the input and talk soon!

Peter Farrell


I'm glad people are writing kid-friendly PDFs that serve as guides to what's becoming a complicated ecosystem.

Not just talking about Python of course, a glue language between so much else.  Great to ride it places, but you can get off and come back.

It's like scouting!  So territory much to explore.

Kirby

** POV-Ray is free and open source however it developed in the CompuServ ecosystem which was its own place back then.  The license is therefore not GPL as the GNU revolution was happening separately at that time.


Peter Farrell

unread,
Mar 9, 2015, 12:13:31 AM3/9/15
to mathf...@googlegroups.com
I'd love to learn POV-Ray. There are new tools for 3D graphics coming out daily. I've looked into WebGL (in Javascript) and webalchemy (in Python). 

VPython is like the ready-made pizza crust: somebody did a lot of work so you can get a pizza with very little effort. You can also use it and put in a little more effort and get a pretty good pizza. I actually think the analogy breaks down there because you can really learn some Python and physics and math and do some really cool graphics using this "simple" tool.

But right now I need help to spread the word. Write me a review!

Thanks, Math Future,

Peter

roberto

unread,
Mar 9, 2015, 11:40:34 AM3/9/15
to mathf...@googlegroups.com
Hi Peter, yes if you upload the Table of Contents that would help a lot prospective purchasers, like me :)

Thanks again!

--
You received this message because you are subscribed to the Google Groups "MathFuture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathfuture+...@googlegroups.com.

To post to this group, send email to mathf...@googlegroups.com.
Visit this group at http://groups.google.com/group/mathfuture.
For more options, visit https://groups.google.com/d/optout.



--
Roberto

Peter Farrell

unread,
Mar 9, 2015, 11:58:48 AM3/9/15
to mathf...@googlegroups.com
You got it, Roberto! 

Take a look at the webpage now and you can see the entire Table of Contents.

Hope it helps you make an informed purchase!

Peter

Oleg

unread,
Mar 9, 2015, 10:05:59 PM3/9/15
to mathf...@googlegroups.com
Hi Peter,

Thanks a lot!

Oleg

Algot Runeman

unread,
Mar 18, 2015, 4:39:46 PM3/18/15
to mathf...@googlegroups.com
Peter,

Thanks for the work you've done with your book.

I ordered it and was moved to explore right away. That lead me to record my comments which sometimes become a blog post. The post does not qualify as a review of your book. While not a math educator, I did some teaching of coding at the middle school level way back.

Exploring and Sharing: two things which are good for us and others.

--Algot

Peter Farrell

unread,
Mar 19, 2015, 10:02:01 AM3/19/15
to mathf...@googlegroups.com
Hi, Algot,

Thank you for your purchase! :-)

I'm glad the turtle material inspired you to explore along. That's my goal! Keep me posted on your progress through the chapters.

Peter

--

Peter Farrell

unread,
Oct 1, 2015, 9:24:01 AM10/1/15
to mathf...@googlegroups.com, prof...@math.ucla.edu
Hi, Oleg,

I just looked back at our emails and was reminded that you asked for a Rubik's cube program. So I wrote this one, which doesn't have anything to do with groups or permutations; I figured once you rotate square number 9, it's not square number 9 anymore, and you'd have to change its index in a list or array. The easier way for me was to use x/y/z coordinates, where any "face" with x-coordinates bigger than some value must be on the right column and can be put in a list if necessary and rotated with all the other "right" faces.

Press any number between 1 and 9 and the corresponding rotation will happen. It was easy to rotate them instantaneously, but I think it looks cooler when you can watch it rotate.

Let me know what you think, and let me know how the Math Circle is going!

Peter Farrell
rubiks_keys.py

Oleg

unread,
Oct 1, 2015, 11:15:26 PM10/1/15
to mathf...@googlegroups.com
Hi, Peter,

Our Math Circle starts this Sunday, 10/4. I have instructed the kids, or rather their parents, to purchase your book. Since I don't know who has purchased it already, my first handout largely copies the first chapter of your book. I have attached the handout to this e-mail as a PDF file for you to take a look. I will let you know how the first class went some time next week.

As I have mentioned, I am thinking of making a course about groups based on Rubik's cube. Ideally, applying a group element to a configuration should produce the corresponding picture and the other way around, rotating the cube should produce the corresponding group element.

My level as a computer programmer is next to zero. I used to code a lot in Fortran and a bit less in C some 15 years ago. Lately, my (university) students were programming everything I needed. I am learning Python with the kids, just a little bit ahead of them, and totally enjoy the process. However, due to my outdated programming skills, some of my questions may be rather naive. Here is the first one. When I try to run your file rubiks_keys.py from IDLE, I get the following error message.

Traceback (most recent call last):
  File "/home/oleg/Desktop/rubiks_keys.py", line 8, in <module>
    from visual import *
ImportError: No module named visual

So my question is where to get the module and how to install it.

Thanks a lot for your help!

Oleg
IC1handout1Sp2015.pdf

Peter Farrell

unread,
Oct 1, 2015, 11:42:47 PM10/1/15
to mathf...@googlegroups.com
Hi, Oleg,

Thanks for using my book in your Circle! I've noticed a bunch of sales to folks in the LA area. I owe you a Christmas card. 

I'm a math guy, and only learned programming from slavishly copying the Logo code in Papert's Mindstorms page by page in my 30s. I discovered Python in my 40s.

VPython is lots of fun. Creating and playing around with dynamic, interactive 3D graphics using a simple language like Python is tough to beat. When I have questions I post them on the VPython-users google group and somebody will quickly sort me out.

Judging from your error message, you haven't installed Visual Python yet. There are a lot of YouTube videos that take you step by step through the download and install. Here's one of mine:

All it requires is to download the right version of VPython from vpython.org and follow the install prompts. I clicked "Next" a lot. I use Windows, but I've installed it on Linux computers, too, and it's just as easy IMO.

Please PLEASE let me know if you have any other questions or problems!

Peter

Oleg

unread,
Oct 10, 2015, 11:13:08 PM10/10/15
to mathf...@googlegroups.com
Hi, Peter,

You will find my handout for the next class attached to this e-mail as a PDF file. I will let you know how the second class went some time on Monday.

Have a good night!

Oleg
IC1handout2F2015.pdf
Reply all
Reply to author
Forward
0 new messages