{"id":27540,"date":"2017-01-15T03:01:28","date_gmt":"2017-01-14T17:01:28","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=27540"},"modified":"2017-01-15T08:05:16","modified_gmt":"2017-01-14T22:05:16","slug":"mathematics-equation-backtracking-game-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/mathematics-equation-backtracking-game-primer-tutorial\/","title":{"rendered":"Mathematics Equation Backtracking Game Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/backtracking.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Mathematics Equation Backtracking Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/backtracking.JPG\" title=\"Mathematics Equation Backtracking Game Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Mathematics Equation Backtracking Game Primer Tutorial<\/p><\/div>\n<p>Thanks to <i>New Century Maths Stages 5.2\/5.3<\/i> (page 432) we have Mathematics based subject matter for today&#8217;s &#8220;Backtracking Equations&#8221; 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.<\/p>\n<p>To quote our source book above &#8230;<\/p>\n<blockquote><p>\nBacktracking is a process used to solve an equation by undoing what has been done to the variable in the equation.\n<\/p><\/blockquote>\n<p>So, for an equation like &#8230;<\/p>\n<p><code>3(<i>n<\/i> - 2) \/ 6 = 15<\/code><\/p>\n<p> &#8230; using Backtracking techniques we solve this equation for <i>n<\/i> in the four steps (starting with the &#8220;shorter&#8221; side (in our case the RHS)) &#8230;<\/p>\n<ol>\n<li>Start with <i>15<\/i> &#8230; x 6 (because originally, we last (in the equation), \/ 6) &#8230; <i>15 x 6<\/i> &#8230; then &#8230;<\/li>\n<li>Continue with <i>15 x 6<\/i> &#8230; \/ 3 (because the simplest LHS bit left that can be Backtracked is &#8220;3 x&#8221; (ie. &#8220;3()&#8221;)) &#8230; <i>(15 x 6) \/ 3<\/i> &#8230; then &#8230;<\/li>\n<li>Continue with <i>(15 x 6) \/ 3<\/i> &#8230; + 2 (because we Backtrack the last and simplest LHS bit left, which is the &#8220;- 2&#8221; in &#8220;(n &#8211; 2)&#8221;) &#8230; <i>((15 x 6) \/ 3) + 2)<\/i><\/li>\n<li>So with <i>n<\/i> now isolated on the LHS, what is <i>((15 x 6) \/ 3) + 2)<\/i>? &#8230; <i>n<\/i> = <i>32<\/i><\/li>\n<\/ol>\n<p>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.<\/p>\n<p>That&#8217;s all fine, and we mix it up a bit in the game, but we also add a <i>Help<\/i> link for a clue using the Google Chart Line Chart functionality we talked about when we presented <a target=_blank title='PHP\/Javascript\/HTML Google Charts Parabola Line Graph Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-charts-parabola-line-graph-tutorial\/'>PHP\/Javascript\/HTML Google Charts Parabola Line Graph Tutorial<\/a>.  The means by which we help is to present the user with a two dimensional Line Graph of <i>Y<\/i> versus <i>the letter you are solving for<\/i>.   How can a Line Graph be useful, when, at school, you may recall that if our <i>letter you are solving for<\/i> is <i>X<\/i> the general form of a Linear Equation to suit a Linear Graph is &#8230;<\/p>\n<p><code><i>Y<\/i> = (GradientOfLine) x <i>X<\/i> + (Y-AxisCut)<\/code><\/p>\n<p> &#8230; but let&#8217;s just take the case where <i>Y<\/i> = 1 in our new equation &#8230;<\/p>\n<p><code>3(<i>n<\/i> - 2) \/ 6 = 15<i>Y<\/i><\/code><\/p>\n<p> &#8230; and we set out to isolate <i>Y<\/i> (which equals 1) &#8230; the steps are &#8230;<\/p>\n<ol>\n<li>Start with <i>3(<i>n<\/i> &#8211; 2) \/ 6<\/i> &#8230; \/ 15 (to LHS) &#8230; <i>(3(<i>n<\/i> &#8211; 2) \/ 6) \/ 15<\/i> &#8230; then &#8230;<\/li>\n<li>Continue with <i>(3(<i>n<\/i> &#8211; 2) \/ 6) \/ 15)<\/i> &#8230; -1 (that is Y) leads to &#8230; Y = <i>((3(<i>n<\/i> &#8211; 2) \/ 6) \/ 15) &#8211; 1<\/i> = <i>((3(<i>n<\/i> &#8211; 2) &#8211; 90) \/ 90)<\/i> = <i>(<i>n<\/i> &#8211;  32) \/ 30 &#8230; which &#8230;<\/i><\/li>\n<li>Cuts the <i>n<\/i>-Axis at 32 &#8230; where Y = 0 &#8230; (the solution for <i>n<\/i> &#8230; so we would draw <i>Y = 0.0333333333<i>n<\/i> &#8211; 1.0666666666666<\/i> (as our &#8220;helpful&#8221; Line Graph equation, for where this line cuts the <i>n<\/i>-Axis))<\/li>\n<\/ol>\n<p>We&#8217;d like to direct you to a <a target=_blank title='Click picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/backtracking.html'>live run<\/a> link with underlying HTML and Javascript (DOM) code you could call <a target=_blank title='backtracking.html' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/backtracking.html_GETME'>backtracking.html<\/a> for your perusal.<\/p>\n<p>But one last thing we need to clarify is the way we used &#8220;Parabola Line Graph&#8221; thoughts with &#8220;Line Graph&#8221; data above.  However, what is the formula for a parabola &#8230;<\/p>\n<p><code>Y = aX<sup>2<\/sup> + bX + c<\/code><\/p>\n<p> &#8230; when <i>a<\/i> above is zero &#8230; it&#8217;s a straight line (suitable for a Line Graph).  However we hadn&#8217;t catered in the code for this rewording on the Google Chart so <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ParabolaLineGraph\/parabola_lgraph.php--GETME\" title=\"Code difference for parabola_lgraph.php\" target=\"_blank\">parabola_lgraph.php<\/a> is code you can look at here, changed in <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/ParabolaLineGraph\/parabola_lgraph.php--GETME\" title=\"Code difference for parabola_lgraph.php\" target=\"_blank\">this way<\/a>.  And here is the Line Graph talked about above &#8230;<\/p>\n<p><iframe width=100% height=700 title=Line src='http:\/\/www.rjmprogramming.com.au\/PHP\/ParabolaLineGraph\/parabola_lgraph.php?minval=0&#038;maxval=52&#038;e2=0&#038;e1=+0.033333333333333333333&#038;e0=-1.066666666666666666&#038;letter=n'><\/iframe><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d27540' onclick='var dv=document.getElementById(\"d27540\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mathematics\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d27540' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to New Century Maths Stages 5.2\/5.3 (page 432) we have Mathematics based subject matter for today&#8217;s &#8220;Backtracking Equations&#8221; game. When we were at school we were given extra marks when we showed how we worked towards a solution to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/mathematics-equation-backtracking-game-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[392,476,477,513,518,538,700,752,997,1171,1319],"class_list":["post-27540","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-equation","tag-game","tag-games-2","tag-google","tag-google-chart","tag-graph","tag-line-graph","tag-mathematics","tag-programming","tag-solution","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/27540"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=27540"}],"version-history":[{"count":23,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/27540\/revisions"}],"predecessor-version":[{"id":27576,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/27540\/revisions\/27576"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=27540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=27540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=27540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}