Accenture had a nice challenge at the DSE fair at DTU 2017.
Playing cards are used as reels for the slot machine. Each slot machine reel can take 14 values (Accenture logo + the 13 normal cards). The Accenture logo maps to 1, while the ace maps to 14.
The next four random values (cards) are chosen as shown below.
Here r = [r_1, r_2, r_3, r_4]
is the reel vector where r_1
is the left most reel. z_0
is just a random vector.
The *
is an element-by-element multiplication and %
is the modulo operator. The vector u
is generated by grouping the lower 16 bit of the number provided by the user (input field below the reels), into groups of 4 bits.
Let's assume the user has provided the number 12886
, which in hex decimal is 0x3256
; hence, the vector u
is in the case given by u = [3, 2, 5, 6]^T
.
Let assume z_{n-1}
is [5, 3, 8, 2]^T
, then z_n
is defined as:
Resulting in the following reel:
The script will create a random z
(seed) and try to guess an input (u
) that will produce the desired output (all cards 1
).
Spin 1 (u = [0, 0, 0, 0]). Cards: [10|11|14|7]
Spin 2 (u = [9, 0, 13, 8]). Cards: [13|8|12|14]
Spin 3 (u = [2, 1, 4, 5]). Cards: [12|9|3|1]
Spin 4 (u = [13, 4, 4, 2]). Cards: [11|9|2|2]
Spin 5 (u = [5, 1, 7, 8]). Cards: [9|1|14|8]
Spin 6 (u = [9, 11, 10, 10]). Cards: [7|5|1|1]
Spin 7 (u = [8, 2, 1, 13]). Cards: [1|1|1|1]
Spin 8 (u = [11, 9, 3, 1]). Cards: [1|1|1|1]
Spin 9 (u = [0, 1, 6, 1]). Cards: [1|1|1|1]
Spin 10 (u = [9, 6, 5, 5]). Cards: [1|1|1|1]