Tuesday, September 15, 2009

Wow, DVD Film

Solve: WOW/DVD=.FILMFILMFILMFILM ...

Each letter is a unique digit.

Labels:

10 Comments:

Blogger Ragknot said...

is it

212/606 = 0.34983498
or
242/303 - 0.79867986

I'll have carry more decimals to know for sure

September 15, 2009 6:48 AM  
Blogger Chris said...

Ragknot, you got both solutions :) Just add ... to the end of the RHSs to indicate recurrence.

September 15, 2009 6:54 AM  
Blogger Chris said...

...how did you do it?

September 15, 2009 6:57 AM  
Blogger Ragknot said...

I used what I call "brute force".

September 15, 2009 7:34 AM  
Blogger Chris said...

LOL - excellent method.

September 15, 2009 7:52 AM  
Blogger Ragknot said...

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

September 15, 2009 8:01 AM  
Blogger Chris said...

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.

September 15, 2009 8:09 AM  
Blogger Ragknot said...

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.

September 15, 2009 10:53 AM  
Blogger Chris said...

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.

September 15, 2009 5:29 PM  
Blogger Chris said...

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.

September 17, 2009 4:57 PM  

Post a Comment

Links to this post:

Create a Link

<< Home