Use the DMG rules for handling mobs
The DMG (page 250) presents some rules for the situation depicted. It consists in computing the target number on the d20 for a successful hit, and then check the table below to see how many creatures hit.
d20 Roll Needed |
Attackers Needed for 1 hit |
1-5 |
1 |
6-12 |
2 |
13-14 |
3 |
15-16 |
4 |
17-18 |
5 |
19 |
10 |
20 |
20 |
In the depicted situation, 10 Tiny Animated objects have an attack bonus of +8: suppose that the target's AC is 17, hence the roll needed on the d20 is 9 and the attackers needed for having one successful hit is 2. This means that in the group of Animated Objects there are 10/2=5 that hit the target.
This table comes from the geometric distribution, and follows the original probability distribution. If you need a 14 on the d20 roll for hit, then the probability of success is 7/20, then the number of trials that you have to wait before the 1st success is 20/7 \$\sim\$ 2.8571, rounded up to 3. This means that the first hit (may) happen after 3 attacks, the second hit after 6 and so on: the grand total is hence 6 (or 7, depending on approximation) hits among 20 attacks.
Another way to see it is looking at the binomial distribution, which counts the number of success on independent trials, when the probability of success is the same. The figure below shows the simulation of 100 000 scenarios of 20 attackers, against an AC of 22 and with an attack Bonus of +8. Plotted against this simulation, the solid line represents the binomial distribution, and the legend reports the expected value using such distribution. The green line refers to the number of successful hits given by the method presented in the DMG.
The table reported in the DMG is a rough approximation: a more accurate one should be the table below.
| d20 Roll Needed | Attackers Needed for 1 hit
|:----: |:------:|
|1-6 |1|
|7-11| 2|
|12-14| 3|
| 15 | 4|
| 16 | 5|
| 17| 7|
| 18| 10|
| 19-20| 20|
But the player wants to roll a d20!
The above method does not require any d20 roll1 and does not take into crits::
This attack resolution system ignores critical hits in
favor of reducing the number of die rolls.
whilst provides some techniques for dealing with monsters that deal different damage or have multiple attacks.
You may make the player still roll a d20: if the result is above the target, then add 1 successful hit, if the roll is below remove one. If the roll is 20, add a further critical hit, in addition to the further hit added. If the roll is 1, you have a critical failure, among removing one successful hit from the total.
In this case, the probability distribution is still close to the original one (recall that the above table refers to averages) and let players roll a d20, if they want to.
1 For some players and/or DM, this means to take out some fun: I am one of those people.