Skip to content
DeepForgeby svx
All problems

CFR Average Strategy

Problem

Normalize accumulated strategy sums into the average strategy.

If the total is not positive return the uniform distribution, and an empty list returns [].

Hint

The average strategy is the object that converges in CFR, not the current strategy.

Test cases

case 1
in: [[2,1,1]]
expected: [0.5,0.25,0.25]
case 2
in: [[0,0]]
expected: [0.5,0.5]
case 3
in: [[]]
expected: []
case 4
in: [[1,3]]
expected: [0.25,0.75]
Starter codePython
def cfr_average_strategy(strategy_sum):
    # Your code here
    pass

4 test cases · run your code against them in the editor