How come the branching factor of chess is 35? I was studying about minmax algorithms and it said the branching factor of a chess game is around average 35. Meaning a player can move about 35 legal moves per position.

I am not able to comprehend this.Like if I do the opening in chess I was able to count 20 possible legal moves.(1 or 2 possible moves for 8 pawns that gives us 16.
2 possible for 2 knights respectively giving a total of 20)

So how it was calculated?
Since the moves differ per turn it was calculated as the average. Yes you are right, there are exactly 20 moves in the first turn, but after advancing with knights, bishops, rooks and queen into the center of the board the number of legal moves is increasing and since it is average of the minimax tree also the situation after encrouning with several queens on the both sides is calculated (not very wise game, but still perfectly valid to have more than 100 available moves in one turn.

Please check for some more legal chess positions.