Defining whether numbers solutions are identical

All discussion relevant to Countdown that is not too spoilerific. New members: come here first to introduce yourself. We don't bite, or at least rarely.
Post Reply
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Defining whether numbers solutions are identical

Post by Gavin Chipper »

I don't know if this has been discussed at length before, but there an obvious way to do this? Or does it come down to someone's arbitrary definition?

Just as a random example, I would say that in making 297, 100*(2+1)-3, 100*3-2-1 are equivalent, and all the other combinations where you swap the order of muliplication/division or swap round the usage of the 3 or the 2,1 combo. This is fairly clear cut to me but are there more awkward scenarios?

What about 100, 100*1, 100/1 - would you count that as one, two or three solutions? And 100+1-1?
craig
Rookie
Posts: 55
Joined: Thu Oct 29, 2009 5:32 pm

Re: Defining whether numbers solutions are identical

Post by craig »

Depends on why you're asking. If it's about the show and people showing methods, using the 297 example then I would say they are the same. If you're just talking in general then I would still say yes but have no reason to back that up and will probably change my mind soon anyway.
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

craig wrote:Depends on why you're asking. If it's about the show and people showing methods, using the 297 example then I would say they are the same. If you're just talking in general then I would still say yes but have no reason to back that up and will probably change my mind soon anyway.
I was just thinking about my own made up scoring system which requires knowing how many solutions there are for spot on, one away, two away etc.
User avatar
Charlie Reams
Site Admin
Posts: 9494
Joined: Fri Jan 11, 2008 2:33 pm
Location: Cambridge
Contact:

Re: Defining whether numbers solutions are identical

Post by Charlie Reams »

Gavin Chipper wrote: Just as a random example, I would say that in making 297, 100*(2+1)-3, 100*3-2-1 are equivalent, and all the other combinations where you swap the order of muliplication/division or swap round the usage of the 3 or the 2,1 combo. This is fairly clear cut to me but are there more awkward scenarios?
WTP does some kind of "duplicate solution" suppression, but the principle is not explained. It is difficult to define exactly.
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

Charlie Reams wrote:
Gavin Chipper wrote: Just as a random example, I would say that in making 297, 100*(2+1)-3, 100*3-2-1 are equivalent, and all the other combinations where you swap the order of muliplication/division or swap round the usage of the 3 or the 2,1 combo. This is fairly clear cut to me but are there more awkward scenarios?
WTP does some kind of "duplicate solution" suppression, but the principle is not explained. It is difficult to define exactly.
Can you think of other cases that are more borderline than the one above?

Edit - I think if I were defining it, I'd say that anything that makes no difference does not count as an extra solution. This includes multiplying and dividing by 1. Otherwise you'd have to consider the different solutions that involve */1 in different places. I'd also disregard things like 100+1-1, 100+5-4-1, 100*2/2 and 100*8/4/2. That would be the same as just 100. I don't think it would be too hard to define this. I think if there is any portion of the calculation that can simply be removed without putting it somewhere else or replacing it with something else then it doesn't count in terms of making an extra solution. 100+2+3 would still be different from 100+4+1.
Peter Mabey
Kiloposter
Posts: 1123
Joined: Sat Mar 01, 2008 3:15 pm
Location: Harlow

Re: Defining whether numbers solutions are identical

Post by Peter Mabey »

Should 100x3+2+1 be counted as different from 100x(2+1)+3 ? - the arithmetic is the same, but done in a different order. :?
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

Peter Mabey wrote:Should 100x3+2+1 be counted as different from 100x(2+1)+3 ? - the arithmetic is the same, but done in a different order. :?
I would count them as the same. If you were doing it on Apterous (step by step), you might do 2+1 first anyway. Then you would be left with two 3s in the selection, and you can't distinguish between them.

I'd say if you can simply swap two bits around like that they are the same, and anything you can simply take out doesn't count.

But something like 25*12+13 and 25*13-12 would be considered different.
User avatar
Charlie Reams
Site Admin
Posts: 9494
Joined: Fri Jan 11, 2008 2:33 pm
Location: Cambridge
Contact:

