SERVING THE QUANTITATIVE FINANCE COMMUNITY

katastrofa
Posts: 8621
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Get 24 from 1, 3, 4 and 6

How men invented useful problems.

Cuchulainn
Posts: 60753
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Get 24 from 1, 3, 4 and 6

Write 24 using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers.
int main()
{
int a, b, c, d, answer;
a = 1;
b = 3;
c = 4;
d = 6;
}
// output: The answer is 24
a/b == 0 hmmm.. Implementation-dependent.

24 is a highly composite number, just like 5040. Coincidence?
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

neauveq
Posts: 10
Joined: May 28th, 2018, 10:25 pm

Re: Get 24 from 1, 3, 4 and 6

My guess is that such a solution is not possible if we are limited to +, -, /, * operations. I don't know enough Maths to prove or disprove this. As a newcomer to programming, I tried to have a crack at this in Python. I found 23, 23.(6), 24.(3), 25 but no 24.

katastrofa
Posts: 8621
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Get 24 from 1, 3, 4 and 6

You need to use the mathematics of quantum neutrino fields!

neauveq
Posts: 10
Joined: May 28th, 2018, 10:25 pm

Re: Get 24 from 1, 3, 4 and 6

Hmm, what about the same problem but with numbers 8,6,7,5,3,0,9?

Cuchulainn
Posts: 60753
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Get 24 from 1, 3, 4 and 6

http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

katastrofa
Posts: 8621
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Get 24 from 1, 3, 4 and 6

All men. Wearing dresses, what?
Attachments

tagoma
Posts: 18351
Joined: February 21st, 2010, 12:58 pm

Re: Get 24 from 1, 3, 4 and 6

Write 24 using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers.
"or" in your post gets me somewhat confused. has one to use the 4 operators?

ISayMoo
Topic Author
Posts: 2246
Joined: September 30th, 2015, 8:30 pm

Re: Get 24 from 1, 3, 4 and 6

It's all right guys. It's OK not to know the answer.

tagoma
Posts: 18351
Joined: February 21st, 2010, 12:58 pm

Re: Get 24 from 1, 3, 4 and 6

It's all right guys. It's OK not to know the answer.
my answer would be 6/(1-(3/4)) that i got by brute force, but i’m not sure whether you require the all 4 arithmetics operators to be used (game statement is ambiguous for non English-native).
you introduce a game but seem reluctant to be more specific on rules. why?
btw what is the starting point to get to a result using an elegant mathematical reasoning?

ISayMoo
Topic Author
Posts: 2246
Joined: September 30th, 2015, 8:30 pm

Re: Get 24 from 1, 3, 4 and 6

bearish
Posts: 5255
Joined: February 3rd, 2011, 2:19 pm

Re: Get 24 from 1, 3, 4 and 6

The closest I could get was (1+4+3*6)++

katastrofa
Posts: 8621
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Get 24 from 1, 3, 4 and 6

I think (14-6)*3 is also an acceptable answer.

Cuchulainn
Posts: 60753
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Get 24 from 1, 3, 4 and 6

ISM is using you as guinea-pigs for a neurotic arithmetic experiment. It's like generating expressions.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik

katastrofa
Posts: 8621
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Get 24 from 1, 3, 4 and 6

Arithmetics is dangerous. Easy to sprain an ankle when doing all the jumps.

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...

 JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...

GZIP: On