Would you like to do a simple but slightly dangerous physics demo? It will be fun. You just need a basketball and a tennis ball (or any two bouncy balls of different mass). Hold the basketball above the ground with the tennis ball on top of that. Let go of both at the same time. Here’s what should happen.

Isn’t that awesome? You can get that tennis ball flying off with some pretty serious velocity. Why is this dangerous? Well, if you don’t drop them such that they are absolutely vertical, the tennis ball can launch off at an angle. It’s possible that that angle gives the tennis ball a trajectory right towards your face. It’s happened to me more than once.

OK, but what is going on here? It might seem like this is a physics cheat to have the tennis ball bounce so much higher than it started (and that’s probably why it’s so cool to see it). But in terms of energy, it’s all legitimate. Both the basketball and the tennis ball are moving at the same speed right before they hit the ground. This means they both have some amount of kinetic energy, but the basketball has more due to its larger mass. After the collision, the basketball has a very low speed and thus very little kinetic energy. That means the tennis ball gets a bunch of kinetic energy—and with a low mass, you get a high velocity.

But how do you make the basketball stop after the collision? Let’s answer this question by looking at a slightly simpler problem. Suppose I have two balls of different mass moving towards each other with the same speed. Like this.

With different mass balls, the final speeds of the two balls will also be different. How do you find the speeds of the balls after the collision? One way is to consider both the total momentum (product of mass and velocity) and total kinetic energy (one half of mass and velocity squared). For a very bouncy collision, both momentum and kinetic energy should be conserved. It’s very straightforward to mathematically solve for the ratio of masses such that one of the balls stops.

But there is another way to approach this problem—a way that is more interesting (at least to me). What if we instead make a numerical calculation for two colliding balls? In a numerical calculation, the motion can be broken into many small steps in time. During each small time step, the forces can be considered to be approximately constant to make very many simple physics problems.

In this case, there will only be a force pushing the balls apart when they collide (overlap). I can model this collision force as though it were a spring pushing them apart. This is essentially what happens anyway. OK, let’s just jump to the numerical model. You can press “play” to run the code and the “pencil” to view or edit it.

If you want to play with the code (and you should), you can change the ratio of the masses and run it again. Just to be clear—you need to change the mass ratio so that after the collision the heavy mass is stopped.

Since I am already doing this collision with a computer, I can do it a whole bunch of times and create a plot of final velocity as a function of the ratio of masses. Here is the code (it’s sloppy) and there is the plot.

Here we get the answer. If the mass ratio is 3 to 1, the heavy mass stops. In that case all of the kinetic energy ends up with the lower-mass ball. However, notice that the 3 to 1 ratio doesn’t produce the greatest final speed—the final speed of that approaches a maximum value as the mass ratio goes to zero. But the goal was to make the heavier mass stop—it’s more fun that way.

### More Balls

Dropping a tennis ball on top of a basketball might make everyone think you are cool (the ultimate goal in physics). But about dropping more than 2 balls? Here is a toy you can buy that has FOUR balls of different masses. Watch what happens when I drop it (in slow motion).

Of course the goal in physics is to build models. So, let’s build a model of multiple dropped balls. Instead of 4 balls, I will just do 3 and let you add more balls if you like. I will still use my same ball collision model (where there is a spring force between them), but this time I am going to have the balls fall and hit a ground just like the actual balls.

Here is the basic idea of how this calculation works.

- Make three balls (that part is obvious).
- Calculate the gravitational force on each ball (so they will fall).
- Check to see if any balls overlap. If so, then calculate the “spring” force between them based on the amount of overlap.
- Check the bottom ball to see if it “hits” the floor. If so, just reverse its momentum.
- Repeat forever or until you get bored.

Now for the code. Press “run” to play. If you want to answer the homework questions below, you will need to modify the code. At the very least, you should try changing the masses of the balls (I just pick random starting values).

That looks pretty good. Now for some homework. This is gonna be great.

### Homework

- Check to see if momentum is conserved in the first horizontal collision program. Momentum isn’t conserved in the three-ball-drop case since I didn’t include the momentum of the Earth.
- Is kinetic energy conserved in the horizontal collision? If it’s not, then there is a problem—a big problem.
- What about for the three ball drop? Is total energy conserved?
- How high does the top ball go?
- What happens if you change the collision spring constant?
- Most important question: can you find a ratio of masses that gives the small ball the highest bounce?
- Modify the code so that there are four bouncing balls.
- Based on energy calculations alone, suppose you drop three balls such that the bottom two stay at rest. How high above the ground would you have to drop this so that the top ball makes it into outer space? What about the drop height to get the ball into orbit? Assume no air resistance.

### More Great WIRED Stories

- Everyone wants to go to the moon—logic be damned
- College Humor gives comedy subscription a serious effort
- Tips to get the most out of Screen Time controls on iOS 12
- Tech disrupted everything. Who’s shaping the future?
- An oral history of Apple’s Infinite Loop
- Looking for more? Sign up for our daily newsletter and never miss our latest and greatest stories