Understanding solution to finding optimal strategy for game involving picking pots of gold

前端 未结 5 2068
深忆病人
深忆病人 2021-02-13 23:50

I am having trouble understanding the reasoning behind the solution to this question on CareerCup.

Pots of gold game: Two players A & B. There are pot

5条回答
  •  没有蜡笔的小新
    2021-02-14 00:30

    Let me answer your points in reverse order, somehow it seems to make more sense that way.

    3 - a and b represent the amount of coins the first player will get, when he/she chooses the first or the last pot respectively

    2 - we take the minimum because it is the choice of the second player - he/she will act to minimise the amount of coins the first player will get

    1 - the first line presents the scenario - if the first player has taken the first pot, what will the second player do? If he/she again takes the first pot, it will leave (start+2, end). If he/she takes the last pot, it will leave (start+1, end-1)

提交回复
热议问题