Re: Defining whether numbers solutions are identical

Post by Charlie Reams »

It's quite hard to eliminate things like 100+5-3-2, there are a lot of ways to go around in an (indirect) circle.
User avatar
Clive Brooker
Devotee
Posts: 505
Joined: Wed Feb 11, 2009 7:37 pm
Location: San Toy

Re: Defining whether numbers solutions are identical

Post by Clive Brooker »

Charlie Reams wrote:WTP does some kind of "duplicate solution" suppression, but the principle is not explained. It is difficult to define exactly.
I'm with you on the first point - I don't think I could create an algorithm if my life depended on it - but I thought WTP's method was clearly explained in his FAQs:

http://www.crosswordtools.com/numbers-g ... p#distinct

The seemingly plausible condition that "The basic operation that is done to each original number is the same" causes some bizarre anomalies - at least it did with the old free version. Since the wording of his FAQ hasn't changed for many years, and he is still promising in the future a revised interpretation of distinctness which conforms more closely with intuition, I'm disinclined to consider subscribing to find out whether it works better now.

Amongst the many weird cases I've found, my favourite is this:

25 9 4 2 1 1 : 820

In the old free version, WTP used to find 2 distinct solutions:

(((25-2)x9)-(1+1))x4=820
((((25-2)x9)-1)-1)x4=820

but he didn't find ((25-2)x4-1)x9+1, presumably regarding it as identical to one of the others.

One thing I think I would do is to remove all unnecessary brackets, so that 6-(8-7), 7-(8-6), 7+6-8 are all identical.
David Williams
Kiloposter
Posts: 1259
Joined: Wed Jan 30, 2008 9:57 pm

Re: Defining whether numbers solutions are identical

Post by David Williams »

On the one hand, I can't see it matters, and it depends how you define it. If you really mean identical, 100+(1+2) is not the same as (100+1)+2. For Countdown purposes what matters is the point at which Rachel would say to the second contestant "That's the same as your opponent. Show him your solution." I don't think I've ever seen that. One wonders if they do the occasional re-shoot.

Thinking about it, Carol would often be given an almost identical solution. Typically she would not write it down, but go through the solution she'd already written up, say something like "Yes, yes, same way", but she would never get anyone to actually show their workings. Strangely, I don't recall this happening with Rachel.
User avatar
JimBentley
Fanatic
Posts: 2820
Joined: Fri Jan 11, 2008 6:39 pm
Contact:

Re: Defining whether numbers solutions are identical

Post by JimBentley »

I agree with David, I think, there's two different levels; an algorithmical solver would (and should) consider (75-3-4)x6 as distinct from (75-5-2)x6, as it uses different elements, but a human would consider them essentially the same as you're just making the 7 in a different way.
User avatar
Charlie Reams
Site Admin
Posts: 9494
Joined: Fri Jan 11, 2008 2:33 pm
Location: Cambridge
Contact:

Re: Defining whether numbers solutions are identical

Post by Charlie Reams »

JimBentley wrote:I agree with David, I think, there's two different levels; an algorithmical solver would (and should) consider (75-3-4)x6 as distinct from (75-5-2)x6, as it uses different elements, but a human would consider them essentially the same as you're just making the 7 in a different way.
Isn't the idea though to make the solver mimic intuition as accurately as possible? That's the hard bit.
User avatar
JimBentley
Fanatic
Posts: 2820
Joined: Fri Jan 11, 2008 6:39 pm
Contact:

Re: Defining whether numbers solutions are identical

Post by JimBentley »

Charlie Reams wrote:
JimBentley wrote:I agree with David, I think, there's two different levels; an algorithmical solver would (and should) consider (75-3-4)x6 as distinct from (75-5-2)x6, as it uses different elements, but a human would consider them essentially the same as you're just making the 7 in a different way.
Isn't the idea though to make the solver mimic intuition as accurately as possible? That's the hard bit.
Ah, I see. I suppose you'd then have to consider stuff like (75x4)-(3x4) as equivalent to (75-3)x4, where there's unnecessary duplication. But what about (75x4)-(6x2), would that also be seen as equivalent to (75-3)x4 too? To be honest this is rapidly heading somewhere that is beyond me. To borrow a phrase: "If it's too hard, I can't understand it".
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

