Mathematics Equation Backtracking Game Primer Tutorial

Mathematics Equation Backtracking Game Primer Tutorial

Mathematics Equation Backtracking Game Primer Tutorial

Thanks to New Century Maths Stages 5.2/5.3 (page 432) we have Mathematics based subject matter for today’s “Backtracking Equations” game. When we were at school we were given extra marks when we showed how we worked towards a solution to a Mathematics problem. That is the go today, here, too, with our game.

To quote our source book above …

Backtracking is a process used to solve an equation by undoing what has been done to the variable in the equation.

So, for an equation like …

3(n - 2) / 6 = 15

… using Backtracking techniques we solve this equation for n in the four steps (starting with the “shorter” side (in our case the RHS)) …

  1. Start with 15 … x 6 (because originally, we last (in the equation), / 6) … 15 x 6 … then …
  2. Continue with 15 x 6 … / 3 (because the simplest LHS bit left that can be Backtracked is “3 x” (ie. “3()”)) … (15 x 6) / 3 … then …
  3. Continue with (15 x 6) / 3 … + 2 (because we Backtrack the last and simplest LHS bit left, which is the “- 2” in “(n – 2)”) … ((15 x 6) / 3) + 2)
  4. So with n now isolated on the LHS, what is ((15 x 6) / 3) + 2)? … n = 32

So the user can jump straight to that last step as they wish, and score less, but score nonetheless, or discipline themselves to solve the equation in a logical method.

That’s all fine, and we mix it up a bit in the game, but we also add a Help link for a clue using the Google Chart Line Chart functionality we talked about when we presented PHP/Javascript/HTML Google Charts Parabola Line Graph Tutorial. The means by which we help is to present the user with a two dimensional Line Graph of Y versus the letter you are solving for. How can a Line Graph be useful, when, at school, you may recall that if our letter you are solving for is X the general form of a Linear Equation to suit a Linear Graph is …

Y = (GradientOfLine) x X + (Y-AxisCut)

… but let’s just take the case where Y = 1 in our new equation …

3(n - 2) / 6 = 15Y

… and we set out to isolate Y (which equals 1) … the steps are …

  1. Start with 3(n – 2) / 6 … / 15 (to LHS) … (3(n – 2) / 6) / 15 … then …
  2. Continue with (3(n – 2) / 6) / 15) … -1 (that is Y) leads to … Y = ((3(n – 2) / 6) / 15) – 1 = ((3(n – 2) – 90) / 90) = (n – 32) / 30 … which …
  3. Cuts the n-Axis at 32 … where Y = 0 … (the solution for n … so we would draw Y = 0.0333333333n – 1.0666666666666 (as our “helpful” Line Graph equation, for where this line cuts the n-Axis))

We’d like to direct you to a live run link with underlying HTML and Javascript (DOM) code you could call backtracking.html for your perusal.

But one last thing we need to clarify is the way we used “Parabola Line Graph” thoughts with “Line Graph” data above. However, what is the formula for a parabola …

Y = aX2 + bX + c

… when a above is zero … it’s a straight line (suitable for a Line Graph). However we hadn’t catered in the code for this rewording on the Google Chart so parabola_lgraph.php is code you can look at here, changed in this way. And here is the Line Graph talked about above …

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *