Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand things like (x+y)^2 #45

Open
evykassirer opened this issue Dec 13, 2016 · 7 comments
Open

Expand things like (x+y)^2 #45

evykassirer opened this issue Dec 13, 2016 · 7 comments

Comments

@evykassirer
Copy link
Contributor

This would happen if:

  • the exponent is a positive integer
  • all cancelling out and most simplifications have already happened
  • the base of the exponent (e.g. x + y in this example) can't be simplified further

note that issue #36 discusses the opposite of this (x + x) * (x + x) => (x+x)^2 but contrastingly is a simplification we try early on and only happens if the "base" can be simplified further (e.g. x + x can be simplified to 2x)

@hmaurer
Copy link
Contributor

hmaurer commented Jan 20, 2017

I think there should be an extra condition: the expansion should lead to a "simpler version".

It seems this would be quite hard to model because the simplification might happen "10 steps ahead". For example, you might have some expression with a term like (x+y)^5. Expanding it might lead to a bunch of terms cancelling out and be left with something like such as 0. However, it might also lead to a very long expression which is everything but simpler than (x+y)^5. This is tricky :/

Maybe if we could get some measure of the simplicity of an expression (and that's a big if), we could then have a system where the program could backtrack if it cannot find a "simpler" expression than whatever steps it has already reached. It's alright to go a bit uphill but only if you go downhill later :p

@tkosan
Copy link
Contributor

tkosan commented Feb 2, 2017

On the following website is a file named moses-simp.pdf that contains a paper titled "Algebraic Simplification a Guide for the Perplexed":

https://groups.csail.mit.edu/mac/users/gjs/6.945/readings/simplification/

It describes the various ways simplification is typically used in a CAS, which may be helpful for this discussion.

@kevinbarabash
Copy link
Contributor

We should probably also take into consider the context of the expression (x+y)^2. If it's in an equation like (x+y)^2 = 0 then it makes more sense to square root both sides, e.g.

(x+y)^2 = 0
=> nthRoot((x+y)^2) = nthRoot(0)
=> x+y = 0
=> ...

Having some way to detect and perform steps that apply to equations will help with this situation and others to produce steps that are more like what a human would do.

@evykassirer
Copy link
Contributor Author

agreed @kevinbarabash - I think we're gonna have to revamp the way equations work, to be a lot more smart about things. I wonder what the steps towards that are... read some papers? have a meeting on gitter where we brainstorm stuff?

@tkosan
Copy link
Contributor

tkosan commented Feb 3, 2017

@evykassirer, I think it would be useful to brainstorm about various ways mathsteps might be used in the future before determining how equations should work.

@aelnaiem
Copy link
Collaborator

aelnaiem commented Feb 3, 2017

I'll be adding a timeline and doing a better job organizing over the next few days as part of the wiki effort and that will give us something we can discuss around

@aelnaiem
Copy link
Collaborator

I think this should be done within the context of the problem. So in simplifications, it should expand, and in the case of solving an equation, and the variable being solved for is in the root, then we square both sides. Seems like a decent first approach at this problem.

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

No branches or pull requests

5 participants