|
|
Topic review (newest first)
- alexhak
- 2010-12-02 05:21:16
- krassi_holmz
- 2006-06-04 19:20:35
Here's the code (Mathematica, rewritten, but really messy and hard-to-understand):
Code:K[n1_, n2_] := Union[{n1 + n2, n1 - n2, n1*n2, n1/n2}];
KK[list_, num_] := Union[Flatten[Table[K[list[[i]], num], {i,
1, Length[list]}]]];
KKK[list1_,
list2_] :=
Union[Flatten[Table[KK[list1, list2[[i]]], {i, 1, Length[list2]}]]];
d[a_, b_, c_, d_, f_] := {
(*abcdfff*)
f[{a}, f[{b}, f[{c}, {d}]]],
(*abcfdff*)
f[{a}, f[f[{b}, {c}], {d}]],
(*abcffdf*)
f[f[{a}, f[{b}, {c}]], {d}],
(*abfcdff*)
f[f[{a}, {b}], f[{c}, {d}]],
(*abfcfdf*)
f[f[f[{a}, {b}], {c}], {d}]
}
d[l_, f_] := d[l[[1]], l[[2]], l[[3]], l[[4]], f];
dd[l_, f_] := dd[l[[1]], l[[2]], l[[3]], l[[4]], f];
dd[a_, b_, c_, d_, f_] :=
(
Print["abcdfff:", f[{a}, f[{b}, f[{c}, {d}]]]];
Print["abcfdff:", f[{a}, f[f[{b}, {c}], {d}]]];
Print["abcffdf:", f[f[{a}, f[{b}, {c}]], {d}]];
Print["abfcdff:", f[f[{a}, {b}], f[{c}, {d}]]];
Print["abfcfdf:", f[f[f[{a}, {b}], {c}], {d}]];
)
p = Permutations[{3, 3, 8, 8}];
res = Table[Union[Flatten[d[p[[i]], KKK]]], {i, 1, Length[p]}];
Union[Flatten[res]]Could explain and rewrite it later.
- krassi_holmz
- 2006-06-04 19:10:31
This program was personal challenge. Here's list of all numbers, which can be expressed using 8,8,3,3:
- krassi_holmz
- 2006-06-04 19:08:17
My program is ready. And guess what-there aren't another solutions except: 8/(3-(8/3))=24!!!
- krassi_holmz
- 2006-06-04 18:34:43
- krassi_holmz
- 2006-06-04 17:27:08
Interesting... Can't you make some program, which gives all possible solutions?
- justlookingforthemoment
- 2006-06-04 12:35:15
Zach wrote:You realise that answer was said all the way up there, right?
And plus, you realise that this post is one year old? Almost exactly.
Oh well, well done for working it out. You missed a closing parenthesis in the second line though.
- jebediah
- 2006-06-04 09:44:13
8/(3-(8/3) = 8/(3-(2 2/3) = 8/(1/3) = 24
You realise that answer was said all the way up there, right?
Well, the answer is not easy, but it exists:
8/3=2,6666666666666666666... (=2,66periodic) (=8/3)
3-2,66p=0,33p (in other way, 9/3-8/3=1/3)
8/0,33p=24 (in other way, 8/1/3=8*3=24)
Summarizing...
8/(3-(8/3))=24
- justlookingforthemoment
- 2005-05-31 18:10:10
Okie dokie, fixed it... I'm using firefox.
I just ticked underline links!

- MathsIsFun
- 2005-05-31 18:06:02
Oh... I wonder why not. It is underlined in Internet Explorer and Firefox on my PC.
Do you have anything unusual about your setup? Operating System / Browser or something?
- justlookingforthemoment
- 2005-05-31 17:14:27
Ohh! I see. Is there are way for you to make all links colourful or underlined or something in your forum? You can never tell if it is linked or not... or is that just me?
- MathsIsFun
- 2005-05-30 21:08:23
"Click and ye shall find"
- Roraborealis
- 2005-05-30 20:30:58
|