Suppose you are playing Balegrounds. Currently, you have n demons on the board, and there are m. minions in the tavern. You alsohave the effect of Famished Felbat equipped. You have no coins left, so you must end the turn. You wonder what the expectedstrength of your warband is after you end the turn
For the purposes of this problem, we make a few simplifications and specifications as follows:
We assume that each minion is associated with a sindle positive intecer, denoting its stat, When a minion with stat 2: consumesanother minion with stat y, its stat becomes 2 - y, and the consumed minion disappears.
When you have the efect of Famished Felbat equipped, at the end of your tur, the following happens: Each of your minionsorderina from left to right, seauentially chooses a remaining minion in the tavern uniformly at random and consumes it.
The strength f(x) of a minion with stat 2 is defined as follows: f(x)Δ=1/L* sum(k=1~L)[x/k] ,where L is some given parameter. (Thisformula sets strength of a minion with stat as the expected number of hits a minion with health a can take, assuming the attackof the opponent's minion is uniformly chosen from [1, L], in the language of real Battleground games,) The strength of yourwarband is the sum of the strengths over all your minions.
Formally, you have n minions with stats a1, 2, ... , an from left to right, respectively. There are m (n < m) minions in the taverrwith stats b1, b2, ... , bm, respectively. You are also given the parameter L. At the end of your tum, the following process happens?
1. Let S be a set initially set as S = (1, 2, ... , m , denoting the indices of remaining minions in the tavern.
2. For i - 1, 2, ..., n, the following happens:
An index 2 is chosen from S uniformly at random, then set a <-- ai + bx and S <-- S/{x}.
3. The strength of your warband is calculated as ∑i=1~n f(ai), where f(x) is already defined in the statement above.
You need to calculate the expected strength of your warband after the process above.