Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

discussion on equation pedagogy #90

Closed
evykassirer opened this issue Jan 22, 2017 · 12 comments
Closed

discussion on equation pedagogy #90

evykassirer opened this issue Jan 22, 2017 · 12 comments

Comments

@evykassirer
Copy link
Contributor

An issue to discuss improvements to equations! If you're wondering about something expression specific, open another issue for it - this will be focused around tweaks to make equations better

Summary:

changes to existing steps:

longer term new functionality:

@evykassirer
Copy link
Contributor Author

(and to reply to your comments on #64, @hmaurer , I think that #45 is an isolated issue not too related to equations, and quadratics are being worked on right now, see #50)

@hmaurer
Copy link
Contributor

hmaurer commented Jan 23, 2017

@evykassirer mmh, I meant related in the sense that solving equations might also require some form of "lookahead" mechanism. It's possible that the best path to solve an equation might not be choosable without knowing what would happen down the road. If that makes any sense 😶

@evykassirer
Copy link
Contributor Author

evykassirer commented Jan 23, 2017

ah yeah, I see what you mean

the organizer in me is getting annoyed that these issues are are so related and hard to organize into issues ;D but more seriously, it's neat how intertwined these problems are!

@evykassirer
Copy link
Contributor Author

moving conversation over here (please note that I would prefer if conversation that is more general and not specific to an issue happened in a new issue you create yourself, or in an existing issue meant for general discussion like this one, thanks)

@sangwinc (3 days ago)

There are some interesting design decisions to be made here. E.g. how will your system avoid the following (well-known) nonsense?

a = b
a^2 = ab
a^2 -b^2 = ab -b^2
(a-b)(a+b) = b(a-b)
a+b = b
2b = b
2 = 1

(If you are interested in this kind of thing, you might like the attached paper)

@Article{2015Audited,
author = {Sangwin, C.~J.},
title = {An Audited Elementary Algebra},
journal = {The Mathematical Gazette},
year = {2015},
month = {July},
volume = {99},
number = {545},
pages = {290--297},
doi = {http://dx.doi.org/10.1017/mag.2015.37},
}

Chris
2015-AuditedAlgebra.pdf

@hmaurer (3 days ago)

@sangwinc Interesting; I guess you would need some form of "pre-condition" handling, and branching as in #49 (comment). This could easily get more complex though.

I believe right now the system is purely based on trying out strategies by order of "priority" and applying the one it can, @evykassirer ? When doing elementary algebra this seems very close to what a student would do, since they have yet to develop intuition. But as they get better they'll know some branches are not worth exploring, and that doesn't seem to be something doable in the current architecture. This will show up both it equation solving and simplifications (e.g. #45 (comment)). There would need to be a balance between the "try strategies until one works" approach and the "be clever and look a couple of steps ahead for the best strategy". Ideally this would even adapt depending on the student, but I digress...

EDIT: I read "An audited elementary algebra" diagonally and what I called a "pre-condition" and discussed on #49 (comment) seems to be exactly the topic of the paper. Will read it in details later!

@evykassirer (23 hours ago)

Right now we deal with this by getting to some "standard form" (using strategies by priority like @hmaurer says) and then deciding if it makes sense or not when we get there. It's easy for now because we only allow max one variable (either both sides are constants and not equivalent, in which case we return that the equation cannot hold true, or the sides are equivalent and the equation holds true, or we get something like x=3 and there's a solution, or there's something more complicated - which we just don't do anything with yet)

@sangwinc can you explain a bit more about how the way we design multiplying by the denominator will affect this? or are you generalizing the conversation here to be more about the future of how we deal with equations.

Thanks for the research paper! Maybe we can make a RESOURCES.md file with relevant research and projects :)

@sangwinc

Yes, I am generalising the conversation and suggest you at least have one eye on what is (soon) coming round the corner.

If you have polynomial equations in one variable then things are relatively simple, but you still have to worry about "loosing" a root. E.g. x(x-2)=0 -> x=2 and you've missed off the root x=0. This is so obvious here that you hope student's won't do this, but what about this one? It won't be very long until you want to include equations like this.

(x+5)(x-7)-5 = (4x-40)(13-x)
(x+5-5(x-7))(x-7) = (4x-40)(13-x)
(4x-40)(7-x) = (4x-40)(13-x)
13-x = 7-x
13 = 7.

@kevinbarabash
Copy link
Contributor

Is it safe to say that removing a common factor from both sides that includes a variable will result in a missed solution which may or may not be unique?

@sangwinc
Copy link

The point I'm trying to make is that when you multiply/divide by something you have to ensure it is non-zero. Or, you have to add in a case to consider if it is zero. Here we might have

(x+5)(x-7)-5 = (4x-40)(13-x)
(x+5-5(x-7))(x-7) = (4x-40)(13-x)
(4x-40)(7-x) = (4x-40)(13-x)
13-x = 7-x or 4x-40=0
13 = 7 or x=10.

The answer x=10 is the unique solution to the original equation.

@evykassirer
Copy link
Contributor Author

agreed, when we start to support non-linear equations better, we should definitely make sure to cover these cases

I think that going through math curriculum would help catch a lot of these cases too :)

