d***i 发帖数: 3 | 1 Take a pack of playing cards and shuffle them. Then take a card at random among the first
few, call it x(0). Its value can be Ace, 2, 3, ..., 10, J, Q, K. Assign the value 1 to the
Ace and the values 11, 12, 13 to J, Q, and K respectively. Then the value of the card x(0)
is
f(x(0))={1,2,...,13}.
Next go through the stack as follows: if the value of the n-th card is w(n)=f(x(n)), skip
w(n)-1 cards and select x(n+1) to the next one. For instance, if the first card you selec |
|