JimBentley wrote:
Charlie Reams wrote:
JimBentley wrote:I agree with David, I think, there's two different levels; an algorithmical solver would (and should) consider (75-3-4)x6 as distinct from (75-5-2)x6, as it uses different elements, but a human would consider them essentially the same as you're just making the 7 in a different way.
Isn't the idea though to make the solver mimic intuition as accurately as possible? That's the hard bit.
Ah, I see. I suppose you'd then have to consider stuff like (75x4)-(3x4) as equivalent to (75-3)x4, where there's unnecessary duplication. But what about (75x4)-(6x2), would that also be seen as equivalent to (75-3)x4 too? To be honest this is rapidly heading somewhere that is beyond me. To borrow a phrase: "If it's too hard, I can't understand it".
I would consider (75-3-4)*6 to be different from (75-5-2)*6, as well as those others being different. You could call (75*4)-(3*4) unecessary duplication, but I just see it as a wasteful method, although different. I would consider the arithmetic to be different. It's not just a case of removing a part, or swapping two bits round.

But something else I've just thought about is this:

100+3=103 and 100+2+1=3

Going by what I've said, these two are different. But if you do the 2+1 first and then do 100+3, surely there is no difference in identity between the 3s. So in a sense you can't define how it has been done. I'm not sure what Apterous does about this - presumably it treats the 3s as separate numbers and keeps their history?
User avatar
Adam Dexter
Enthusiast
Posts: 491
Joined: Fri Jan 23, 2009 4:41 pm
Location: Kidderminster

Re: Defining whether numbers solutions are identical

Post by Adam Dexter »

Gavin Chipper wrote:If you were doing it on Apterous (step by step), you might do 2+1 first anyway. Then you would be left with two 3s in the selection, and you can't distinguish between them.
I'd do it (100 - 1)* 3, and not use the 2 at all. I think it's always good practice to do using the fewest numbers, then you can apply this for more complicated solutions and not waste a number that might be useful later on.

Just a tangent :)
ADAM DEXTER: MAXED DATER
We're off to button moon :)
User avatar
Clive Brooker
Devotee
Posts: 505
Joined: Wed Feb 11, 2009 7:37 pm
Location: San Toy

Re: Defining whether numbers solutions are identical

Post by Clive Brooker »

Charlie Reams wrote:Isn't the idea though to make the solver mimic intuition as accurately as possible? That's the hard bit.
I'm hoping something like this works. Suppose you have a solution to 747 written as (75/(10/2))*50-(8-5). Without replacing any of the numbers used, this can be reduced to 75*50*2/10+5-8, which I would regard as the standardised form of that solution. In the triple multiplication, the largest number is put first, followed by the next largest. The division is after the multiplication is complete. All unnecessary brackets have been removed.

I haven't got the patience to figure out the process in full detail, the the principle is that if two solutions reduce to an identical expression after following a defined set of reduction rules, the solutions are equivalent. If they don't, they're not.

I always visualise a numbers solution as a single expression rather than a series of steps with intermediate solutions, so perhaps my intuition differs from that of others here.
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

I quite like your thinking Clive. But I think your method as stated would count 100*3+2+1 and 100*(2+1)+3 as separate solutions and I'm not sure I like that.
User avatar
Clive Brooker
Devotee
Posts: 505
Joined: Wed Feb 11, 2009 7:37 pm
Location: San Toy

Re: Defining whether numbers solutions are identical

Post by Clive Brooker »

Gavin Chipper wrote:I quite like your thinking Clive. But I think your method as stated would count 100*3+2+1 and 100*(2+1)+3 as separate solutions and I'm not sure I like that.
Here are a couple of relatively non-trivial examples:

25*(8/2)*6 + 4
25*(8/2)*6 + 3

How would you deal with these? Undoubtedly you would make the former is equivalent to 25*4*6 + 8/2. Is the latter equivalent to 25*8*3 + 6/2?

