Caffeine, the drug that gives coffee its kick, works differently, depending on the consumer's weight, gender, hormonal shifts and a variety of other factors.
P Rajendran reports from New York.
Research by a team that included Dr Sridhar Ramakrishnan have put together a detailed mathematical model for just that.
Dr Ramakrishnan, a research scientist at the Henry M Jackson Foundation for the Advancement of Military Medicine in Maryland, USA, and the other members of the team were not primarily addressing the needs of the average sleep-deprived desk jockey; the focus was on US military personnel whose work calls for alertness even in the face of deep fatigue.
The first author on the first paper on the algorithm is Dr Francisco Vital-Lopez, a researcher at the US Army Medical Research and Materiel Command, in Fort Derrick, Maryland.
Caffeine, the drug that gives coffee its kick, works differently, depending on the consumer's weight, gender, hormonal shifts and a variety of other factors.
So the team relied on relying on just how performance was affected by consuming caffeine, via coffee.
Speaking for the team was Dr Jacques Reifman, a senior research scientist at the US Army Medical Research and Materiel Command.
According to Dr Reifman, "About 40 percent of US service members sleep less than five hours per night on a regular basis, while the required sleep to fully restore one's mental acuity is between seven and eight hours per night."
"Nevertheless, many military tasks requires considerable vigilance, even when our Warfighters (military personnel) are sleep-deprived," he added.
Dr Reifman pointed out that caffeine is widely used by military personnel and the general public, with about 85 percent of adults in the US consuming the equivalent of two cups of coffee a day.
The average cup packs about 95 mg of caffeine.
Caffeine works by plugging itself to a protein that usually binds to adenosine, a hormone released as our cells use up energy.
But for coffee, on average, the more the adenosine binding to its receptors, particularly one called A1, the more tired you are.
When we sleep, adenosine production slows down, giving the body an opportunity to to break down the adenosine that has accumulated during the waking hours (using the enzyme adenosine deaminase).
For those who recall those early biology classes, one of the four amino acids in our DNA is adenine.
And the sugar that forms the backbone of our RNA is ribose.
The two bind together to form adenosine.
In caffeine-free conditions, our cells break down adenosine that is attached to a daisy chain of three units of phosphate (PO4), essentially lopping off one phosphate at a time to release stored energy.
According to Dr Reifman, "We sought to develop a mathematical algorithm that could safely identify when and how much caffeine an individual should consume, so as to optimize mental acuity at the desired times of the day for the desired duration, in spite of being sleep deprived."
"That is, the algorithm allows us to take full advantage of the restorative effects of caffeine," he added.
"Hence, our work directly impacts soldier readiness, a key priority for the US army."
The team used a computerised test to measure vigilance by seeing how long it took people with different amounts of sleep deprivation to react to a visual stimulus.
The test is called a psychomotor visual task (PVT).
The tests were conducted on soldiers who were short on sleep for between five hours to 85 hours.
Their model seemed to by very accurate but for those who were badly sleep-deprived.
But even in those cases, the coffee worked as well as in those less sleep deprived but the effects did not last as long.
The team is doing more research on the subject now.
Dr Reifman said PVT was done using computers and smartphones.
Yes, there is an app for that: 2B-Alert.
But Dr Reifman called for a modicum of caution in interpreting the results:
"While there is a large body of knowledge that supports the notion that caffeine improves reaction time, such a preponderance of evidence does not exist for other mental skills. Hence, it is not clear the extent to which caffeine benefits other mental acuity properties."
The biggest dose the team used in most of the conditions is 200 mg, half the limit for the average person, though in one case that was upped to 600 mg.
Was there an optimum dose for the average sleep-deprived office worker?
"There is no "one-size-fit-all" solution," Dr Reifman warned.
Different individuals can drastically differ in their response to sleep deprivation.
About 25 percent of subjects are resilient (their response time is the same whether they are sleep deprived or well rested), about 30 percent are very vulnerable, and the remaining fall in between.
It is well established that there is large between-subject variability in response to sleep deprivation.
Similarly, individuals can differ drastically in their sensitive to caffeine."
That was why the team developed the 2B-Alert app that uses artificial intelligence to gauge how individuals respond to sleep deprivation and caffeine.
Search the Web for 2B-Alert Web, and you can find it.
'I helped develop and validate the underlying biomathematical model that predicts the effects of sleep deprivation and caffeine on human alertness,' Dr Ramakrishnan was quoted as saying.
According to Dr Reifman, "His work was key because it forms the bases used by Dr Vital-Lopez in his caffeine optimization algorithm."
The research appeared in the May issue of the Journal of Sleep Research.
Why you should have different coffees at different times of the day
Not getting enough sleep? Try this herb
9 reasons for not getting a good night's sleep
Are you terrified of falling asleep?
What type of coffee drinker are you?