Giving Sage AI-based step-by-step equation solving abilities

62 views
Skip to first unread message

Ted Kosan

unread,
Oct 9, 2016, 2:09:11 PM10/9/16
to sage...@googlegroups.com
For the past few years I have been working on an artificial intelligence step-by-step equation solver for elementary algebra equations that solves these equations using steps that a human would typically use. Here is an example of what I have working so far:

In> LineForm(SolveSteps(MathParse("(8*x - 2 == -9 + 7*x)"), _x))

      8*x - 2 == (-9) + 7*x    The original equation.
      (8*x - 2) - ((-9) + 7*x) == 0    Subtract (-9) + 7 * x from both sides.
      (8*x - 2) + (-1)*((-9) + 7*x) == 0    Undefine a binary '-' operator.
      (8*x + (-1)*2) + (-1)*((-9) + 7*x) == 0    Undefine a binary '-' operator.
      (8*x + (-2)) + (-1)*((-9) + 7*x) == 0    Arithmetic.
      (8*x + (-2)) + ((-1)*(-9) + (-1)*(7*x)) == 0    Move occurrences of the unknown higher.
      (8*x + (-2)) + (9 + (-1)*(7*x)) == 0    Arithmetic.
      (8*x + (-2)) + (9 + ((-1)*7)*x) == 0    Change the association of * operators.
      (8*x + (-2)) + (9 + (-7)*x) == 0    Arithmetic.
      ((-2) + 8*x) + (9 + (-7)*x) == 0    Move a copy of the unknown to the right.
      ((-2) + 8*x) + ((-7)*x + 9) == 0    Move a copy of the unknown to the left.
      (((-2) + 8*x) + (-7)*x) + 9 == 0    Change the association of + operators.
      ((-2) + (8*x + (-7)*x)) + 9 == 0    Change the association of + operators.
      ((-2) + (8 + (-7))*x) + 9 == 0    Eliminate one copy of the unknown.
      (-2) + (8 + (-7))*x == 0 - 9    Subtract 9 from both sides.
      (8 + (-7))*x == (0 - 9) - (-2)    Subtract -2 from both sides.
      x == ((0 - 9) - (-2))/(8 + (-7))    Divide both sides by 8 + (-7).
      x == (-7)    Arithmetic.

Is anybody interested in having step-by-step equation solving abilities like this added to Sage?

Ted

David Joyner

unread,
Oct 9, 2016, 2:12:13 PM10/9/16
to sage-devel, SAGE edu
On Sun, Oct 9, 2016 at 2:07 PM, Ted Kosan <ted....@gmail.com> wrote:
> For the past few years I have been working on an artificial intelligence
> step-by-step equation solver for elementary algebra equations that solves
> these equations using steps that a human would typically use. Here is an
> example of what I have working so far:
>
> In> LineForm(SolveSteps(MathParse("(8*x - 2 == -9 + 7*x)"), _x))
>
> 8*x - 2 == (-9) + 7*x The original equation.
> (8*x - 2) - ((-9) + 7*x) == 0 Subtract (-9) + 7 * x from both
> sides.

...

> x == (-7) Arithmetic.
>
> Is anybody interested in having step-by-step equation solving abilities like
> this added to Sage?
>

I think a graphical version of this would be useful as a sage-based
online high school math tutorial program, such as the khan academy
algebra modules.


> Ted
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

David Joyner

unread,
Oct 9, 2016, 2:40:38 PM10/9/16
to sage-devel, SAGE edu
On Sun, Oct 9, 2016 at 2:20 PM, Ted Kosan <ted....@gmail.com> wrote:
> David wrote:
>
>> I think a graphical version of this would be useful as a sage-based
>> online high school math tutorial program, such as the khan academy
>> algebra modules.
>
> Are either of the following examples close to what you have in mind?:
>
> http://data.ssucet.org/temp/solve_steps_example.png
>

This doesn't seem to have anything.

> https://www.youtube.com/watch?v=cy6bwNBkAK0
>

Not quite. I'm just talking about an automated system to help a create
student hint (like webassign has). A student goes through a khan
academy assignment, gets stuck, and they click a "help" button (which
would then call your program to create a series of graphics) to see
how a similar problem is solved step-by-step.

Ted Kosan

unread,
Oct 9, 2016, 2:59:16 PM10/9/16
to sage...@googlegroups.com
David wrote:

>> http://data.ssucet.org/temp/solve_steps_example.png
>
> This doesn't seem to have anything.

It is a larger .png file, and it may take a while to load.



