Why you can add equations using the Addition Method to solve a system of equations

For the longest time, I never understood how the Addition Method solved a system of simultaneous equations. What I mean to say is that I could carry out the method’s steps, but I didn’t understand why adding two equations was legal. It seemed unintuitive to me.

For example, take this system of two linear equations:

Untitled

Here is how I would solve it using the Addition Method:

procedure

Which is great, but why Step 3? I could understand the motivation for adding two equations to eliminate a variable, but what mathematical principle said it was okay to do that in the first place? It seemed to just about as rational to me as doing a head-stand while holding my nose to get the answer!

So I thought about it obsessively for a couple of hours and eventually realized the following:

The initial system basically says that y-x is 2 and y+x is 4. Conversely, 2 is y-x and 4 is y+x.

Nothing to write home about, but let’s say I want to add 2 and 4. Yes, the answer is 6, but suppose I want the answer to be in terms of x and y.

addmethhow1x

addmethhow2x

addmethhow3x

addmethhow4x

That is, Step 3! Effectively, we can add up the equations because a side of an equation can stand-in for its equivalent on the other side. The adding of equations is effectively the addition of numbers on the righthand sides of the two equations as the sum of those same numbers in terms of x and y.

For some, perhaps, this entry is a useless explanation of the obvious. Maybe it is, but no matter: now I understand something which I didn’t before, which I think is better than blindly accepting something as true, even if it’s small thing such as adding equations.

Cubic Polynomial Word Problem: Jenny and the Magic Bean

box

Here is a PDF version of a math problem I recently created. You’ll have to know how to factor cubic polynomials, so you may want to brush up on that first, or use this problem as a refresher. Just click on the link below to open it up. If you get stuck, a full solution starts on the second page.*

Enjoy!

WProb_CubicPolynomial_JennyMagicBean.pdf

* I know I’m being lazy here not writing the problem directly in the post, but it would take at least an hour’s work to insert all the LaTeX bits and to align things. Most browsers come with a PDF viewer, right ;-)?

Play Bad Banana online at trinket.io!

For curious readers who want to try Bad Banana, but who, understandably, would prefer not to have to download the code and run it on their systems, the game can now be safely played online at https://trinket.io/python/6a564db039?toggleCode=true&runOption=run. Toggle to Code View to see how the game works!

badbananapic

Many thanks to the people behind trinket.io, a great tool for beginners to learn about coding and to share simple programs like Bad Banana.

Bad Banana – A Python Math Game

It’s been awhile since my last entry, but here is my latest creation, so to speak.

Bad Banana is a text-based math game written in Python 3. My original intention was to use the game as a way to teach basic programming concepts, but I’ve put that idea on hold–I feel it right that I get better at coding first before I attempt to instruct others.  The challenge of the game is to mentally multiply two whole numbers as many times as you can before getting three wrong answers. Once that happens, it’s game over and you’re a BAD BANANA🍌 💩 !

Obviously that was funnier in my head :-p.

Watch the video above to see the game run in IDLE. Alternatively, you can view and download the code from my github repository, and run it however you like on your system. I’m going to try to see if I can actually embed the game on WordPress so readers can play it live on this blog.

Enjoy (I hope)!

P.S. I did not display the code here because WordPress made some unasked changes to it when I used the “code” tags. Very bizarre, but it’s available at github, as mentioned above.

Search Quest VII: The Search for Search (A Python Story)

Wanting a programming problem to work on but reluctant to tackle a big project, I returned to an old college textbook to look for something challenging but within my pay-grade, so to speak:

Implement sequential search and binary search algorithms on your computer. Run timings for each algorithm on arrays of size n = 10i for i ranging from 1 to as large a value as your computer’s memory and compiler will allow. For both algorithms, store the values 0 through n-1 in order in the array, and use a variety of random search values in the range 0 to n -1 on each size n. Graph the resulting times. When is sequential search faster than binary search for a sorted array? 

In short, for lists of data values in numerical order of varying size, compare on a graph the speeds of two search algorithms, sequential search and binary search.

