Skip to main content
changed answer because I had an error in my scripts
Source Link

Update: fixed a mistake in my code where I didn't properly account for whether the trajectory of the bullets colliding was after the bullets were fired.

I took a shot at this problem by coding up a simulation in R. I followed the first part of @Dmitry Kamenetsky's solution but took @justhalf's comment about how colliding works into account.

We can determine when they will collide by estimating what time (if any) satisfies the following:

0.29 * (time - 4) = 0.93 * (time - 6)

time = (0.93 x 6- 0.29 x 4)/(0.93- 0.29)

2. Estimate, for all combinations of bullets, when they would collide (or not collide), ignoring all other bullets. Make sure collisions happen after both bullets are fired. (See table below for an example)

Using this process, I performed 1005,000,000 simulations. The proportion of times when there were no bullets or all the bullets disappeared was:

0.211621602378

This is very close to @Feryll's answer, which I believe is correct. Splitting the simulations into 5 sets of 1,000,000, the standard deviation is

0.0007777925

@Feryll's solution is within my result plus or minus the standard deviation.

I took a shot at this problem by coding up a simulation in R. I followed the first part of @Dmitry Kamenetsky's solution but took @justhalf's comment about how colliding works into account.

We can determine when they will collide by estimating what time (if any) satisfies the following:

0.29 * (time - 4) = 0.93 * (time - 6)

2. Estimate, for all combinations of bullets, when they would collide (or not collide), ignoring all other bullets. (See table below for an example)

Using this process, I performed 100,000 simulations. The proportion of times when there were no bullets or all the bullets disappeared was:

0.21162

Update: fixed a mistake in my code where I didn't properly account for whether the trajectory of the bullets colliding was after the bullets were fired.

I took a shot at this problem by coding up a simulation in R. I followed the first part of @Dmitry Kamenetsky's solution but took @justhalf's comment about how colliding works into account.

We can determine when they will collide by:

time = (0.93 x 6- 0.29 x 4)/(0.93- 0.29)

2. Estimate, for all combinations of bullets, when they would collide (or not collide), ignoring all other bullets. Make sure collisions happen after both bullets are fired. (See table below for an example)

Using this process, I performed 5,000,000 simulations. The proportion of times when there were no bullets or all the bullets disappeared was:

0.1602378

This is very close to @Feryll's answer, which I believe is correct. Splitting the simulations into 5 sets of 1,000,000, the standard deviation is

0.0007777925

@Feryll's solution is within my result plus or minus the standard deviation.

Source Link

I took a shot at this problem by coding up a simulation in R. I followed the first part of @Dmitry Kamenetsky's solution but took @justhalf's comment about how colliding works into account.

I'll start with an example of how we can determine when two bullets will collide. Below is an example of two bullets, one fired at 4 seconds with a speed of ~0.29 and the other fired at 6 seconds with a speed of ~0.93. They collide at ~6.9 seconds.

(Horizontal red line is the x-axis. Vertical red line is where the lines intersect) Two example bullets

We can determine when they will collide by estimating what time (if any) satisfies the following:

0.29 * (time - 4) = 0.93 * (time - 6)

Using this process, we can determine when and if each bullet collide and determine the order in which they collide. Here is my simulation process:

1. Simulate the bullets fired by drawing from a Bernoulli distribution with 10 trials and probability of 0.6. Assign a speed to each bullet (uniform distribution from 0 to 1). If there are an odd number of bullets, then stop (because then there will always be at least one bullet remaining).

2. Estimate, for all combinations of bullets, when they would collide (or not collide), ignoring all other bullets. (See table below for an example)

3. Determine which two bullets are the first to collide. Then, ignoring bullets we know already collided, determine which two bullets collide next.

4. Repeat step 3 until all the bullets have collided or no more bullets collide.

Here is an example of the collision table, which records when each bullet would collide: (The bottom diagonal is blank because it would just mirror the top diagonal)

Bullet 1 Bullet 2 Bullet 3 Bullet 4
Bullet 1 3.615827 10.787499
Bullet 2
Bullet 3 8.563391
Bullet 4

The first two to collide are bullets 1 and 2. Ignoring bullets 1 and 2 because they have already collided, the next to collide are bullets 3 and 4. As it turns out, bullets 1 and 3 would never collide (even without bullet 2), but bullets 1 and 4 could collide (without bullets 2 and 3).

Using this process, I performed 100,000 simulations. The proportion of times when there were no bullets or all the bullets disappeared was:

0.21162