Skip to content
DeepForgeby svx
All problems

Root Dirichlet Concentration

Problem

Compute the Dirichlet concentration AlphaZero uses for root exploration noise.

The standard choice is alpha = 10 / n_legal_moves, so the noise stays proportional to the number of available moves. A non-positive move count returns 0.0.

Hint

Small concentrations concentrate the noise on a few moves; large ones spread it.

Test cases

case 1
in: [10]
expected: 1
case 2
in: [1]
expected: 10
case 3
in: [0]
expected: 0
case 4
in: [4]
expected: 2.5
Starter codePython
def root_dirichlet_concentration(n_legal_moves):
    # Your code here
    pass

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