Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Brain Teasers. |
Acmlm's Board - I3 Archive - Brain Teasers - ||bass' Impossible Yet Possible Quiz - Question 1 (Peg Game) | New poll | | |
Pages: 1 2 | Add to favorites | Next newer thread | Next older thread |
User | Post | ||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
A sequence of 10 pegs (or coins) is placed in a single row randomly e.g., 5 1 3 7 0 4 2 9 8 6. Each peg has a value between 0 and 9. There is a peg for each value. Each player removes a peg from either the left or the right end of the row. After all pegs have been collected (each player takes 5) the winner is the one that collected the pegs with the highest total value.
Find a strategy guarinteed to win. (It may be for either player.) (There is an answer.) |
|||
That Break Guy Since: 11-23-05 From: I'm currently over there Last post: 6876 days Last view: 6876 days |
| ||
Basically you take the pegs that reveal the lowest possible gain while also giving you more points in the end, that way your opponent is pretty much forced to take the other side, which will give you the peg you didn't want your opponent to get. Of course, with the numbers provided, you're better off starting with the 6, rather than the 5.
The flaw in this logic is that if you don't know the values, then it's impossible to know which pegs to pick to guarantee a win. |
|||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
Originally posted by That Break GuyThat method for solving is an exponential angorythim. There is no way you could formulate that strategy for ALL possible games in a single post. The winning strategy has to be a linear algorithim. Furthermore, I don't think you seem to understand the rules of the game. On a player's turn, he can pick from either side. The side you pick on one turn doesn't have to be the same side you pick on the next turn. The "correct" answer can be done on a single sheet of paper, even if you incresed the number of pegs to 100 pegs. PS: Your answer is also wrong. (edited by ||bass on 12-01-05 11:41 AM) (edited by ||bass on 12-01-05 11:45 AM) (edited by ||bass on 12-01-05 12:15 PM) |
|||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
People keep asking me how this is possible if you can't see the values of the pegs. You CAN see them. Read the damn question people. I NEVER said you can't see the values of the pegs. You can. | |||
NSNick Gohma IF ALL ELSE FAILS USE BOOZE Since: 11-17-05 From: Last post: 6433 days Last view: 6433 days |
| ||
For some reason, I couldn't think in straight algebra, so here's a C code thing I think should work:
function char Which_To_Choose ( int a, int b, int c, int d, ) /*! requires [a, b, c, and d are the numbers of the pegs, where a is the leftmost, b is the second to left, c is the second to right, and d is the rightmost] !*/ { object int ares, dres, hidb, hiac; if (d > b){ hidb = d; } else{ hidb = b; } if (a > c){ hiac = a; } else{ hiac = c; } takea = a - hidb; taked = d - hiac; if (takea > taked){ return 'a'; } return 'd'; |
|||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
Your algo plays a SMART strategy but not an unbeatable one. One could construct very specific arrangements of pegs that would defeat this algorithim. There is an answer that works for 100% of all possible arrangements of pegs and it's a MUCH simpler algo, you could do it in under 10 lines easily. | |||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
Hint time: The correct answer will work for any even number of pegs. | |||
Light PKMN Tektite Since: 11-19-05 From: Cat Land Last post: 6789 days Last view: 6789 days |
| ||
left peg right peg left peg.....ect
But im wrong |
|||
Kattwah Acro RIP Acmlm's Board: Feb. 18 2007 Since: 11-17-05 Last post: 6431 days Last view: 6431 days |
| ||
I guess its time for me to throw out a guess here...
Take only the pegs with odd values? Thats a simple solution that works out either way (However, it isnt 100% if they take an odd number.) Heres a question, does it matter who goes first or not? Anyways, explaining my theory with a random example 1 8 5 4 7 9 6 3 2 0 You take 1, he takes 8 (1; 8) You take 5, he takes 4 (6; 12) You take 7, he takes 2 (13; 14) You take 9, he takes 6 (22; 20) You take 3, he takes 0 (25; 20) You win. However, here is a problem that presents itself with a "Not odd every turn" situation... 1 8 6 4 7 9 5 3 2 0 So... I just want to know if Im close or not right now |
|||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
Hint 2: The "correct" soloution looks at all the pegs before the game starts, and then ignores them for the rest of the game. | |||
Deleted User Banned Since: 05-08-06 Last post: None Last view: 6432 days |
| ||
I can't wait to hear the answer on this, ||bass has me all excited. D: | |||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
Begin by seperating the series into sets A and B, alternating as shown. Sum the values of all the integers in each set. In this example, A is 25 and B is 20. Clearly you want to have the elements in set A. Draw from set A (the left). Your opponant is now forced to draw from set B. When your opponant draws, he opens up another element of set A for you to draw. Draw the open element from set A. Repeat this process until all elements have been drawn. This method is guarinteed to win 100% of the time for all arrangements of pegs. |
|||
jeff Double metal axe Since: 11-17-05 Last post: 6431 days Last view: 6431 days |
| ||
what if he picks a in there and you have to be b? =p | |||
emcee Red Super Koopa Since: 11-20-05 Last post: 6432 days Last view: 6431 days |
| ||
EDIT: Ah, crap, I spent so long trying fix the color you posted the answer while I was typing. I thought I needed closing tags.
Ok, I get it. Taking your example: 1 8 5 4 7 9 6 3 2 0 Add up ever other number starting with the first one. 1+5+7+6+2=21 Now starting with the second: 8+4+9+3+0=24 The total of these is more, so those are the ones you want. Here they are color coded: 1854796320 You want the blue ones, so you take the zero: 185479632 They now have to take a red one. It doesn't matter which they take, but lets say they take the 2: 18547963 You of course take the blue: 1854796 They must take a red: 185479 You take a blue: 18547 They take a red: 1854 You a blue: 185 A red for them: 18 You take the last blue and they're left with the red, as long as you get all blues you win because they add up to more. For clarification, the color were for demostration, the "blues" are simply in the group that adds up to the most, and the "reds" are the others. (edited by emcee on 12-03-05 12:27 AM) |
|||
Danielle 6730 Administratorrrr HELLO THERE Since: 11-17-05 From: California Rate me ^_^ Last post: 6432 days Last view: 6431 days |
| ||
Originally posted by mcw That's the catch. You have to go first. |
|||
NSNick Gohma IF ALL ELSE FAILS USE BOOZE Since: 11-17-05 From: Last post: 6433 days Last view: 6433 days |
| ||
A ha. Nice. | |||
||bass Administrator Since: 11-17-05 From: Salem, Connecticut Last post: 6433 days Last view: 6431 days |
| ||
You people need to learn how to read. The question explicitly states that the strategy may be for either player. In this case, it was the first player. | |||
Danielle 6730 Administratorrrr HELLO THERE Since: 11-17-05 From: California Rate me ^_^ Last post: 6432 days Last view: 6431 days |
| ||
How can either player win? I don't see how you can use the same strategy if you don't go first. | |||
Xkeeper Took the board down in a blaze of glory, only to reveal how truly moronical ||bass is. Since: 11-17-05 From: Henderson, Nevada Last post: 6431 days Last view: 6431 days |
| ||
Originally posted by Danielle It just says to pick one and run with it; you aren't forced to use a player that doesn't go first. |
|||
Danielle 6730 Administratorrrr HELLO THERE Since: 11-17-05 From: California Rate me ^_^ Last post: 6432 days Last view: 6431 days |
| ||
Well if they go first.. isn't there always one of each letter available to them no mattter what you do? |
Pages: 1 2 | Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Brain Teasers - ||bass' Impossible Yet Possible Quiz - Question 1 (Peg Game) | | |