0
$\begingroup$

Looking for a way to generate random mathematical equations that equal an integer between 0 and 9, a way to rank the complexity of the equation rendered, and a method to note the mathematical concepts utilized within the equation.

My first guess is that a random integer between 0 and 9 would be selected. After that, your guess is much more likely to be better than mine.

EDIT: To be more clear, solutions should ONLY result in the following: 0,1,2,3,4,5,6,7,8,9.

  • 2
    What is the motivation behind this task?2011-06-10
  • 0
    Maybe he is making capture?2011-06-10
  • 0
    what kind of equations you are interested in? also, equations can not be equal to smth, are you talking about their solutions?2011-06-10
  • 1
    @Gortaur: Do you have links to the meanings of capture and smth?2011-06-10
  • 0
    @Yuval Filmus: My motivation is a secret. Is there anything about the question and the solution it seeks that is unclear to you?2011-06-10
  • 0
    @blunders: capture was wrong, I meant captcha: this randomized algorithms often used for captcha, e.g. I saw couple with limits of fractions of polynomials. smth = something: the statement "an equation is equal to an integer" seems to be meaningless.2011-06-10
  • 0
    @Gortaur: Just noticed I had not answer your question about the types of equations. Answer would be any that are possible, though randomly selected.2011-06-10
  • 0
    @Gortaur: No, not attempting to make a [CAPTCHA](http://en.wikipedia.org/wiki/CAPTCHA), though I thought that might be what you meant. And that's correct, no indeterminates should not be within the solution, or to be more clear, solutions should ONLY result in the following: 0,1,2,3,4,5,6,7,8,9.2011-06-10
  • 0
    @blunders, I've answered already.2011-06-10
  • 0
    @blunders, it's still not clear to me whether you want an expression that $\it evaluates$ to a digit, or an $\it equation$ whose only $\it solution$ is a digit. That is, do you want something like $(17+19)/12$, or something like $x+\sqrt x=12$?2011-06-10
  • 0
    @Gerry Myerson: "x + 3 = [0-9]" where x is TRUE, meaning [0-6] would be TRUE, [7-9] would be FALSE. All generated equations must evaluate as true.2011-06-11
  • 0
    @Gerry Myerson: Looked at your edit, and rolled it back, reason being that the solutions should be equations rather than integer themselves. Meaning I want to generate equations that resolve to a fixed integer (or in this case, a set of them), not integers that fit within an an equation. The generated equations should represent as many math mathematical concepts as possible while still resolving to [0-9].2011-06-11
  • 0
    @blunders, I didn't do an edit. It's not clear to me what you mean by "resolve", as in "equations that resolve to a fixed integer." I $\it think$ you mean equations like $x+\sqrt x=12$ which is true only if $x=9$, but I'm not sure. I also don't understand "$x$ is TRUE" and I don't understand "[0-6] would be TRUE" because I understand how an equation can be true but not how a number can be true. I think you have to do a lot of rethinking about just what it is you want to ask; meanwhile, voting to close.2011-06-11
  • 0
    @blunders: that's also not clear for me what do you want and I wondering the same as Gerry. Either you elaborate on this or I vote to close the question.2011-06-11

2 Answers 2

2

I am still not sure what do you want, but I guess you are talking about roots. Ok, lets consider a class of linear equations. They have only two parameters: $ax+b = 0$. Choosing randomly $\hat{x} = 0,1,...,9$ you have a condition on $a$ and $b$: $a\hat{x}+b = 0$. for this class you can only randomly choose one of the variables (preferably, $b$ not to make $a$ equal to zero).

Example. $x = 2$, then $2a+b = 0$. You make $b = rand(0,100)$ and $a = -0.5 b$. then the solution will be $x=2$ as it was desired.

You can also consider another class - but note that you would like to have a unique solution. Say, for quadratic equation you may want to say "find the positive root of an equation". Then algorithm is the following: choose $\hat{x} = 0,1,...,9$ and $x'$ to be a negative number (preferably integer also). Then any equation of the form $a(x-\hat{x})(x-x') = 0$ has desired roots. For this equation you can choose independently $a$ (any) and $x'$ (negative). To make it more tough, open the brackets after the choice of all parameters.

Example. We choose again $\hat{x} = 2$ and $a = rand(0,12)$ and $x' = -rand(0,100)$. then we have an equation $ax^2 - (2+x')x + 2x' = 0$.

  • 0
    I'm assuming, in your first example, you mean for a solution $x = 2$, then $2ax + b = 0$...?2011-06-10
  • 0
    +1 @Gortaur: Thanks, stepped out, just got back. Answers looks fine, realized while I was out (looking at the question on my phone) that the question was flawed, though a good start, so I'm not going to edit the question since it's my error. Also, believe @amWhy is right, would you confirm that. Thanks!2011-06-11
  • 0
    @blunders: I will not confirm it. This statement doesn't make sense to what I've written2011-06-11
1

Pick a positive integer n between 0 and 4 and a positive integer p between 1 and 5. Add r instances of (y+(-y)) to n+p, where r indicates a random positive integer, in other words (n+p)+(y_1+(-y)_1)+...+(y_r+(-y)_r). The complexity of the equation compared to other equations of the same type comes as the value equal to r. One could also select 4 positive integers between 0 and 2, or 5 positive integers two of which lie between 0 and 2 and three of which lie between 0 and 1, and many other possibilities exist. The partitions of 9 here work similarly.

  • 0
    +1 @Doug Spoonwood: complexity was meant to be the inclusion of concepts such as: addition, subtraction, division, multiplication, roots, fractions, powers, Decimals, percentages, etc. until as many concepts had been used that would not result in getting an answer that would not equal [0-9]. That said, your idea was creative, addressed two of the three parts of the question as far as I'm able to tell - though, to me, incremental redundant patterns produce volume, not complexity. As very possible I've misunderstood your answer, either way thank you!2011-06-11