>> https://www.youtube.com/watch?v=cy6bwNBkAK0
>
> Not quite. I'm just talking about an automated system to help a create
> student hint (like webassign has). A student goes through a khan
> academy assignment, gets stuck, and they click a "help" button (which
> would then call your program to create a series of graphics) to see
> how a similar problem is solved step-by-step.

Generating a series of graphics which show a similar problem being
solved step-by-step is fairly straightforward. This is what is shown
in the above .png file.

The program shown in the video is much more sophisticated than the
Khan Academy hint system in that it is the beginnings of an AI-driven
ITS (Intelligent Tutoring System). Instead of just showing similar
solved problems, an ITS would be like having Sal Khan sitting in the
seat next to a student tutoring them in person.

Ted

David Joyner

unread,
Oct 9, 2016, 3:12:13 PM10/9/16
to SAGE edu
On Sun, Oct 9, 2016 at 2:59 PM, Ted Kosan <ted....@gmail.com> wrote:
> David wrote:
>
>>> http://data.ssucet.org/temp/solve_steps_example.png
>>
>> This doesn't seem to have anything.
>
> It is a larger .png file, and it may take a while to load.
>

I see it now. It actually loaded in my browser in a smaller format and
I had to click on it to see the graphic.

>
>
>>> https://www.youtube.com/watch?v=cy6bwNBkAK0
>>
>> Not quite. I'm just talking about an automated system to help a create
>> student hint (like webassign has). A student goes through a khan
>> academy assignment, gets stuck, and they click a "help" button (which
>> would then call your program to create a series of graphics) to see
>> how a similar problem is solved step-by-step.
>
> Generating a series of graphics which show a similar problem being
> solved step-by-step is fairly straightforward. This is what is shown
> in the above .png file.
>

I am not saying what you have doesn't have value. In fact, the opposite.

However, it's my personal opinion that the output is not readable by a
student at the level we are discussing (which is very very low). I
could be wrong. Just my 2 cents.

Another idea: Why not break the 20 or so steps to solve a problem down
to questions? Each step would be presented, follow by "Is this
correct? (Y/N)" Occasionally, present a wrong step (eg, subtracting a
3 instead of a 4). If they answer incorrectly, just put them back on
the right path. If they answer correctly, give them a point or a star
or something.


> The program shown in the video is much more sophisticated than the
> Khan Academy hint system in that it is the beginnings of an AI-driven
> ITS (Intelligent Tutoring System). Instead of just showing similar
> solved problems, an ITS would be like having Sal Khan sitting in the
> seat next to a student tutoring them in person.
>
> Ted
>
> --
> You received this message because you are subscribed to the Google Groups "sage-edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-edu+u...@googlegroups.com.
> To post to this group, send email to sage...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-edu.

Ted Kosan

unread,
Oct 9, 2016, 4:00:20 PM10/9/16
to sage...@googlegroups.com
David wrote:

> However, it's my personal opinion that the output is not readable by a
> student at the level we are discussing (which is very very low). I
> could be wrong. Just my 2 cents.

It turns out the program in the video is based on the following
research that was done in 1987:

http://pat-thompson.net/PDFversions/1987StrucInAlg.pdf

This research indicates that students as low as the 7th grade should
have no problems learning math using expression trees. I have not
tested the program with students this young yet, but I have tested it
with the college freshman I teach, and it has been able to fix long
held misconceptions a number of them had about how math works.



> Another idea: Why not break the 20 or so steps to solve a problem down
> to questions? Each step would be presented, follow by "Is this
> correct? (Y/N)" Occasionally, present a wrong step (eg, subtracting a
> 3 instead of a 4). If they answer incorrectly, just put them back on
> the right path. If they answer correctly, give them a point or a star
> or something.

This shouldn't be too difficult to implement. However, how would the
software know why the user answered incorrectly when they do?

Ted

Imran Iqbal

unread,
Jan 28, 2017, 6:40:24 AM1/28/17
to sage-edu
Yes I would like to have the details...

Ted Kosan

unread,
Jan 28, 2017, 1:54:06 PM1/28/17
to sage...@googlegroups.com
This video shows one configuration of the step-by-step solver being used with a manual manipulation application:

https://www.youtube.com/watch?v=cy6bwNBkAK0


The following tutorial provides a brief explanation of how the equation solver works:
   
    1) Parsing and the Language of Expression Trees (http://patternmatics.org/temp_1/mathfuture/lesson4/)

    2) Tree Pattern Matching and Transformation Rules (http://patternmatics.org/temp_1/mathfuture/lesson5/)

    3) The Hidden Rules Mathematicians Use to Solve Elementary Algebra Equations (http://patternmatics.org/temp_1/mathfuture/lesson6/)

Ted

--
You received this message because you are subscribed to the Google Groups "sage-edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-edu+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages