reset password
Author Message
ytsai8
Posts: 47
Posted 16:36 Mar 12, 2014 |

Well.. although the project is technically not due yet, do you guys wanna share about the strategies you guys use (not the actual codes)?  Eric intended to do this in class, but we didn't answer (mainly because it's really hard to explain in oral conversations) and I am really curious about other people's strategies too.

My strategy was inspired by Dr.Abbott's "magic numbers"; however, I didn't take tieBreakers in count (I won't tell you it's because I am too lazy to do so).

My bids emphasize on earning the positions that are getting farther and farther from middle(5). On 5, I would bid like 7.7%(out of nowhere) of my total gold, as it gets farther, the % grows proportionally.

And there is one flaw that I found by watching the games run on Hackerrank: when one player is 1 positions away from winning, the other player must bid 100% (or +1) of the winning player's money, so my strategy also included to detect when the opponent is 2 position away from winning. I would use 50% of opponent's money to win, the reason being, even if I lose this round with 50% gold bid, the opponent would lose 50% or more to earn this position, and I will pay the remaining 50% afterwards.

And there are some weird codes in my AI that I don't even remember my logic anymore, but my AI mainly runs with these logic. Not the best, but I am pretty satisfied. 

I would appreciate if anyone else shares so I can copy your logic, I mean inspired by your logic o.O 

dhaimoud
Posts: 11
Posted 17:02 Mar 12, 2014 |

What was your ratio # or so called the magic number?

ytsai8
Posts: 47
Posted 17:09 Mar 12, 2014 |

if position = 5 -> 7.7% of the current total gold

position = 6  -> 15.4%

position = 7 -> 23.1%

so on.. works the other way around too (I had a variable recording the distance from middle);

I had 10% originally instead of 7.7%, but it seems I was wasting too much to win a bid, so I toned it down a little

 

dhaimoud
Posts: 11
Posted 18:14 Mar 12, 2014 |

0.77 is a nice magic #. It works well

rabbott
Posts: 1649
Posted 21:51 Mar 12, 2014 |

For those who are interested, here's my code for determining the maximum and minimum bids. It's in Scala. To avoid making it too easy, I won't explain it, but you should be able to figure it out enough to use it.

val magicNumbers: Vector[Double] = Vector(0.00, 2.68, 3.66, 4.23, 4.64, 5.00, 5.36, 5.77, 6.34, 7.32, 10.00).map(_ * 0.1)
val magicNumbersReverse: Vector[Double] = magicNumbers.reverse 

  /**
   * Returns a pair of bid limits: (advance, retreat). Do not bid more than advance to win an auction and not less than retreat to lose.
   * @param - myMoney my money
   * @param - otherMoney the other player's money
   * @param - tb the TieBreaker, either player 1 or player 2
   * @param lowPos - the space to which I would advance if I won the auction. If I'm player 1 lowPos is the current position - 1.
   * @param highPos - the space to which I would retreat if I lost the auction.    If I'm player 1highPos is the current position + 1.
   * [global parameter] - tbValue - the value of having the Tie Breaker, presumably between 0 and 1.
   *
   * @return a pair of Double's (advance, retreat). Do not bid more than advance to win the auction.
   *                                                                           Do not let the other player win for less than retreat.
   */
def advanceRetreat(myMoney: Money, otherMoney: Money, tb: Player, lowPos: Int, highPos: Int): (Double, Double) = {

    val magic: Vector[Double] = if (lowPos < highPos) magicNumbers else magicNumbersReverse
    val (lowMagic, highMagic): (Double, Double) = (magic(lowPos), magic(highPos))
    val (myTB, otherTB): (Int, Int) = tb.select((1, 0), (0, 1))
    val totalMoney: Double = myMoney + otherMoney + tbValue
    val advance: Double = (myMoney - tbValue * myTB - lowMagic * totalMoney) / (1 - lowMagic)
    val retreat: Double = (highMagic * totalMoney - (myMoney + otherTB * tbValue)) / highMagic
    (advance, retreat)
  }

 

 

