He'd gone to his bank to withdraw cash but arrived a minute after closing time one day in the mid-1960s, leaving him with no funds for the weekend.
"Wouldn't it be a good idea if there was some way of obtaining money outside regular working hours?" he mused.
Vending machines, which allowed him to buy chocolate at any time of day or night, sprang to his mind.
Thus, Shepherd-Barron who worked for a printing company, devised a system for automatically dispensing cash.
Later that year, he bumped into the Chief General Manager of Barclays Bank who was about to have lunch. Over a pink gin, Shepherd-Barron asked him for 90 seconds to pitch his idea for a cash machine.
"I told him I had an idea that if you put your standard Barclays cheque through a slot in the side of the bank, it will deliver standard amounts of money around the clock".
"He said, 'Come and see me on Monday morning'."
Barclays commissioned Shepherd-Barron to build six cash dispensers, the first of which was installed at a branch in the north London suburb of Enfield on June 27 , 1967.
Shepherd -Barron was born in Shillong, India in 1925 and later served in the Indian Army in Second Airborne division where he taught Gurkhas to parachute.
He also invented the PIN by recalling his Indian Army number, he had originally intended to make personal identification numbers (PINs) six digit long, but reduced the number to four when his wife, Caroline, complained that six was too many.
"Over the kitchen table, she said she could only remember four figures, so because of her, four figures became the world standard," he recalled.
And this was possible due to the work of Srinivasa Ramanujan, mathematical genius of India.
Unconventional Genius, mathematician Srinivasa Ramunujam had no formal training in mathematics and would not get further education in Madras university and his English boss at Madras Port trust encouraged him to write to Prof Hardy of Trinity College Cambridge. He wrote a big letter with his equations which held Hardy's interest and he secured him an admission without necessary prerequisites or hard Tripos Exam. He would have not made it to Cambridge and world fame if rules were not broken for him and at Trinity college he came up with partition theory.
When you put your debit or credit card in the machine and order the machine to dispense the amount you desire - the machine divides and arranges your money before dispensing it, using Ramanujan's partition theory, which is as:
In number theory, a partition of a positive integer n, also called an integer partition, is a way of writing n as a sum of positive integers. Two sums that differ only in the order of their summands are considered the same partition. For example, 4 can be partitioned in five distinct ways:
4
3 + 1
2 + 2
2 + 1 + 1
1 + 1 + 1 + 1
The ATM machine arranges the correct money to be dispensed according to Ramanujan's Partition theory.
That's the genius of two fine Gentlemen (who never met and never bothered to patent their ideas) at play when you get cash in an ATM. Now, when you visit an ATM, just think of these two geniuses- one who got the idea and the other who gave how to work it before the idea of ATM sprang.