Tuesday, September 15, 2009
Links
Search
Share
- Tom Chrome Extension


- ToM @ Twitter

- MeeT ToM

- Daily Tricks Widget
- Vista Gadget 1.5
- iPhone Widget
- Windows XP Widget
- Google Toolbar Button
- Suggestions
Favorite Links
- Vista Sidebar Gadgets
- Widgets for Web 2.0
- C Sharp Tricks
- Interview Information
- Illustrator - Elar Alexander
Bookmark Us
Previous Posts
- Humphrey Thou Sand
- Even upside down?
- Any way
- On the rebound
- 17 again?
- Beady Eyed
- Literary Digest 2
- 6
- The best thing since...
- Easy - Just add 'em up

10 Comments:
is it
212/606 = 0.34983498
or
242/303 - 0.79867986
I'll have carry more decimals to know for sure
Ragknot, you got both solutions :) Just add ... to the end of the RHSs to indicate recurrence.
...how did you do it?
I used what I call "brute force".
LOL - excellent method.
Chris,
I will be more specific if you can do the same next time.
Sub solve()
small = 0.0001
again:
c = 0
For W = 1 To 9
For O = 0 To 9
For D = 1 To 9
For V = 0 To 9
For F = 0 To 9
For I = 0 To 9
For L = 0 To 9
For M = 0 To 9
'======================
If W = O Then GoTo nxt
If W = D Then GoTo nxt
If W = V Then GoTo nxt
If W = F Then GoTo nxt
If W = I Then GoTo nxt
If W = L Then GoTo nxt
If W = M Then GoTo nxt
If O = D Then GoTo nxt
If O = V Then GoTo nxt
If O = F Then GoTo nxt
If O = I Then GoTo nxt
If O = L Then GoTo nxt
If O = M Then GoTo nxt
If D = V Then GoTo nxt
If D = F Then GoTo nxt
If D = I Then GoTo nxt
If D = L Then GoTo nxt
If D = M Then GoTo nxt
If F = I Then GoTo nxt
If F = L Then GoTo nxt
If F = M Then GoTo nxt
If I = L Then GoTo nxt
If I = M Then GoTo nxt
If L = M Then GoTo nxt
'=======================
wow = Val(W & O & W)
dvd = Val(D & V & D)
film = Val(F & I & L & M)
film = Val("." & film & film)
result = wow / dvd
If result > film - small And result < film + small Then c = c + 1: Debug.Print c; wow; dvd; result - film
nxt:
Next M, L, I, F, V, D, O, W
If c > 2 Then small = small / 10: Debug.Print "Trying Again with "; small: GoTo again
Debug.Print "Done"
End Sub
Hi Ragknot, thanks for your "brute force" code. I'm glad I wasn't more specific as then you might not have given your funny first explanation.
A useful trick is to realise that .FILMFILMFILM... = FILM/9999.
I see that there's a valuable attribute to FILM/9999.
I am always concerned about rounding problems beyond 8 decimals places but by computing FILM/9999 and WOW/DVD you get similar algorithms for each, giving you a better chance of wow/dvd equaling film/9999 EXACTLY much better.
I think it's always worthwhile examining the problem before coding. It might make an extremely long brute force attack simpler or in extreme cases, feasible.
You may even get carried away, and solve it without computer involvement.
A bit late, but, the 9999 trick let's you write WOW*9999=DVD*FILM, bye-bye slow divisions and their rounding errors if you use a computer to crack it.
Post a Comment
Links to this post:
Create a Link
<< Home