×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Mathcad for brainteaser

Mathcad for brainteaser

Mathcad for brainteaser

(OP)
Can Mathcad be set up to do the following:

Given:

1, 3, 4, and 6

use these four numbers using any of the standard math functions (+,-,/,*) and determine the expression that will equal 24.

jackboot
Replies continue below

Recommended for you

RE: Mathcad for brainteaser

Not easily.

You'd be better off writing a program in a language that supports EVAL or equivalent, that creates equations with valid syntax and then works out the result.

You'd also have to be very careful about defining your precedence rules, if brackets are not permitted.

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Mathcad for brainteaser

If brackets are not permitted, then it can't be solved.

David

RE: Mathcad for brainteaser

RPN?

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Mathcad for brainteaser

My kid showed me a solution without brackets or RPN.  I keep forgetting that we should hire teenagers while they still know everything.

David

RE: Mathcad for brainteaser

Hello,

are you sure, it works? I wrote it in MathCAD and didn't find a solution. It wasn't "easy" (@GregLocock) but it works. There are 1536 posibilities, no one is doubled and there is no equation with the result 24 (if my program works right).

You find the program as PDF at my website:
http://mitglied.lycos.de/Chr_Meissner/home/studium/ueb/Brainteaser.pdf


I havn't time enough to check the whole code for mistakes, even I can't endure that a teenager get the solution.

Christian.

RE: Mathcad for brainteaser

The only way I know that works is 4*6/13

TTFN

RE: Mathcad for brainteaser

(OP)
http://www.kuro5hin.org/story/2005/1/20/142742/948


This is the address to the math teaser.

It says:
24 - Arithmetic - Hard
Using each of the numbers 1,3,4,6 create an expression which evaluates to 24. You may use any of the four standard arithmetic operations *,+,-,/ and parenthesis. You must use each of the numbers exactly once. You need not use any other numbers. It can also be done with 3,3,8,8.

It is supposed to have a solution unless it is just a joke.

jackboot

RE: Mathcad for brainteaser

(OP)
Christian - that is a real cool Mathcad sheet.

I really need some training.

jackboot

RE: Mathcad for brainteaser

Christian - I agree with jackboot. my eyes glazed over.

Jackboot, if you can understand Christians' sheet then use that.

Otherwise I'd define a syntax, that all parentheses must be used. Then I'd write all the legal patterns, where i is an integer and o is an operator

((ioi)o(ioi))
(io(io(ioi)))
(((ioi)oi)oi)
((io(ioi))oi)
(io((ioi)oi))

is that all there are?

make the appropriate substitutions and you should get there.

I make the total number of combinations 5*(4*3*2*1)*4*4*4=
7680, of which many are no doubt dupes, since  + and * are commutative.



Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Mathcad for brainteaser

HOW ABOUT  6/(1-(3/4)) = 24

Remember...
       "If you don't use your head,            
                   your going to have to use your feet."

RE: Mathcad for brainteaser

@meintsi:

You forgot that the original question was WITHOUT brackets (zdas04 from Apr 7). Based on that statement I wrote the program. But I've actual no time to change it working with brackets.

Christian.

RE: Mathcad for brainteaser

(OP)
Christain - sorry about the mistake.  I put the actual web link on this post as soon as I saw it.

meintsi - you win the cigar.  How did you come up with the solution?

jackboot

RE: Mathcad for brainteaser

Where does this say that brackets are not permitted?

And if you read the author's second post from  11 Apr 05 11:56}, I repeat...

"This is the address to the math teaser.

It says:
24 - Arithmetic - Hard
Using each of the numbers 1,3,4,6 create an expression which evaluates to 24. You may use any of the four standard arithmetic operations *,+,-,/ and parenthesis. You must use each of the numbers exactly once. You need not use any other numbers. It can also be done with 3,3,8,8.

It is supposed to have a solution unless it is just a joke."

Remember...
       "If you don't use your head,            
                   your going to have to use your feet."

RE: Mathcad for brainteaser

Similarly, the second answer would be   8/(3-(8/3))=24

Remember...
       "If you don't use your head,            
                   your going to have to use your feet."

RE: Mathcad for brainteaser

This is a very old and often asked problem.

Solutions sets also include
1237    1334    1467    1555    1569    1668
2258    2469    4778    5668    5788



But the hardest one is to solve is....

Obtain an expression which equals 24.

Using the numbers 4 7 7 9
Using + - x / .

 

Remember...
       "If you don't use your head,            
                   your going to have to use your feet."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close