Unfortunately my idea of standardising the sequence of numbers and operations doesn't really help either. The multiplication becomes 25*8*6/2, so that it is now the 8/2 which is hidden.

It's "interesting" that the results can be different according to the order in which our process are applied.

Personally I'm more comfortable with 100*3+2+1 being different from 100*(2+1)+3 than I am with 200-(1+1) being different from 200-1-1.
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

Clive Brooker wrote:
Gavin Chipper wrote:I quite like your thinking Clive. But I think your method as stated would count 100*3+2+1 and 100*(2+1)+3 as separate solutions and I'm not sure I like that.
Here are a couple of relatively non-trivial examples:

25*(8/2)*6 + 4
25*(8/2)*6 + 3

How would you deal with these? Undoubtedly you would make the former is equivalent to 25*4*6 + 8/2. Is the latter equivalent to 25*8*3 + 6/2?

Unfortunately my idea of standardising the sequence of numbers and operations doesn't really help either. The multiplication becomes 25*8*6/2, so that it is now the 8/2 which is hidden.

It's "interesting" that the results can be different according to the order in which our process are applied.


I tend to think of both of those above as equivalent to the alternatives. If one is then I'd say they both are because the order of the multiplication/division is irrelevant to me. It might be difficult to come up with an algorithm for a computer program (although I'm not sure) but I'm quite happy that they're the same.
Personally I'm more comfortable with 100*3+2+1 being different from 100*(2+1)+3 than I am with 200-(1+1) being different from 200-1-1.
If you'd put "less uncomfortable" then I'd probably agree.

Edit - I probably read that last bit wrong.
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

I was thinking about this thread again for some reason.
Gavin Chipper wrote:But something else I've just thought about is this:

100+3=103 and 100+2+1=3

Going by what I've said, these two are different. But if you do the 2+1 first and then do 100+3, surely there is no difference in identity between the 3s. So in a sense you can't define how it has been done. I'm not sure what Apterous does about this - presumably it treats the 3s as separate numbers and keeps their history?
You could define solutions to be the same as each other if and only if you can reduce them to the same method based on the fungibility of identical numbers when using a step by step method, so [100+3=103, 103*3=309] rather than (100+3)*3=309.

So obviously if the selection has 100, 2, 2 and you have to make 102, then 100+2 is the same as 100+2.

But you can take it a lot further than that. There's the example I've quoted for one thing. If you have 100, 2, 3, 5, 7 and you have to make 102 then:

1. 100+2=102;
2. 5-3=2, 100+2=102;
3. 7-5=2, 100+2=102

are all the same because the extra 2 you create is fungible with the 2 in the selection, so the 5-3 or 7-5 does nothing. Also:

100-3=97, 97+5=102

would still count as the same as the above because we'd still have an ordering rule. But then if the 2 wasn't in the original selection:

1. 5-3=2, 100+2=102;
2. 7-5=2, 100+2=102

wouldn't be the same by this definition. However, if you had 100, 1, 3, 5, 7:

1. 3-1=2, 100+2=102;
2. 7-5=2, 100+2=102

would be the same because:

7-5=2, 3-1=2, 100+2=102. is the same as both (with a pointless step), so the identity carries across. But this would also mean that with 100, 1, 3, 4, 8:

1. 3-1=2, 100+2=102;
2. 8/4=2, 100+2=2

are the same as well. So maybe this lumps too many solutions together and is quite an extreme solution to this, but I think that it is in some sense "valid".
User avatar
Graeme Cole
Series 65 Champion
Posts: 2025
Joined: Tue Jul 06, 2010 9:59 pm

Re: Defining whether numbers solutions are identical

Post by Graeme Cole »

Expression equivalence, as far as a numbers solver cares
When I wrote the recapping program for Innis and Mark's Comic Relief Countdown marathon, I wrote a numbers solver for it. Writing one of these things makes you think about whether two expressions are equivalent or not.