Last edited by rabbott at 21:55 Mar 12, 2014.
ytsai8
Posts: 47
Posted 23:15 Mar 12, 2014 |

@Dr.Abbott - Thank you for sharing, but what is the math behind the tieBreakers' assets? 

When I was doing my logic I couldn't really understand the math behind it. It would be good if I can learn some more from you :D

dhaimoud
Posts: 11
Posted 23:30 Mar 12, 2014 |

For information: the magic number bidding is described in I. Ayres, Super Crunchers, New York: Bantam Books, 2007. Its detection is the subject of the paper, A. Ingraham, "A Test for Collusion Between a Bidder and an Auctioneer in Sealed-Bid Auctions", Contributions to Economic Analysis and Policy, 2005.

If you have Mathematica you can play around with to see how it works.

ytsai8
Posts: 47
Posted 00:16 Mar 13, 2014 |

Thanks!! This should be a great material to read during spring break :DD

rabbott
Posts: 1649
Posted 14:19 Mar 13, 2014 |
dhaimoud wrote:

For information: the magic number bidding is described in I. Ayres, Super Crunchers, New York: Bantam Books, 2007. Its detection is the subject of the paper, A. Ingraham, "A Test for Collusion Between a Bidder and an Auctioneer in Sealed-Bid Auctions", Contributions to Economic Analysis and Policy, 2005.

If you have Mathematica you can play around with to see how it works.

Thanks for the reference. Here are two papers where these games were first explored.

Lazarus, A. et. al. "Richman Games" and "Combinatorial Games under Auction Play." The Bidding Game is what the second paper calls a Poorman Game.

 

rabbott
Posts: 1649
Posted 14:26 Mar 13, 2014 |
dhaimoud wrote:

For information: the magic number bidding is described in I. Ayres, Super Crunchers, New York: Bantam Books, 2007. Its detection is the subject of the paper, A. Ingraham, "A Test for Collusion Between a Bidder and an Auctioneer in Sealed-Bid Auctions", Contributions to Economic Analysis and Policy, 2005.

If you have Mathematica you can play around with to see how it works.

Driss,  Do you know where Ayes talk about the Bidding Game in his Super Crunchers book? I can't find it.

Eric Liao
Posts: 158
Posted 11:26 Mar 14, 2014 |

I was mia for past 2 days, seems like this game got a couple people hooked, including me!

My strategy is really simple (since I was mainly focus on creating the contest program, excuse excuse ..):

Besides the strategy I ask you guys to do in class (bid 0 when no money, bid 1 when opponent has no money, and bid opponent money to avoid losing). I have a simple math formula to calculate how much money I need to bid evenly to win the game as followed.

bid = min( opponent_money / opponent_step, my_money / my_step )

Step is defined as how far away from win state (aka position is zero if player1, position is ten if player2). For instance, if my bot is playing as player1, and current bottle position is 5. My bot would recognize my_step as 5 (5-0).

And after got the above formula working to score 53, I shift my focus to the contest program, that hosts all your bot against each other. If you guys are interested in using this contest program to play with your logic or even to create your own game to play with bot. I will share the code I wrote later. I still need to clean up a bit since the code I wrote was quite buggy.

dhaimoud
Posts: 11
Posted 16:53 Mar 15, 2014 |
rabbott wrote:
dhaimoud wrote:

For information: the magic number bidding is described in I. Ayres, Super Crunchers, New York: Bantam Books, 2007. Its detection is the subject of the paper, A. Ingraham, "A Test for Collusion Between a Bidder and an Auctioneer in Sealed-Bid Auctions", Contributions to Economic Analysis and Policy, 2005.

If you have Mathematica you can play around with to see how it works.

Driss,  Do you know where Ayes talk about the Bidding Game in his Super Crunchers book? I can't find it.

 

dhaimoud
Posts: 11
Posted 16:59 Mar 15, 2014 |

This is the link to find about the magic number on Ingraham paper: http://papers.ssrn.com/sol3/papers.cfm?abstract_id=712881  click on link and download the paper.

Last edited by dhaimoud at 17:01 Mar 15, 2014.