Could you add up all the numbers between 1 and 100? Here's how to do it.
There’s a popular urban legend about Carl Gauss, who may have been the greatest mathematician in history, and was probably a little too sassy for his own good. It goes like this:
In Germany, at the cusp of the 19th century, Master Büttner was fed up with his rowdy pupils. In those days, public schools were sober, single-room affairs crammed with students of all ages — a crucible for chatter. In the hopes of peace and quiet, Büttner sentenced his pupils — among them a young Gauss — to a long, mind-numbing task: adding up all the numbers between 1 and 100.
This kind of drone-like calculation is sometimes called ‘number-crunching’ — and it’s frustrating work. What if you forget a number? Or don’t quite add up 47+48 correctly? You might have to start the whole calculation from the top!
If Gauss and his peers had computers, they’d be laughing, because computers are lean mean number-crunching machines. We’re talking over 100,000 MIPS (million instructions per second)!
So if your teacher assigned you the same dull task… you’d do it the smart way.
STEP 1: Open your favourite web browser (Chrome, Firefox, or Internet Explorer) and navigate to http://repl.it
STEP 2: In the ‘Search for a Language’ box, type ‘Python’, and select it. Python is a lightweight, interactive programming language. In other words, you can spend less time worrying about semi-colons and more time doing fun things, like playing soccer or baking cookies.
Become a subscriber and get access to the rest of this article. Plus all our magazine articles.
Stories also include numerous links to help parents, kids, and teachers learn more. Get access today at just $15 per year!
Also In The April 2017 Issue
Could you come up with rules to add up all the numbers between 1 and 100? Here's how to do it.
Here's a fun game you can create with Scratch2 that draws geometric shapes!
We all use fonts yet rarely notice they are designed. Here are some interesting details to help you notice fonts.
This iPad app is a creative tool kids can use to explore and record what they learn in school.
Smart software design makes it easy for you to learn how to use it without help.
A new version of a fun Mario-like game that teaches kids coding has been released. Learn HTML and save kittens!
This puzzle mixes math and coding. Plus you can go online to try the code yourself.
Mark is a designer who also knows a lot about how to use technology to create design.
Design is about solving problems, from donuts to race cars, how we eat to what to wear in cold weather.
How do you keep track of many people working on the same set of code?
Everyone know the difference between saying, “Let’s eat, grandma!” and “Let’s eat grandma!” Computers don't.
The user interface often determines whether or not people can easily use your software.
State is an important concept in computer science as well as our everyday lives.
Links from the bottom of all the April 2017 articles, collected in one place for you to print, share, or bookmark.
Interesting stories about computer science, software programming, and technology for April 2017.
Computers collect garbage the way humans do. Here's how they manage memory space.
Code reviews help programmers improve their code and learn more about the software they build.