In principle, you have to generate every possible sub-list of the six numbers, then for each sub-list, generate every arithmetical expression that can be made using all numbers in the sub-list, evaluate all the expressions, and return the one closest to the target. This takes an enormous amount of time, though, so you have to use some short-cuts. Some of them are obvious. For example, when generating expressions, don't generate the expression A - B if A is less than B, don't generate A / B if A is not divisible by B, don't bother generating multiplications or divisions if one of the operands is 1 (unless your solver is running in Platt mode), and so on. However, there are still a huge number of expressions you have to generate - the number of expressions possible from a list of numbers increases exponentially as you add more numbers to the list.

It turns out that finding a good way of deciding that two expressions are equivalent is important when writing a numbers solver. When it generates an expression, it can check whether it's equivalent to any existing expression it already has, and ignore it if so. You might think this laborious checking would slow the program down, but in the long run it speeds it up. The more expressions that can be eliminated, especially when generating expression lists for the smaller lists of numbers which are then used as the basis for forming larger expressions, the less fuel there is for the combinatorial explosion of expressions that occur when you add more and more numbers.

In fact, the minimum a solver needs to do to decide whether two expressions - let's call them E1 and E2 - are equivalent, is to ask:
  • Do both expressions come to the same total?
  • Do both expressions use the same numbers?
If the answer to both of those questions is yes, then you can forget about E2, since E1 is just as useful to you in building larger expressions. As an example, if your program already has (10 - 3) * 5 = 35, then it doesn't also need (10 * 3) + 5 = 35. For the Countdown numbers game, the former is as useful as the latter in any situation. So forget about (10 * 3) + 5. It's a waste of time plugging both of them into every four-, five- and six-number expression you generate.

Expression equivalence as far as everyone else cares
The above definition of expression equality is useful when writing a solver which just needs to decide what the closest possible to the target is and come up with one example solution. However, it doesn't really work as an intuitive definition of equality for expressions. We wouldn't say that (10 - 3) * 5 and (10 * 3) + 5 are equivalent expressions, even though they're of equal use in all situations in the numbers game. And we certainly wouldn't say that, for example, (100 * 3) + (7 * 8) + 6 + 4 and (100 - 8) * 4 - (3 - (7 - 6)) are the same expression. Also, if you wanted your solver to come up with every solution, sans any rearrangements of earlier solutions, this isn't enough.

An ideal definition of equivalence
Handily, there's already a mathematical definition of two statements being equivalent. There's even a special symbol, like the equals symbol but with a third horizontal line, to indicate equivalence. We might say that A + B = C for certain values of A, B and C, but something like A + B = B + A is always true, no matter what the values of A and B are, so we say A+B is equivalent to B+A.

For Countdown purposes, the ideal definition of equivalence for two expressions E1 and E2 might go like this. First, we've got the basic conditions that the two expressions have got to come to the same total and use the same numbers to be considered for equivalence. Suppose we replaced every distinct number in expression E1 with a symbol. We'll use the letters A to F, as we've got at most six distinct numbers. Then we also replace the same numbers in E2 with the same symbols. E1 and E2 are equivalent if they always come to the same total regardless of the values we substitute for the letters A-F. (Incidentally, in this hypothetical substitution we can't just pick any values - it still has to make a legal expression for Countdown. So no clever-clogs antics like dividing by zero, subtracting a larger number from a smaller one, dividing 6 by 4, etc).

So if E1 were 5*6+7, and E2 were 7+6*5, we could write them as E1 = A*B+C and E2 = C+B*A. Whatever the values of A, B and C, E1 = E2. So they're equivalent.

If E1 were (10-3)*5, and E2 were (10*3)+5, then E1 = (A-B)*C and E2 = (A*B)+C. If we say that A is 3, B is 2 and C is 1 then E1 does not equal E2, so they're not equivalent.

Note that this definition has a couple of quirks - some very similar expressions are not considered equivalent, such as 2 * 2 and 2 + 2. Furthermore, two different-looking expressions such as ((24/(6/2)) * (7 - (9-8))) / 3 and 2 * 24 * (7 + 8 - 9) / (3 * 6) are considered equivalent. But for the purposes of a solver which has been tasked to come up with all solutions for a numbers round, deciding whether to tell you about (5*100)/(6/3) if it's already told you about (5*100*3)/6, it could get away with saying "meh, that's basically the same solution as the other one".

