Estimating Projectile Hit Probability Inside an Ellipse with Monte Carlo and Numerical Integration
This article demonstrates how to compute the probability that a projectile, whose impact points follow a bivariate normal distribution with 100 m standard deviations, lands inside a given elliptical target by comparing analytical numerical integration with a Monte Carlo simulation implemented in Python.
Problem
The target of the artillery fire is the region enclosed by an ellipse centered at the origin. When aiming at the center, random deviations cause the impact point to differ from the center. Assume the impact points are distributed around the target center as a two‑dimensional normal distribution with standard deviations of 100 m in both x and y directions, independent of each other. Use Monte Carlo simulation to compute the probability that the projectile lands inside the ellipse and compare it with the probability obtained by numerical integration.
Solution
Let (X, Y) denote the random impact point. Its joint probability density function is
The probability that the projectile lands inside the ellipse \(x^2/120^2 + y^2/80^2 \le 1\) is
Using Python’s numerical integration (scipy.integrate.dblquad) we obtain the value (approximately 0.376).
We can also estimate the probability with Monte Carlo. Simulating N = 1,000,000 shots, counting the number that satisfy the ellipse condition, and dividing by N gives an approximate probability around 0.3754.
Code
<code>import numpy as np
from scipy.integrate import dblquad
fxy=lambda x,y: 1/(20000*np.pi)*np.exp(-(x**2+y**2)/20000)
bdy=lambda x: 80*np.sqrt(1-x**2/120**2)
p1=dblquad(fxy,-120,120,lambda x:-bdy(x),bdy)
print("Probability (numerical integration):", p1)
N=1000000; mu=[0,0]; cov=10000*np.identity(2);
a=np.random.multivariate_normal(mu,cov,size=N)
n=((a[:,0]**2/120**2 + a[:,1]**2/80**2) <= 1).sum()
p2=n/N; print('Probability (Monte Carlo):', p2)
</code>Source: S. Shougui, S. Xijing. Python Mathematics Experiments and Modeling (2020). Science Press.
Model Perspective
Insights, knowledge, and enjoyment from a mathematical modeling researcher and educator. Hosted by Haihua Wang, a modeling instructor and author of "Clever Use of Chat for Mathematical Modeling", "Modeling: The Mathematics of Thinking", "Mathematical Modeling Practice: A Hands‑On Guide to Competitions", and co‑author of "Mathematical Modeling: Teaching Design and Cases".
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.