For the benefit of readers who are not familiar with the said search methods, I’ll use an analogy I once heard during my time as a student at teachers’ college. Imagine you have to find the contact information of someone called “Daryl Daryl” in a telephone directory. First, you search for the name sequentially, that is, starting at the very first name in the phonebook you scan each name one by one until you land on “Daryl Daryl.” This, of course, is not how we would look up someone in real life, but let’s suspend our disbelief for explanation’s sake.

Continue reading “Search Quest VII: The Search for Search (A Python Story)”

Kinky Adventures in LaTeX Land: The Sum and Product of Roots of a Quadratic Equation

?????????🐒🐶🐱🐳🐿🐥?????????

\equiv \newline

\pi r^2 
\equiv \newline \pi r^2

?????????🙈😬🙄😮?????????

One of the things I don’t like about blogging is how long it can take to put together a blog post, even after it has been written, edited and polished. Aside from all the formatting required to make an entry look the way I want (see above), the other big time-suck has been adding mathematical statements (equations, formulas, expressions, etc.) to my blog. While I love MathType for its ease-of-use, using it has meant I’ve had to suffer through 1) writing math statements in the MathType Editor, 2) inserting them into a Pages document, 3) copying the said insertion into Preview, 4) exporting the Preview file as a PNG,  5) uploading the PNG to WordPress, and, finally, 6) inserting the PNG into the appropriate blog post. This is a lot of steps for something as short as, say, the area of circle (again, see above).

As such, I was happy when, several weeks ago, I stumbled onto MathJax, a Javascript engine which renders  LaTeX  “code” into professional-looking math statements. I had, for a long time, known about TeX and LaTeX as way to create math documents, but had always been satisfied with MathType to get done what I needed done. After doing a bit more investigation and discovering that WordPress already supported LaTeX,  I decided to give it a shot by using a LaTeX snippet I found here and expanding it into an entry on the sum and product of quadratic roots below.

***

Given a quadratic equation in general form ax^2 + bx + c = 0, the equation’s roots are

x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\newline \newline

or

x_1 = {-b + \sqrt{b^2-4ac} \over 2a}\newline \newline x_2 = {-b - \sqrt{b^2-4ac} \over 2a}\newline \newline

Continue reading “Kinky Adventures in LaTeX Land: The Sum and Product of Roots of a Quadratic Equation”

Netflix: A Mathematical Force Majeure?

graph_edited

Getting a slow start to the new year here, but thought I would begin with commenting on the graph above. It’s a slide from a website which I’ll leave unnamed, but which I suspect news junkies out there could easily figure out.

If you take a look at the graph, its intent is clear: the more it snows, the more we hunker down and watch endless hours of Netflix.

But it says a bit more than that. The first thing that struck me looking at the graph was that “Inches of Snow” was on the Y-axis and “Hours of Netflix Watched” was on the X-axis  This seemed counterintuitive to me. Typically in math, the dependent variable is placed on the Y-axis and the independent variable on the X-axis. This graph had it backwards. Rather than implying that the number of hours of Netflix-bingeing depended on the amount of snow outside, it was saying the reverse, i.e. the amount of snow outside depended on the amount of Netflix watched.

Then I thought: “Whatever. This independent/dependent variable stuff is really important when talking about functions, but maybe this graph is just correlating two variables, in which case it really doesn’t matter what you put on which axis.”

Which would be fine except that an exponential model relates the two variables. What that means is that for every fixed number of hours you watch of Netflix, the snow level is going to double, triple, quadruple, etc. To illustrate, suppose the model in the graph is represented by the rule y=2x.

x = 1 hour Netflix, y = 21 = 2″ of snow
x = 2 hours Netflix, y = 22 = 4″ of snow
x = 3 hours Netflix, y = 23 = 8″ of snow
x = 4 hours Netflix, y = 24 = 16″ of snow
x = 5 hours Netflix, y = 25 = 32″ of snow

As you can see, for every hour of Netflix watched the amount of snow doubles. After ten hours, there would be 1024 inches on the ground, just over 85 feet of snow! If this were the case, Earth would resemble the ice plant Hoth and watching video-streaming sites would be punishable by a 1,000 lashes with a wet noodle :-P.

Simple fix for this humorous slide: switch the labels of the axes. Not only will the original intent be properly communicated, the graph will make mathematical sense too.