Computer Science, Early Childhood Education, K-12, Math, Open Source Education, Parents, Personalized Learning, Required, Technology - Written by Wired Academic on Thursday, December 13, 2012 6:00 - 0 Comments
Jonathan Mugan: Teaching Your Child To Hack Math
powtac via Compfight
By Jonathan Mugan, Columnist
There are many educational apps, but the power of these apps to teach is limited by the imagination of the designer. A theme of The Curiosity Cycle is that learning should be driven by the imagination and creativity of the child. Programming is an ideal way to do this. Many parents may be drawn to using apps for education because they themselves don’t know how to program or how to use programming as a teaching tool. This blog post will show you how to do both using a free, interactive, and light-weight programming language called Python.
We will focus on using programming to teach math. In the modern world, math is implemented in programming, much like how hydrogen and oxygen implement the phenomenon of water. This embodiment of math in programming enables your child to poke and prod math like it is a living thing, allowing learning to happen through experimentation.
Your child can also use programming to build a math toolkit that will be useful later. This toolkit can be used to check homework and do class projects. When your child learns a new algorithm in school, such as long division, he or she can program the algorithm in Python and use it to check intermediate computations. Having access to this toolkit and the ability to expand it will foster a habit of computational thinking. Your child can grow to be like a digital sorcerer casting spells and learning new ones.
INSTALLING AND RUNNING PYTHON
To install Python, go to http://www.python.org/getit/ and pick the link that corresponds to your computer. I use Python 2.7.3.
For a 32-bit Windows machine:
http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
For a 64-bit Windows machine:
http://www.python.org/ftp/python/2.7.3/python-2.7.3.amd64.msi
There are also the equivalent Mac installers below those on the page.
You may have to set the path so Windows knows where to find Python.
Windows 7 and Vista
1. Start -> Computer
2. System properties from the menu up top.
3. Advanced system properties from the menu on the left.
4. Advanced tab -> Environment Variables button on the bottom
5. Under system variables choose “Path”
Windows XP
1. Start -> Control Panel -> System
2. Advanced tab -> Environment Variables button on the bottom
3. Under system variables choose “Path”
Then add “C:\Python27″ to that path. Note that there are no spaces, and each entry is separated with a semicolon.
To use Python in Windows, click on the Start (Windows) button and type “cmd” into the little run/search box. When the command prompt comes up, type “python.” You will now be in the Python interpreter and can just start typing commands. (For a Mac, you similarly need to bring up a terminal window.)
If you followed my blog post here and installed Ubuntu, you already have Python installed. Just hit Cntl+Alt+t to bring up a terminal and type ‘python’.
PROGRAMMING WITH YOUR CHILD
The interactive nature of Python is a big part of how we can use programming as a teaching tool. It makes it possible to turn learning into a game. You can play “stump the kid.” You type in a command, and your child tries to guess what the computer will say. Then your child can take a turn at stumping you. To make it even more fun, you can hook up a laptop to a TV and see the action on the big screen.
Basic arithmetic
You can practice basic arithmetic with your child by just typing in math.
Fractions and decimals
When you try division, you may notice an odd thing. 5 / 2 = 2. That’s because Python thinks you want an integer answer (silly). You have to type “from __future__ import division”.
You can show for common fractions that you get decimals. You can quiz your child on what the decimal value will be.
Please Excuse My Dear Aunt Sally
One area where the implementation of math in programming may produce a fun surprise for your child is in the order of operations. When I was in 7th grade, I learned the phrase, “Please Excuse My Dear Aunt Sally.” This phrase was a mnemonic to help us remember what was evaluated first in a math expression: parenthesis, exponents, multiplication, division, addition, and subtraction. In reality, multiplication and division are done left to right (neither has precedence over the other), and addition and subtraction are also done left to right.
You can see this in action. If your child has not studied order of operations yet, he or she will likely say that the answer to 3 + 4 * 2 is 14. Python and Aunt Sally agree that it is 11.
Introducing variables
You can introduce variables, which gets your child started toward algebra. In Python, a single equal sign ‘=’ is used for an assignment of a value to a variable; a double equal sign ‘==’ is an operator that checks if the two values are the same, as we will see in the next section. Note that your child may get confused between strings and variables. A string, such as ‘dog’, is in quotation marks.
Conditionals and logic
You can use the ‘if’ statement for conditional execution. If a command goes more than one line, just hit return to continue typing. Then, to evaluate, hit return twice.
You can also test for inequality, as shown below.
Now that we are using more syntax, it is a good time to point out that a tutorial of syntax can be found athttp://docs.python.org/2/tutorial/.
Errors and flapdoodle
My kids love when the computer says something crazy like when you divide 1 by 0.
You can also use a variable before it has been defined to get some more gobbledegook as output.
These kinds of nonsensical responses may lead your child to the wow-computers-are-stupid stage of learning programming. In this first stage of programming, the literal mindedness of computers can be a significant obstacle.
The bad news is that you have to tell computers everything you want them to do in excruciating detail, but the good news is that you only have to tell them once.
Modules and functions
You can store your commands in a file so you don’t have to type the same things over and over again. You can also define functions to put in this file. In Python, this file is called a module, and it will end with the suffix “.py”. We will assume that your module is called mymodule.py.
You can create mymodule.py with a text editor, such as Notepad, and save it in the directory where you run Python. (It doesn’t have to be in that directory, but having it there saves us from having to tell Python where it is.)
When you start Python, you can then type “from mymodule import *” at the command prompt.
Here’s an example of a function in python:
Note the indentation. Python uses indentation (a convention is to use 4 spaces) to determine the nesting of statements.
Every time you change mymodule.py, you will need to quit Python (do this by hitting Ctrl-z) and reload it using “from mymodule import *”.
To avoid having to type “from mymodule import *” each time you start Python, you can create another file, we’ll call it startup.py, that only contains “from mymodule import *”. And then you can set a special environment variable to run that startup module each time Python is loaded. To do this, set the environment variable PYTHONSTARTUP to point to your startup file (instructions for Windows are given below).
Windows 7 and Vista
1. Start -> Computer
2. System properties from the menu up top.
3. Advanced system properties from the menu on the left.
4. Advanced tab -> Environment Variables button on the bottom
5. Under system variables click “New”
Windows XP
1. Start -> Control Panel -> System
2. Advanced tab -> Environment Variables button on the bottom
3. Under system variables click “New”
COMING IN FUTURE POSTS
In future posts, I will discuss more about functions. We will also talk about loops so your child can multiply a number by 10 until it is so big it covers the whole screen. From there, we can introduce all kinds of concepts such as factoring, identifying prime numbers, finding the greatest common denominator, and sorting.
We will also look at recursive functions (functions that call themselves) such as the one below.
Jonathan Mugan is a computer science researcher specializing in machine learning and AI. He completed a postdoc at Carnegie Mellon University and received a PhD in Computer Science from the University of Texas at Austin. He recently completed a book: The Curiosity Cycle: Preparing Your Child for the Ongoing Technological Explosion. You can follow him @jmugan.
Campus Buzz
We welcome Tips & Pitches
Latest WA Original Features
-
Open University Enters Battle Of The MOOCs, Launches “FutureLearn”
-
Alvaro Salas As A Case Study In Crowd-Funding An Ivy-League Education
-
Jonathan Mugan: How To Build A Free Computer Within A Computer For Your Child
-
WGU Texas & Three Community Colleges Develop Individual-Paced College Courses
-
Language Learning: Berlin’s Babbel.com Builds Towering Growth Trajectory
Paul Glader, Managing Editor
@paulglader
Eleni Glader, Policy Editor
Elbert Chu, Innovation Editor
@elbertchu
Biagio Arobba, Web Developer
@barobba
Ravi Kumar, Reporter & Social Media Editor
@ravinepal
Contributors:
Michael B. Horn
@michaelbhorn
Derek Reed
@derekreed
Annie Murphy Paul
@AnnieMurphyPaul
Frank Catalano
@FrankCatalano
Ryan Craig
@UniVenturesFund
Jonathan Mugan
@JMugan
Terry Heick
@TeachThought
Alison Anderson
@tedrosececi
The Pulitzer Prize winning investigation newsroom digs into for-profit education.
-
Most Viewed
- Pearson Llc + Google Expands LMS Business With "OpenClass" System
- Guest Column: Why Steve Jobs would have loved digital learning
- Inside Ashford University: A former staffer talks to WiredAcademic
- Citing IT Skills Shortage, IBM Wants To Expand Presence At Universities
- Online Educa: A Closer Look At 8 Virtual K-12 Schools In Europe
-
MARKET INTRADAY SNAPSHOT
- Education & Tech Companies We Follow
APEI | 36.16 | 0.00 | +0.00% | ||
APOL | 20.80 | 0.00 | +0.00% | ||
AAPL | 521.7302 | 0.00 | +0.00% | ||
BPI | 10.39 | 0.00 | +0.00% | ||
CAST | 0.09 | 0.00 | +0.00% | ||
CECO | 3.33 | 0.00 | +0.00% | ||
COCO | 2.54 | 0.00 | +0.00% | ||
CPLA | 28.8784 | 0.00 | +0.00% | ||
DV | 24.30 | 0.00 | +0.00% | ||
EDMC | 5.55 | 0.00 | +0.00% | ||
ESI | 18.32 | 0.00 | +0.00% | ||
GOOG | 722.36 | 0.00 | +0.00% | ||
LINC | 5.41 | 0.00 | +0.00% | ||
LOPE | 24.19 | 0.00 | +0.00% | ||
PEDH | 0.17 | 0.00 | +0.00% | ||
PSO | 19.64 | 0.00 | +0.00% | ||
SABA | 8.36 | 0.00 | +0.00% | ||
SCHL | 28.79 | 0.00 | +0.00% | ||
STRA | 58.2609 | 0.00 | +0.00% | ||
WPO | 368.48 | 0.00 | +0.00% |
Cost of Education, Domestic, For-Profit, Friend, Fraud, or Fishy, Graduation Rates, Infographics, Recruitment, Required, Universities & Colleges - Dec 18, 2012 6:00 - 0 Comments
Infographic: A Comparison Of For-Profits v. Non-Profit Online College Data
More In For-Profit
- Opinion: How “Shareholder Value” Is Destroying For-Profit, Career Colleges
- Avenues: The World School Opens To Fanfare & Critics Of Elitist High-Tech
- University of Phoenix Is Biggest Spender on Google, $400k Per Day
- Heard: Whistleblower Pops Lid On Deceit At EDMC Schools
- Heard: State Universities’ Online Programs Pummeling For-Profits
Cost of Education Domestic Education Quality For-Profit Opinion Regulatory Required Universities & Colleges
Blended Learning, Continuing Education, Domestic, K-12, Personalized Learning, Required, Technology - Dec 20, 2012 6:00 - 0 Comments
Terry Heick: The iPad’s Past, Present & Future In Learning Environments
More In Technology
- Tom Vander Ark: Wunderkind MOOCs Still A Non-Consumption Trend
- Tom Vander Ark: Education’s 5 Megatrends Of 2012
- Jonathan Mugan: Teaching Your Child To Hack Math
- Guest Column: Move Over Generation X & Y, Say Hello To Generation Z
- Computer Infrastructure Questions Related To Common Core Online Tests
Cost of Education, Domestic, For-Profit, Friend, Fraud, or Fishy, Graduation Rates, Infographics, Recruitment, Required, Universities & Colleges - Dec 18, 2012 6:00 - 0 Comments
Infographic: A Comparison Of For-Profits v. Non-Profit Online College Data
More In Friend, Fraud, or Fishy
- Opinion: How “Shareholder Value” Is Destroying For-Profit, Career Colleges
- The Incredible Expansion Of Charter Schools In American School Districts
- Heard: Whistleblower Pops Lid On Deceit At EDMC Schools
- For-Profit Career Education Corp. To Close 23 Campuses
- Opinion: How The GI Bill Fails Soldiers And Lines For-Profit College Pockets
Domestic Friend, Fraud, or Fishy Opinion Recruitment Regulatory Required Universities & Colleges
Leave a Reply