How are dungeons in minecraft generated?

When a chunk is populated, the dungeon generation is always tried 8 times independently at random positions in the chunk. For each generation, given a random size (5x5, 5x7, or 7x7, excluding walls), a dungeon is generated only if the ceiling and floor blocks are solid and there are 1~5 air blocks in the lower half of the surrounding walls.

Possibility? That's complicated to calculate because the probability distribution of air blocks is more complicated and that depends on this. However, you can certainly qualitatively assert that double dungeon is rare. I assert the existence of triple dungeon.