@arve0
Copy link

arve0 commented Feb 1, 2017

Hi!
First, thanks for the library, great stuff 😄

I have this simple equation: x + 1 = 2

Here are the steps from solveEquation():

  1. SUBTRACT_FROM_BOTH_SIDES
    x + 1 = 2 => (x + 1) - 1 = 2 - 1
  2. SIMPLIFY_LEFT_SIDE
    (x + 1) - 1 = 2 - 1 => x = 2 - 1
    1. COLLECT_AND_COMBINE_LIKE_TERMS
      x + 1 - 1 = 2 - 1 => x + 0 = 2 - 1
      1. COLLECT_LIKE_TERMS
        x + 1 - 1 = 2 - 1 => x + (1 - 1) = 2 - 1
      2. SIMPLIFY_ARITHMETIC
        x + 1 - 1 = 2 - 1 => x + 0 = 2 - 1
    2. REMOVE_ADDING_ZERO
      x + 0 = 2 - 1 => x = 2 - 1
  3. SIMPLIFY_RIGHT_SIDE
    x = 2 - 1 => x = 1

I expected newEquation of step 1 to be without the parenthesis, like in substep a (2 > i > a). Might be a reason the parenthesis is added? For subtracting several terms, maybe?

Edit: To be a bit more specific, I expected (x + 1) - 1 = 2 - 1 to be x + 1 - 1 = 2 - 1.

@aelnaiem
Copy link
Contributor

aelnaiem commented Feb 1, 2017

@arve0 interesting point. I think the parenthesis is an implementation detail because depending on how we're isolating x we might do operations that require parenthesis (like a division or multiplication) and those that don't (like addition or subtraction), but the code groups them so we always add parenthesis.

Do you believe it would be more clear to not have the parenthesis when adding or subtracting?

@sangwinc
Copy link

sangwinc commented Feb 2, 2017

Can I ask (sorry I didn't read the code....) how you are dealing with "associative, commutative binary operators" such as + and *?

Maxima has an "n-ary" operator concept which allows "+" to have an arbitrary number of arguments.
So (x + 1) - 1 is (internally) like "+"("+"(x,1),-1) and x+1-1 is like "+"(x,1,-1).

I quite like this design. "flattening" the first example into the second is essentially using associativity.

You still have the unary minus to worry about, e.g. "+"(x,1,-1) might be displayed as x+1+-1, so that is an important detail.

[EDIT from Evy: answered in #116 ]

@arve0
Copy link

arve0 commented Feb 2, 2017

@aelnaiem: Do you believe it would be more clear to not have the parenthesis when adding or subtracting?

Yes, I would not teach "remember to add parenthesis before subtracting".

@aelnaiem
Copy link
Contributor

aelnaiem commented Feb 2, 2017

Agreed, that makes sense. Let's add an issue for that improvement :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants