Smothering Ninja Bed Bugs is important to stop itchy nocturnal sleeps on you King Size bed.


Here is an infestation of your king size bed. It looks nasty. Your job is to smother all those Ninja Bed Bugs by covering them with rectangles. The Ninja Bed Bug Score equals the area of all rectangles used plus the square of the number of rectangles…


Here we use rectangles of total area = 5×11 + 6×2 + 3×8 + 7×3 + 8×3 = 136

We are using 5 rectangles. The square of 5 = 5×5 = 25.

The Ninja Bed Bug score is 136 + 25 = 161

Go back to the previous slide and try to get a lower score for the Ninja Bed Bugs.


Here the total area of the rectangles is: 14+21+12+30+16+20 = 93

There are 6 rectangles used. 6^2 = 36

Score = 93 + 36 = 129

That’s as good as I could do.


You may choose to try some of the following puzzles in front of the whole class. I don’t know the best scores.


Random attacks are just as interesting as these periodic attacks.


Students should also design their own puzzles. After making one they should try to get a low score for the Ninja Bed Bugs – and then hand them off to their friends or enemies.


Here is one of the attached puzzle-sheets. See what group can find the best score for each puzzle.

This king size bed is 14×14. If you just cover the whole bed the Ninja Bed Bug score would be 14×14 (area of the big rectangle) plus 1×1 (because only one rectangle was used.) So the highest possible score for the Ninja Bed Bugs on any of these puzzles is 196 + 1 = 197.

What are the fewest number of Ninja Bed Bugs that could attack in a pattern to give this horrendous score? I don’t know yet, but I’ll work on it 😉

Next is the first version of the puzzle. It is different from Ninja Bed Bugs so you might want to continue…


Life was not always as sartorially elegant. When my great great grandmother made clothes and quilts they ended up being ragged affairs because they needed to last years.


Take any 2D pattern. Here we will use the prime numbers.


Now of course we could just cover it up with one big rectangle (a 10×10 square)…


… but this would be wasteful of fabric.

You could also cover up each prime number with its own little 1×1 square. However, that would be a waste of your valuable time.



Your wastefulness score (which you should try to minimize) equals the total area covered by your rectangles plus the square of the number of rectangles used.

Here we used five rectangles of area 16, 4, 28, 30 and 1. The total area covered is: 79. The square of the number of rectangles is 5^2 = 25.

Your score is 79 + 25 = 104. Not bad, but you can get it less than 100. Try before seeing the next slide.



Your wastefulness score (which you should try to minimize) equals the total area covered by your rectangles plus the square of the number of rectangles used.

Here we used five rectangles of area 20, 20, 10, 21 and 1. The total area covered is: 72. The square of the number of rectangles is 5^2 = 25.

Your score is 79 + 25 = 97. That’s my best score.




Here is the same challenge for powers of two. Don’t go to the next slide till you’ve tried.

You can do better than this.

The score here is also 25. You can do better.

A score of 23 is as good as I could get.

The Fibonacci numbers under 100…


The lowest score I found to cover the Fibonacci numbers under 100 was 31.


We can do this challenge with any 2D pattern. Your pattern might just be random stars on a 2D map of the heavens – or sea creatures in a 2D map of the ocean. Our challenge is to cover them up with rectangles…

The 1×1 rectangle is shown in the upper left. It doesn’t count towards our total, but it is important for figuring out the area of our other rectangles.


I prefer the covering rectangles be constrained to an orthogonal grid. Not like this.


I like insisting that the rectangles be laid on an orthogonal grid.

Here is a related puzzle. Cover the first nine prime numbers. Here the rectangles must be squares and the score (to be minimized) is:

Area of the squares plus cube of the number of squares. Here we have 36+ 9 + 49 + 3^3 = 121. You can do better.

Here we have 36+ 9 + 9 + 1 + 4^3 = 64. That’s as good as I have done.

Beat this for the primes up to 53.

441 is better, but you can do better still…

417 is as good as I could get.

Beat this for the primes up to 59.

This is a good as I could get.

These are my records for the first eighteen puzzles.

Ninja Bed Bugs (MathPickle, 2016)

This puzzle gives students practice with multiplication and (for older children) exponents.

Download a pdf of the presentation and puzzle-sheets here.

Standards for Mathematical Practice

MathPickle puzzle and game designs engage a wide spectrum of student abilities while targeting the following Standards for Mathematical Practice:

MP1 Toughen up!

Students develop grit and resiliency in the face of nasty, thorny problems. It is the most sought after skill for our students.

MP2 Think abstractly!

Students take problems and reformat them mathematically. This is helpful because mathematics lets them use powerful operations like addition.

MP3 Work together!

Students discuss their strategies to collaboratively solve a problem and identify missteps in a failed solution. MathPickle recommends pairing up students for all its puzzles.

MP4 Model reality!

Students create a model that mimics the real world. Discoveries made by manipulating the model often hint at something in the real world.

MP5 Know the tools.

Students master the tools at their fingertips - whether it's a pencil or an online app. 

MP6 Be precise!

Students learn to communicate using precise terminology. MathPickle encourages students not only to use the precise terms of others, but to invent and rigorously define their own terms.

MP7 Be observant!

Students learn to identify patterns. This is one of the things that the human brain does very well. We sometimes even identify patterns that don't really exist 😉

MP8 Be lazy!?!

Students learn to seek for shortcuts. Why would you want to add the numbers one through a hundred if you can find an easier way to do it?


Please use MathPickle in your classrooms. If you have improvements to make, please contact me. I'll give you credit and kudos 😉

Gordon Hamilton

(MMath, PhD)