PDA

View Full Version : looping logic puzzles



Uubnewb
February 22nd, 2012, 02:39 PM
Hi everyone,

For a job interview I once had to complete a logical puzzle that basically take you through a loop to determine the answer. Something like this:



Start with some equation like: x + y = z
Give them some starting values:
x = 0
y = 1000

Then they give you some steps:

Step 1: Increase x by 5. Go to step 2.
Step 2: If y is greater than zero, decrease y by 2. Go to step 3.
Step 3: If if x is greater than 255, go to step9 otherwise go to step 7.
...
Step n: How many iterations will it take for z to be less than 0 and what will the final answer of x and y be?


Please note: this is not the problem I had to solve, it is just a quick example I sucked out of my thumb.

So my question is: Do these puzzle types have a specific name? I've tried to look for them on the internet but did not really know what to look for.

If anybody can point me in the right direction with either some search terms or a website where I can find these puzzles I'd greatly appreciate it.

Thanks in advance.

blazemore
February 22nd, 2012, 03:35 PM
Maybe "algorithm"? Or "pseudocode"?

Uubnewb
February 22nd, 2012, 04:05 PM
I've actually allready tried both of those keywords. :)

Unfortunately my searches only yielded pseudocode that solves a problem, or puzzles that need to be solved by pseudocode.

What makes the puzzles I'm looking for unique is that you first have to identify the algorithm, then find a way to translate that algorithm to a mathematical formula in order to solve the problem. You COULD always just tough it out and do thousands of iterations, but that is not the idea of the puzzle.

Khayyam
February 22nd, 2012, 04:30 PM
Uubnewb ...

Your example is basically a 'mathematical puzzle (http://en.wikipedia.org/wiki/Mathematical_puzzle)' or 'brain teaser (http://en.wikipedia.org/wiki/Brain_teaser)' involving cartesian coordinates (http://en.wikipedia.org/wiki/Cartesian_coordinate_system).

Perhaps MathPuzzle (http://www.mathpuzzle.com/) is what your looking for?

HTH ... khay

oldos2er
February 22nd, 2012, 05:47 PM
Thread moved to The Community Cafe.

Uubnewb
February 23rd, 2012, 06:43 AM
Thread moved to The Community Cafe.
Oops, my bad. Sorry 'bout that.



Uubnewb ...

Your example is basically a 'mathematical puzzle' or 'brain teaser' involving cartesian coordinates.

Perhaps MathPuzzle is what your looking for?

HTH ... khay


Oh these links are just awsome, thank you. I still haven't found the exact puzzles I've been looking for, but the ones on mathpuzzle.com are really nice.

Once again, thanks for the links, I appreciate it.