What is the average number of legal moves per turn? For example in the first turn there are 20 possible legal moves (16 pawn moves and 4 knights moves). This number increases in the middlegame and then decreases in the Endgame.

Are there some calculations on the average? Google search seem to be focused only on "average number of moves per game". Would appreciate if somebody have some links to some scientific researches or also blog posts.
Whilst acknowledging the comment by @SmallChess that this is pointless, it is also relatively straightforward to do. I analysed 2,539,871 games from a ChessBase mega database counting the number of moves for the next player to move before each move was played. I did not include the number of moves available after the final move of the game had been played. The total number of moves played was 194,389,820 (76.5 per game) and the total number of available moves was 6,039,013,721 giving an average of about 31.1 per move.

Here is an analysis of the average number of moves available for each colour at each move point for the first 100 moves of each. Move 0 is prior to the first move of each colour. It is interesting to observe that, on average, black has fewer options than white. I am not sure why this would be-hopefully, it isn't an error in the analysis (!) but I don't think it is.