Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in. #1 2009-08-08 21:11:34
Sum of fractions which equals 1Hi all folks, #2 2009-08-08 23:29:06
Re: Sum of fractions which equals 1Hi shiwaji, a question for you, can you prove this is the only solution? Last edited by bobbym (2009-08-09 08:45:25) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #3 2009-08-10 15:40:55
Re: Sum of fractions which equals 1hello bobbym, #4 2009-08-10 15:57:19
Re: Sum of fractions which equals 1Hi shiwaji; In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #5 2009-08-11 01:50:34
Re: Sum of fractions which equals 1Hi Bobby, "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #6 2009-08-11 06:01:22
Re: Sum of fractions which equals 1Hi phrontister; Code:FOR A=1 TO 9 FOR B=1 TO 9 FOR C=1 TO 9 FOR D=1 TO 9 FOR E=1 TO 9 FOR F=1 TO 9 FOR G=1 TO 9 FOR H=1 TO 9 FOR I=1 TO 9 IF A/(10*B+C) + D/(10*E+F) + G/(10*H+I) =1 THEN Print[A,B,C,D,E,F,G,H,I] NEXT I NEXT H NEXT G NEXT F NEXT E NEXT D NEXT C NEXT B NEXT A As an exercise for you, what can you do to speed it up. Last edited by bobbym (2009-08-14 20:33:23) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #7 2009-08-11 07:51:56
Re: Sum of fractions which equals 1
bobbym,
It seems that BC would take 2 numbers from a set of 9 digits. #8 2009-08-11 07:59:56
Re: Sum of fractions which equals 1Hi integer; Code:Also IF A/(10*B+C) + D/(10*E+F) + G/(10*H+I) =1 THEN Print[A,B,C,D,E,F,G,H,I] is the worst way to test for success. Last edited by bobbym (2009-08-15 11:18:03) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #9 2009-08-11 08:22:27
Re: Sum of fractions which equals 1Integer also notes that since the left hand side's terms are all the same structure, the number of permutations can lose another factor of 6. Why did the vector cross the road? It wanted to be normal. #10 2009-08-11 09:10:42
Re: Sum of fractions which equals 1Easier now with hindsight to prune out permutations, since there is only one answer. Doing it beforehand could prune out the solution. Thats why I went with the permutations of 9. Last edited by bobbym (2009-08-11 15:10:31) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #11 2009-08-11 19:52:47
Re: Sum of fractions which equals 1I was curious to find out how an experienced BASIC programmer would tackle this in BASIC, and as I use LibertyBASIC I posted a question on their forum this afternoon. Janet responded (verrrrry quickly!) with this code, which in 86 seconds finds that there is only one solution (the one quoted by Bobby...plus its 5 positional permutations):- Last edited by phrontister (2009-08-11 22:48:32) "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #12 2009-08-11 21:34:23
Re: Sum of fractions which equals 1Just wondering, are there number theory problems for which there is a proof that a solution cannot be reached without brute force? #13 2009-08-11 23:52:40
Re: Sum of fractions which equals 1Hi phrontister;
My beef with her code is this line! Last edited by bobbym (2009-08-12 00:02:20) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #14 2009-08-11 23:57:19
Re: Sum of fractions which equals 1Hi identity; In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #15 2009-08-12 00:29:40
Re: Sum of fractions which equals 1Hi Bobby,
What beef is that? Do you have a fix for it, or a better approach altogether? "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #16 2009-08-12 00:34:13
Re: Sum of fractions which equals 1Hi phrontister; Last edited by bobbym (2009-08-12 01:04:02) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #17 2009-08-12 05:44:34
Re: Sum of fractions which equals 1
Yes - I think I can see that relying on results from fractions can, in some circumstances, produce errors.
Is this the sort of thing you mean, Bobby? It seems a bit wordy...you've probably got a better way of expressing that. Last edited by phrontister (2009-08-12 05:45:41) "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #18 2009-08-12 07:26:34
Re: Sum of fractions which equals 1Hi phrontister; Code:a=10
f=1/3
[loop]
a=a-f
if a=0 then print "done" : end
print a
goto [loop]
Or try this
x = 0
f=1/7
while x <> 500
x = x + f
print x
wend
endFor some fractions they terminate as expected and for some others they don't. Floating point arithmetic is not the same as how humans work with numbers. Where we see the number line as continuous, to the computer there are gaps like morse code. Some numbers cannot be represented in binary in a finite amount of digits. Last edited by bobbym (2009-08-18 17:09:05) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #19 2009-08-12 10:35:12
Re: Sum of fractions which equals 1Hi Bobby,
The principle of this workaround came to me in bed last night just before I went to sleep (my mind's most productive moments!), and I was going to post about it morning...but you've saved me the trouble. "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #20 2009-08-12 16:41:45
Re: Sum of fractions which equals 1So could this problem be solved theoretically? #21 2009-08-12 17:12:11
Re: Sum of fractions which equals 1Hi Identity;
Since you got me looking at Basic, I dug up an old, old copy of QBasic 7.1. It only has an old dos gui. but it's like 25 times faster than LBasic 4.02 on my machines. Last edited by bobbym (2009-08-13 23:08:57) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #22 2009-08-13 23:41:08
Re: Sum of fractions which equals 1Hi Bobby,
I tried those exercises and I see what you mean. 1/10 surprised me.
I tried that, but I got the same incorrect responses as before. Maybe I didn't code it correctly. I'll try again... "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #23 2009-08-13 23:52:55
Re: Sum of fractions which equals 1Hi phrontister; In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. #24 2009-08-14 02:31:12
Re: Sum of fractions which equals 1I don't have "break". My OS is Windows XP. I tried CTRL + all the buttons on my keyboard, but nothing except F10 did anything (F10 paused it, but I couldn't gain any further control over the program from there). "The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson #25 2009-08-14 17:20:49
Re: Sum of fractions which equals 1Its ctrl + pause/break : this key is above the arrow keys (at the top). It stops program execution in LBasic. Last edited by bobbym (2009-08-14 17:21:41) In mathematics, you don't understand things. You just get used to them. Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means. 90% of mathematicians do not understand 90% of currently published mathematics. |