Working out whether two expressions are equivalent
But how do we tell whether two expressions are equivalent? I've come up with a method of "normalising" an arithmetical expression. For each set of expressions that are all equivalent to each other, there should be one defined way of writing that expression. Once you've normalised your two expressions in this way, you can tell whether they're equivalent just by comparing them. In a computer program you'd compare the expression trees, but you can equivalently think of it as just comparing the textual representation of the expression character by character.

The goal of the normalisation process is that expressions which only differ by rearrangement of their terms or factors should be considered identical.

Writing the expression in a standard form
Every expression that isn't just a number can either be thought of as:
  • The sum of a series of expressions, possibly with the sum of another series of expressions subtracted, or
  • The product of a series of expressions, possibly divided by the product of another series of expressions.
We're going to try to write every expression like this. So let's say we have the expression:

4 + 5*(1+6) - 10 + 6/2 - (7 - 6)

This is just the sum of 4, 5*(1+6), 6/2 and 6, minus the sum of 10 and 7. So we'll write it like this:

(4 + 5*(1+6) + 6/2 + 6) - (10 + 7)

Analogous rules apply if our expression is a product of a series of expressions, possibly with divisions, such as (6 / (10 / 5)) * (4+1) * (5*2 + 18) / 14. This might be written as (6 * 5 * (4+1) * (5*2 + 18)) / (10 * 14). It's the product of a series of expressions, divided by the product of another series of expressions.

Ordering of terms/factors
At this point, we need to define an order to write the summed (or multiplied) elements in. It doesn't matter how you define the order, as long as your definition can consistently say, for two differing expressions, which one should come first. Besides that, the nitty-gritty of this isn't particularly important, but if you care, I decided on this:
  • If one expression has a higher value than the other, it goes on the left.
  • Otherwise, compare the top-level operators of each of the two expressions (the "top-level" operator is the one you evaluate last, so in (3+4)*5 it's the multiplication sign). The operator with the highest rank (*, /, +, -) goes on the left. A bare number has the lowest rank. So (6 * 7) + (84 / 2) is the correct order, not (84 / 2) + (6 * 7).
  • If it's still a tie, the expression with more numbers in it goes on the left.
  • If it's still a tie, then look at the leftmost sub-expression in each of the two expressions, and compare them according to these rules. If they tie, look at the second sub-expression from the left in each expression, and so on.
  • If it's still a tie after doing all that, then (I hope) you've just got two identical expressions, so it doesn't matter which way round you put them.
This is mainly for addition and multiplication, because for subtraction and division you can't just switch the order of the operands around. Well, you can if you're doing X-X to make 0 or X/X to make 1, but you never need to use 0 so subtraction isn't an issue. If you're dividing an expression by an equivalent-valued expression to make a 1, which is often useful, we'll say that we just apply the rules to each expression and put the higher-ranking one on the left as normal (or top, if you prefer), so it's (75+25)/100 and not 100/(75+25).

We'll have to apply the rule to all sub-expressions as well, and their sub-expressions recursively, so if we have our partly normalised expression as follows (the brackets around the first set of sums aren't strictly necessary, but they're to illustrate that we're doing the sum of a bunch of expressions minus the sum of another bunch):

(4 + 5*(1+6) + 6/2 + 6) - (10 + 7)

We'll rearrange the terms in the expressions on each side of the minus sign and make this:

(5*(6+1) + 6 + 4 + 6/2) - (10 + 7)

Our "products divided by products" expression:

(6 * 5 * (4+1) * (5*2 + 18)) / (10 * 14)

Would be re-ordered like this:

((18 + (5*2)) * 6 * (4+1) * 5) / (14 * 10)

Now we've got a set of rules for defining a normalised arithmetic expression. Any expression can be reduced to this normalised form, and an expression can only be normalised in one way. Then all you have to do is compare the two expressions, removing any redundant brackets before you do so. Having applied this to the solver I wrote earlier in the year, it seems to work, and when told to find all the solutions for a numbers game, I haven't yet seen it give two solutions that are just rearrangements of each other.

