|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
[numbers] Solution Clarification thread
OK...we are going to try this again. I am posting my last message from the previous thread next. Some rules of this new thread:
1. One issue at a time. If you need something clarified, don't post it until I have clarified the issue the person before you brought up. This might mean you have to wait a little while before posting what you need clarified. That's OK. 2. Don't post anything that doesn't deal with the topic at hand. 3. Let's try and make this as simple as possible. I really don't think it is all that hard... Ok, next post is my post from last thread, modified slightly. Forget everything from the previous thread, it is gone. |
|
#2
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
You can use the 4 basic operators, + - / and *. That is a subtraction operator, not a negator. It can NOT be used as such:
-(5+6)+20=9 You can use parentheses, but they must be necessary. 3+(4+5) is NOT necessary use. It is the same as 3+4+5. Necessary use is (3+4)*5 OK, say you had this set: 10,20,30,40,50,60,120 All of the following ARE valid: 20+40+60=120 10+20+30+60=120 10+20+40+50=120 10*20-30-50=120 10*60/20+40+50=120 60/10*20=120 (60-50)*(40-30)+20=120 The following demonstrates duplicates, i.e. solutions that are NOT distinct and should only count as one solution. 20+40+60 and 60+40+20 - changing the order does not make a different solution. 60/10*20 and 20/10*60 - while this may look different, it is the same. Anytime you find a solution that is x/y*z, z/y*x always exists. No reason to have both, so this is a duplicate. (60-50)*(40-30)+20 and (50-60)*(30-40)+20 - follows the same as last time. Once you find one, you always have the other. Ok, first person that needs a clarification, step up. |
|
#3
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
Well, how about this somewhat mathematical definition of duplicates:
Take the two expressions you're interested in. If there's not the same amount of numbers in each, they're not duplicates (as in 2+3 and 2+3+4-4; first uses 2 numbers, second uses 4) If they don't use the same numbers, they're also not duplicates (as in 2+3+4-4 and 2+3+5-5) Then, define two functions by changing all numbers to letters, so that the same numbers match the same letters in both expressions. For example: (60-50)*(40-30)+20 and (50-60)*(30-40)+20 become func1(a,b,c,d,e):=(a-b)*(c-d)+e func2(a,b,c,d,e):=(b-a)*(d-c)+e Now, if func1(a,b,c,d,e)-func2(a,b,c,d,e)=0 for all values of a,b,c,d,e the two original expressions are considered duplicates. Use the same process for any number of parameters, not just 5, of course |
|
#4
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
OK....this sounds good...and somehow I knew you would be the first ;)
I've run through it on paper, and it seems solid. Let me post up a couple of examples so that everyone is on the same page... 20+40+60 and 60+40+20 f1 = a + b + c f2 = c + b + a f1 - f2 = a + b + c - c - b - a f1 - f2 = 0 60/10*20 and 20/10*60 f1 = c/a*b f2 = b/a*c f1 - f2 = c/a*b - b/a*c = (cb)/a - (bc)/a f1 - f2 = 0 (60-50)*(40-30)+20 and (50-60)*(30-40)+20 f1 = (a-b)*(c-d)+e f2 = (b-a)*(d-c)+e f1 - f2 = ac-ad-bc+bd+e-bd+bc+ad-ac-e f1 - f2 = 0 So, here is our rule set... 1. If two solutions use a different amount of numbers, they are different. 2. If two solutions use different numbers, they are different. 3. if f1()-f2() <> 0 then they are different. I'm glad we got a smart one like xs0 around here Any more clarifications? |
|
#5
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
Will the given number/result sets all be solveable or is there the possibility of impossible to solve combinations?
for example: numbers(1,2,3,4,5,6) result(999) will the numbers all be different, or is there the possibility of a number being used multiple times in one set? for example: numbers(1,2,1,4,5,6) |
|
#6
|
||||
|
||||
|
[numbers] RE: RE: Solution Clarification thread
Quote:
The sets may be impossible. Quote:
There may be duplicate numbers in a set. Next? |
|
#7
|
|||
|
|||
|
[numbers] RE: RE: Solution Clarification thread
Quote:
(60-50)*(40-30)+20 = 120 30*20/(50-40)+60 = 120 f1 - f2 = (60-50)*(40-30)+20 - 30*20/(50-40)+60 = 10*10+20 - 600/10+60 = 120 - 120 = 0 Any two valid solutions should equal 0 when subtracted. Perhaps you mean that the simplified versions of both equations are the same? |
|
#8
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
(60-50)*(40-30)+20 and 30*20/(50-40)+60
f1 = (a-b)*(c-d)+e f2 = d*e/(b-c)+a f1 - f2 = ((a-b)*(c-d)+e) - (d*e/(b-c)+a) f1 - f2 = (ac-ad-bc+bd+e) - (de/(b-c)+a) f1 - f2 = ac-ad-bc+bd+e - de/(b-c)-a Please continue to work that out until the right hand side of the equation is 0. |
|
#9
|
||||||
|
||||||
|
[numbers] Convet to variables first!
Quote:
Try converting to letters (variables). ( (a - b) * (c - d) + e ) - ( (d*e) / (b - c) ) + a Not the same. The key point is that no matter what goes into the function, the values must be identical for func1 and func2. Try running this code and you'll see that different output is produced: php Code:
|
|
#10
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
Is there any penalty for duplicates in the results, or will they just not be counted as points?
|
|
#11
|
|||
|
|||
|
[numbers] RE: RE: Solution Clarification thread
Quote:
Your script will tell me, by way of its output, how many points it scored. If it reports an invalid score, it will be disqualified. |
|
#12
|
|||
|
|||
|
[numbers] RE: RE: Solution Clarification thread
Quote:
I don't think -(5+6)+20=9 should be illegal; it is just a duplicate of 20-5-6=9. It's getting kind of late, so maybe I'm being stupid. Correct me if I'm wrong here... |
|
#13
|
|||
|
|||
|
[numbers] RE: Solution Clarification thread
<quote>
don't think -(5+6)+20=9 should be illegal; it is just a duplicate of 20-5-6=9. It's getting kind of late, so maybe I'm being stupid. Correct me if I'm wrong here... </quote> Read the explanation about using functions with varaibles (instead of numbers) and you will see that the answer is staightforward. Matt, you could provide a specific format in which you want the answers to be given. thus as results you will not have 20-5-6 and 20-6-5. Everybody sticks to the guidelines and i guess we come up with identical solutions (unless the solutions are wrong). Suggestion - Each way of getting to a certain result must be canonized (as mentioned earlier in the contest description). The solution set for a given line (7 numbers) should be sorted (as string). Only the total number of ways is added to the out file, but when checkme=1 one should get a sorted result This would make judging very simple my 1 cent dvorak |
|
#14
|
|||||||
|
|||||||
|
[numbers] RE: RE: Solution Clarification thread
Hi!
Just a very simple example which shows me somethting is missing... Set of numbers: 3,3,3,3,9 Quote:
1. 3*3*3/3 2. 3-3+3*3 Quote:
Same amount of numbers --> may be duplicates... Quote:
Same numbers used in both expressions --< may be duplicates Quote:
f1(a,b,c,d) = a*b*c/d f2(a,b,c,d) = a-b+c*d Quote:
Without further proof (hence all values are identical - clever bastard that I am) I claim that f1(a,b,c,d)-f2(a,b,c,d) euqals 0 for all possible values of a,b,c,d. Is there anyone out there believing equation 1. and 2. should be considered as duplicates ;-) CU maxhb |
|
#15
|