Comments (12)
(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)
from mathsteps.
@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 😶
from mathsteps.
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!
from mathsteps.
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 :)
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.
from mathsteps.
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?
from mathsteps.
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.
from mathsteps.
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 :)
from mathsteps.
Hi!
First, thanks for the library, great stuff 😄
I have this simple equation: x + 1 = 2
Here are the steps from solveEquation()
:
- SUBTRACT_FROM_BOTH_SIDES
x + 1 = 2 => (x + 1) - 1 = 2 - 1 - SIMPLIFY_LEFT_SIDE
(x + 1) - 1 = 2 - 1 => x = 2 - 1- COLLECT_AND_COMBINE_LIKE_TERMS
x + 1 - 1 = 2 - 1 => x + 0 = 2 - 1- COLLECT_LIKE_TERMS
x + 1 - 1 = 2 - 1 => x + (1 - 1) = 2 - 1 - SIMPLIFY_ARITHMETIC
x + 1 - 1 = 2 - 1 => x + 0 = 2 - 1
- COLLECT_LIKE_TERMS
- REMOVE_ADDING_ZERO
x + 0 = 2 - 1 => x = 2 - 1
- COLLECT_AND_COMBINE_LIKE_TERMS
- 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
.
from mathsteps.
@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?
from mathsteps.
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 ]
from mathsteps.
@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".
from mathsteps.
Agreed, that makes sense. Let's add an issue for that improvement :)
from mathsteps.
Related Issues (20)
- Can mathsteps handle derivative and integral? HOT 6
- x * (x - 1) = 1 ===>> throws 'Math error: No term with symbol: x , returning no steps' HOT 1
- How to run mathsteps on smartphone? HOT 1
- Severe security vulnerability HOT 5
- Missing parentheses when multiplying with a negative number HOT 5
- more things to add to linter
- Current Limitations HOT 1
- Mathsteps cannot handle quadratic equations HOT 4
- Development Status HOT 1
- handling latex input
- Script to browserify mathsteps
- compute a reverse expression HOT 1
- Fails when left node is only a parenthesis (eg "(x+1)=4", "((x)/(4))=4")
- Canceling out first variable throws error
- How to render these steps using Mathjax or something else? HOT 1
- Project Status and inactive email HOT 2
- bug : x-2/3=0
- Another bug : 2/x=3/4 HOT 2
- Adapting to iOS Swift
- Adapt README.md to link to the most active fork
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathsteps.