sleeping baby

How Basic Math Can Lead to the Perfect Night’s Sleep

If you’re reading this and feeling a little tired, chances are it’s because you didn’t get enough sleep last night. It’s a problem that we all face throughout our daily lives, and a problem that can dramatically affect our ability to function properly at work, which It’s probably why so many of us reach for that morning coffee.

Photo by wu yi on Unsplash

Well, researchers at the University of Manchester (in association with The Fine Bedding Company), have come up with a mathematical equation to help us determine how well we’ve slept and what factors we need to change for improved rest. Let’s take a look  and see how it works.

Sleep Quality = [(T x Bt) + C] / [Ha + S + L + (H x D)]

Okay, this equation may look daunting at first, but with some basic math knowledge and an understanding of the order of operations, we can break it down into smaller chunks. If you need a hand remembering  the order of operations, think of PEMDAS. This is an acronym that mathematicians use when tackling algebra. It stands for the following:







You may also use the mnemonic phrase “Please Excuse My Dear Aunt Sally”.


Now that we know to tackle the problems in parentheses first, the formula doesn’t look so daunting, but what do the letters within the equation mean?

T = Tiredness

This is the amount of hours since your last sleep, minus any naps you’ve taken, plus any hours you worked/exercised in the day.

Bt = Bedtime

This is your bedtime divided by your overall average bedtime

C = Comfort

The comfort focuses on the pillow, bedding, and mattress. Each one is rated from 1-5, with 5 being very comfortable. Add these totals together and then subtract nine.

Ha = Hours Awake During the Day

This is the total amount of time you were awake for before you fell asleep.

S – Sound (0-5)

This is the total noise within the room during your sleep, with 0 being soft soothing noises and 5 being loud disturbances (trains, airplanes, cars).

L = Light (0-2)

This is the light within the room. Think LED lights on electronics and lights shining through windows. On this scale, 0.1 would be little light and 2 would be very bright lights.

H = Heat (celsius)

Temperature of the room, which is calculated by the number of degrees difference from 16 degrees Celsius. Take that number and divide it by ten.

D = Duvet (0-3)

Measured in relation to its effectiveness with the room temperature. In this scale, 0 means it compensates perfectly for the overall room temp. The other end of the scale (3) means that it does not compensate well and can leave you either too cold or too hot.

Now that we’ve cleared that up, lets take a look at my last night’s sleep and assess how well I slept. Firstly, let’s tackle the sections in the parentheses on the left hand side.

[(T x Bt) + C]

I was awake for 15 hours before I slept, I took 0 naps, and I worked for 7 hours.
T = 15 – 0 +7
T = 22

Bedtime was at 11pm and I usually go to bed at 10pm, so let’s divide 11 by 10.
Bt = 11 / 10
Bt = 1.1

For the last part of the left hand side, we need to work out the comfort score. My pillow, bedding, and mattress are all pretty good. I will rate them all as being  4 on the 0-5 scale. Remember, you need to minus 9 from the total.

C =  4 + 4 + 4 – 9
C = 3

Ok, so now we know that the left hand side of the equation is as follows:

(T x Bt) + C

(22 x 1.1) + 3

24.2 + 3


Now, we move to the right hand side, starting with the problem in the parentheses.

Ha + S + L + (H x D)

The room temp was around 16 degrees, so we just divide that by 10

H = 16 / 10
H =  1.6

My duvet is pretty comfortable and never leaves me too hot or cold. I will rate this as 0 (which is the highest score in this instance)

D = 0

Lets move out of the parentheses and onto the additions. I was awake from 7am to 11pm, meaning that I was awake for 16 hours.

Ha = 16

The room was pretty quiet, so I would give it a sound rating of 1.

S = 1

There was very little light in the room with the exception of red standby lights on my electronics. Lets give this a score of 0.5

L = 0.5

We can now complete this side of the formula.

Ha + S + L + (H x D)

16 + 1 + 0.5 + (1.6 x 0 )

16 + 1 + 0.5 + 0


Which means we can now solve the entire equation!

Sleep Quality = [(T x Bt) + C] / [Ha + S + L + (H x D)]

Sleep Quality = [(22 x 1.1) + 3] / [16 + 1 + 0.5 +(1.6 x 0)]

Sleep Quality = [24.2 + 3] / [16 + 1 + 0.5 +0]

Sleep Quality = 27.2 / 17.5

Sleep Quality = 1.5542857142… (1.55 when rounded to the nearest hundredth)

So what does this all mean? Well, the quality of sleep is rated from 0 – 2, with 0 being restless tossing and turning, and 2 being a great night’s rest. As you can see above, I scored 1.55, which means my sleep was slightly above average in terms of overall quality.


I can now use this formula to work out what needs to change in order to improve my night’s rest. It’s worth noting however, that you shouldn’t take this formula as fact. Here’s what Dr. Penny Lewis, researcher at the University of Manchester, had to say about their formula:

‘It is always fun to try and boil down a very complicated process into something really simple, and that is what we have attempted with this equation.

‘We wanted to keep things easy, but sleep is complex and there are lots of factors that we haven’t included, for instance the psychology of how you feel about the room you sleep in.

‘Also, the extent to which the things we have put in influence sleep varies hugely from person to person, so this equation really should be viewed as a guide that may make people think about some simple ways they might be able to improve their sleep.’

Try it out for yourself and see how good your last night’s sleep was. If you need help tackling equations or the order of operations, remember PEMDAS, and for help with anything else relating to math, visit

Like the article? Share it with a friend.