SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
katastrofa
Posts: 8494
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

June 18th, 2019, 11:59 am

How men invented useful problems.
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

June 19th, 2019, 8:36 am

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;
answer = a/b + c*d;
printf("The answer is %d\n",answer);
}
// 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
 
User avatar
neauveq
Posts: 10
Joined: May 28th, 2018, 10:25 pm

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

June 20th, 2019, 11:05 pm

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.
 
User avatar
katastrofa
Posts: 8494
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

June 20th, 2019, 11:28 pm

You need to use the mathematics of quantum neutrino fields!
 
User avatar
neauveq
Posts: 10
Joined: May 28th, 2018, 10:25 pm

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

June 20th, 2019, 11:42 pm

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


 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

June 22nd, 2019, 2:56 pm

Image
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
 
User avatar
katastrofa
Posts: 8494
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

June 22nd, 2019, 3:09 pm

All men. Wearing dresses, what?
Attachments
9E44F014-3E97-4FE5-9E9D-7D740A46E45C.jpeg
 
User avatar
tagoma
Posts: 18276
Joined: February 21st, 2010, 12:58 pm

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

June 22nd, 2019, 5:16 pm

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?
 
User avatar
ISayMoo
Topic Author
Posts: 2205
Joined: September 30th, 2015, 8:30 pm

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

June 22nd, 2019, 10:38 pm

It's all right guys. It's OK not to know the answer.
 
User avatar
tagoma
Posts: 18276
Joined: February 21st, 2010, 12:58 pm

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

June 23rd, 2019, 6:06 am

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?
 
User avatar
ISayMoo
Topic Author
Posts: 2205
Joined: September 30th, 2015, 8:30 pm

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

June 23rd, 2019, 10:00 am

Your answer is accepted.
 
User avatar
bearish
Posts: 5158
Joined: February 3rd, 2011, 2:19 pm

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

June 23rd, 2019, 12:38 pm

The closest I could get was (1+4+3*6)++
 
User avatar
katastrofa
Posts: 8494
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

June 23rd, 2019, 1:43 pm

I think (14-6)*3 is also an acceptable answer.
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

June 23rd, 2019, 3:40 pm

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
 
User avatar
katastrofa
Posts: 8494
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

June 30th, 2019, 1:22 pm

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

PW by JB

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


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

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


GZIP: On