What I don't know is whether this method of normalising expressions always produces the same expression from two different expressions which are equivalent. In other words, given any two expressions using the symbols A-F in place of numbers, which are equivalent according to our ideal definition, will they always normalise to the same expression or have I missed something? Maybe it's possible to prove it, or maybe there's a glaring error I haven't spotted? Not sure. How should we treat no-ops? A solver probably wouldn't bother generating things like "multiply by 1", so it's not an issue for solvers, but if contestant 1 said "I did (100+6+5)*7" and contestant 2 said "I did (100+6+5)*7*1" should we treat those as equivalent? Our definition says no, because the two expressions don't use the same numbers, but C2 would probably be asked to show their paper.

I would try to answer some of these, but I've run out of day and this post is too long as it is. So, um, yeah. I'll just leave it for Gevin to pick holes in.

*wanders off just leaving this post sitting here*
User avatar
Matt Morrison
Post-apocalypse
Posts: 7822
Joined: Wed Oct 22, 2008 2:27 pm
Location: London
Contact:

Re: Defining whether numbers solutions are identical

Post by Matt Morrison »

Graeme Cole wrote:Ordering of terms/factors
You forgot to make this header bold.
David Williams
Kiloposter
Posts: 1259
Joined: Wed Jan 30, 2008 9:57 pm

Re: Defining whether numbers solutions are identical

Post by David Williams »

You quite often see something like 100 9 8 7 6 6 for 671.

The contestant says "100x6=600 8x7=56 600+56+9+6=671". As Rachel writes it up she repeats it back to him, and at the end she says "The other 6". I always want the contestant to say "Oh no, sorry, I used the first one twice".
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Defining whether numbers solutions are identical

Post by Jon Corby »

David Williams wrote:You quite often see something like 100 9 8 7 6 6 for 671.

The contestant says "100x6=600 8x7=56 600+56+9+6=671". As Rachel writes it up she repeats it back to him, and at the end she says "The other 6". I always want the contestant to say "Oh no, sorry, I used the first one twice".
You know why she says that though, right?
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

Graeme Cole wrote:I would try to answer some of these, but I've run out of day and this post is too long as it is. So, um, yeah. I'll just leave it for Gevin to pick holes in.

*wanders off just leaving this post sitting here*
You've got me all wrong! It was a very interesting read. Obviously it was from the point of someone wanting to efficiently program a computer to find a solution rather than specifically to find all unique solutions, so it's interesting to see how something like that fits in with our intuitions.
David Williams
Kiloposter
Posts: 1259
Joined: Wed Jan 30, 2008 9:57 pm

Re: Defining whether numbers solutions are identical

Post by David Williams »

Jon Corby wrote:
David Williams wrote:You quite often see something like 100 9 8 7 6 6 for 671.

The contestant says "100x6=600 8x7=56 600+56+9+6=671". As Rachel writes it up she repeats it back to him, and at the end she says "The other 6". I always want the contestant to say "Oh no, sorry, I used the first one twice".
You know why she says that though, right?
Well, I thought I did, but are you going to tell me something different?
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Defining whether numbers solutions are identical

Post by Jon Corby »

David Williams wrote:
Jon Corby wrote:
David Williams wrote:You quite often see something like 100 9 8 7 6 6 for 671.

The contestant says "100x6=600 8x7=56 600+56+9+6=671". As Rachel writes it up she repeats it back to him, and at the end she says "The other 6". I always want the contestant to say "Oh no, sorry, I used the first one twice".
You know why she says that though, right?
Well, I thought I did, but are you going to tell me something different?
I'm not sure, it depends whether the reason you're thinking of is the one I'm thinking of...?
Gavin Chipper
Post-apocalypse
Posts: 13213
Joined: Mon Jan 21, 2008 10:37 pm

Re: Defining whether numbers solutions are identical

Post by Gavin Chipper »

Stop teasing us!
Post Reply