![]() |
3388 puzzle
:wink:
3 3 8 8 puzzle Using the four numbers 3, 3, 8, and 8, and the usual four arithmetic operations (addition, subtraction, multiplication and division), can you make the number 24? This looks a bit too easy (3 × 8 = 24), until I tell you that you have to use all four numbers - both 3s and both 8s. No silly tricks allowed - you can't use an 8 and a 3 to make 83, or raise numbers to powers or take square roots or factorials or anything else of that kind. You can use fractions on the way, of course, but the final answer must be exactly 24. For example: 3 × 8 + (3/8) makes 24 and three-eighths, which is quite close, but no banana. Mally :coffee: |
Are parenthesis allowed?
|
I think it is impossible.
|
A closer solution is 8*8/3+3 = 24.33333... instead of 24.375 written by Mally.
|
[SPOILER]By computer search: 24=8/(3-8/3) :banana:
[/SPOILER] |
[QUOTE=R. Gerbicz][SPOILER]By computer search: 24=8/(3-8/3) :banana:
[/SPOILER][/QUOTE] Well, I also brute-forced this problem before saying it is not possible. Now I understand why I hadn't any success, I forgot to add this parentheses configuration. I only had a b c d (a b) (c d) ((a b) c) d (a b c) d (a b) c d But unfortunately I forgot a (b c d) :( Can I ask you what programming language you did with? |
[QUOTE=victor]Can I ask you what programming language you did with?[/QUOTE]
And for the edification of some of us, could you post the code or psuedo thereof? |
1 Attachment(s)
[QUOTE=Uncwilly]And for the edification of some of us, could you post the code or psuedo thereof?[/QUOTE]
I've written this in UBASIC. See the attachment for the source code. |
1 Attachment(s)
Your UBASIC looks very cryptic to me :wink:
I haven't tried to understand your code yet, but may be my PHP (I know, it's a poor programming language, and I don't like it, but it is damn practical, easy and quick to prog) code could interrest someone ... |
| All times are UTC. The time now is 05:18. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.