Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#2126 2015-10-08 17:34:48

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27638

2 (7 - 6) + 3 + 8 = 13


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2127 2015-10-08 21:10:37

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27651


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2128 2015-10-08 21:28:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27664

2 + 7 (6 / 6) + 4 = 13


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2129 2015-10-08 22:37:18

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27677


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2130 2015-10-09 03:13:08

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27690

27 - 6 - 9 + 0! = 13


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2131 2015-10-09 04:16:00

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27703

2 x 7 - 7 + 0 + 3! = 13

A puzzle:

TWO - SEVEN - SEVEN + ZERO + THREE = 27703

Each letter in the puzzle stands for a different single-digit number from 0 to 9.

Also, one third of the reverse of the sum of the digits on the left-hand side of the equation = 13.

Find the letter values. The puzzle has a unique solution.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2132 2015-10-09 09:51:40

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27716

27 - 7 - 1 - 6 = 13

Also, one third of the reverse of the sum of the digits on the left-hand side of the equation = 13.

I do not understand, can you explain?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2133 2015-10-09 13:53:01

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27729

2 + 7 - 7 + 2 + 9 = 13

I do not understand, can you explain?

One third of (the reverse of (the sum of (the digits on the left-hand side of the equation))) = 13.

ie, add up all the digits that appear on the left-hand side of the equation, reverse the answer, and divide the result by 3. The answer should be 13.

eg,
532-12677-12677+1542+50983 = 27703
5+3+2+1+2+6+7+7+1+2+6+7+7+1+5+4+2+5+0+9+8+3 = 93
93 reversed = 39
39 / 3 = 13

When a puzzle like this comprises 10 different letters it's a fluke if there's a unique solution - which I wanted to achieve - and so I added that constraint (while still maintaining a link to the number 13).

Last edited by phrontister (2015-10-09 14:06:22)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2134 2015-10-09 14:16:43

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27742

2*7 - 7 + 4 + 2 = 13

532-12677-12677+1542+50983 = 27703

Unfortunately, my program did not spit that out.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2135 2015-10-09 14:22:20

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27755

2 + 7 / 7 + 5 + 5 = 13

Unfortunately, my program did not spit that out.

It wouldn't, cos those numbers are incorrect. I only used them to illustrate my example.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2136 2015-10-09 17:04:32

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27768

Hi phrontister;

582 - 13937 - 13937 + 4362 + 50633 = 27703


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2137 2015-10-09 23:58:41

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27781

2 x 7 + 7 - 8 x 1 = 13

Hi Bobby;

Correct! smile

I adapted your M code to solve it and give the sole answer. smile I tried doing that with Rasher's but got too tangled and scrapped the idea.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2138 2015-10-10 02:24:24

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27794

I used rashers code for it.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2139 2015-10-10 11:46:26

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27807

I had used rasher's code too, for my first try at it. It gave 7 solutions, which I copied into Excel via 'Copy As'/'Plain Text', which handily automatically enters the results into separate cells. Then above those cells I entered a row containing the number of occurrences of each letter, multiplied them by the pasted values, summed the results, reversed those and divided by 3...which confirmed the unique solution. All quite quick and easy.

But then I wanted to try the Excel bit in M, which is when I struck a snag with rasher's code and so used yours instead.

EDIT: Success! I copied the adapted code (the bit that I used Excel for) from your code, pasted it into rasher's, and ran it on the 'solutions[[1]]' variable. Placing a semicolon after '// Framed]]' suppresses rasher's framed 7-solution output, leaving the unique solution as the sole output. smile

{t,w,o,s,e,v,n,z,r,h}
{5,8,2,1,3,9,7,4,6,0} 13

Last edited by phrontister (2015-10-10 14:17:19)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2140 2015-10-10 17:15:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27820

-2 + 7 + 8(2^0) = 13

I am adjusting rasher's code to be more versatile.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2141 2015-10-10 20:14:30

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27833

2 x 7 + 8 - 3 x 3 = 13

Hi Bobby;

In what way/ways do you want to make rasher's code more versatile?


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2142 2015-10-10 20:51:51

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27846

2 - 7 + 8 + 4 + 6 = 13

I want it to handle numbers and letters. To handle any number of them. To do multiplications and divisions if possible and to make into a function.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2143 2015-10-11 18:50:53

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27859

Hi Bobby;

I guess you already know that rasher's code handles other maths operators (eg, multiplication and division) like your code does: ie, the required operators need to be manually entered into the code.

It can also handle numbers as long as the term they're in only contains numbers, and that the 'FromDigits' function is removed from the term where it appears in the 'Solve It' and 'Display Results & Checks' sections.

Ideally, I'd like to be able to just enter the equation (say, into an Input prompt) and then evaluate the notebook.

I've recently tweaked the code of my StringPosition solver (used in this puzzle) that we discussed around post #520. I'd only set it up then for 4-digit numbers, so had to apply a fix for these 5-digit numbers. Now it will handle numbers of 'any' length (within reason); and I've also restricted the 'N' output to be the exact length required.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2144 2015-10-11 19:54:55

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

That is what I want to do too, just enter the equation and constraints and let the program figure all the rest out.

27872


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2145 2015-10-11 21:36:23

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27885

2 x 7 - (8/8)^5

x = post#:

For the contraints, you could probably leave 'mustdiffer=True' in the code, as in most (all?) cases for these puzzles all letters assume differing values.

Also, terms commencing with zero should probably be outlawed and that could be coded in too.

I wonder if that additional constraint I included in my post #2131 could have been included in rashers constraint list instead of me coding for it separately at the end? I'll look at that, I think.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2146 2015-10-11 21:41:33

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27898


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2147 2015-10-11 23:07:37

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27911

- 2 + 7 + 9 - 1 x 1 = 13

A puzzle:

TWO - SEVEN + NINE + ONE x ONE = 27911

Each of the eight different letters in the puzzle stands for a different single-digit number chosen from the range 0 to 9 (meaning two of these ten numbers aren't used).

Find the letter values. The puzzle has a unique solution.

Last edited by phrontister (2015-10-11 23:08:25)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2148 2015-10-12 03:45:52

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27924



In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#2149 2015-10-12 16:47:14

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: Add 13 more and post it forever.

27937

Correct! smile

Did you use rasher's code? It took my rasher's about 50 minutes to solve, but your code just 25 seconds! Looks like rasher's didn't like the fact that two values (2 & 8) were missing from its 10-number range (0 - 9), but yours didn't mind.

I set the puzzle up a bit differently than others that I've posted by including multiplication and not using up all of the numbers in the given range, just in case you wanted to try those differences out on your adjusted rasher.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#2150 2015-10-12 18:32:27

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Add 13 more and post it forever.

27950

27 - 9 - 5 - 0 = 13

I used my code.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB