How many different ways are there to checkmate in the early game? We all know the shortest possible checkmate is 4 ply:


f3 e5

g4 Qh5#



This isn't the only possible move order. In fact, there are 8, depending on whether white moves the f or g pawn first, whether he moves the f pawn to f3 or f4, and whether black plays e6 or e5. Of course, this makes up only a tiny fraction of the possible 4-ply sequences of moves, but these are the only ones that end the game.
What I'm looking for is, for small numbers of ply, how many sequences of moves end in checkmate vs not ending in checkmate. Ideally what I'd like is something along the lines of

4 ply: X non-checkmate sequences, 8 4-ply checkmates
5 ply: Y non-checkmate sequences, 8 4-ply checkmates, N 5-ply checkmates
6 ply: Z non-checkmate sequences, 8 4-ply checkmates, N 5-ply checkmates, M 6-ply checkmates

and so on for as deep as this is reasonable to do.
This is inspired by a Math.SE question about the probability of two players making random moves resulting in the same chess game. I suspect the short games heavily dominate this probability, which should make the probability easy to approximate, but it'd be nice to have the real numbers to work with.
There are no checkmates from 0-3 ply.

4 ply: 8 checkmates, 197,281 total nodes
5 ply: 347 checkmates, 4,865,609 total nodes
6 ply: 10,828 checkmates, 119,060,324 total nodes
7 ply: 435,767 checkmates, 3,195,901,860 total nodes
8 ply: 9,852,036 checkmates, 84,998,978,956 total nodes
9 ply: 400,191,963 checkmates, 2,439,530,234,167 total nodes


"checkmates" is the number of checkmating moves made on the final ply. So for 5 ply, there are 347 checkmating sequences of exactly length 5.

These values are from: https://www.chessprogramming.org/Perft_Results

Currently there is no checkmate data for 10 ply and above, presumably due to the computational resources needed.

To obtain more specific data (e.g. the lines themselves), you would need to write your own perft program which saves lines ending in checkmate.