Known as a pioneer of the computer, Babbage wrote to Albert in 1843 about his Analytical Engine, a machine which could perform calculations using punched cards and had a memory unit to store numbers.
Standing in the Science Museum’s new Smith Centre, the Queen was applauded after she shared the post on the royal Instagram account which was launched in 2013 and now has 4.6 million followers.
The Queen’s post read: “In the letter, Babbage told Queen Victoria and Prince Albert about his invention, the Analytical Engine, upon which the first computer programmes were created by Ada Lovelace, a daughter of Lord Byron.
“Today, I had the pleasure of learning about children’s computer coding initiatives and it seems fitting to me that I publish this Instagram post at the Science Museum, which has long championed technology, innovation and inspired the next generation of inventors.”
During her reign the Queen has encountered a rapidly-changing world of technology, from the advent of colour television to mobile phones and the internet.
Television cameras were allowed inside Westminster Abbey in 1953 to film her Coronation and more than half a million extra TV sets were sold in the weeks running up to the historic event.
Five years later, she made the first trunk call in the UK and, when email technology was in its infancy, she became the first monarch to send one of the electronic messages – during a visit to an Army base in 1976.
The concept of video-sharing website YouTube was explained to her by Princesses Beatrice and Eugenie before she launched her own channel on the site in 2007 to promote the British monarchy.
Her own website, www.royal.gov.uk, was launched in 1997 during a visit to Kingsbury High School in Brent, north-west London.
Other technological milestones for the Queen include personally uploading a video on to YouTube during a visit to the Google offices in London in 2008, and in 2014 she posted her first tweet under her own name to declare the opening of the new Information Age Galleries.
Science Museum director Sir Ian Blatchford said it was a “nerve-wracking moment” when the Queen posted the picture on Instagram.
He added: “She has seen more technological change than any of us can imagine. She is remarkably well-informed about big trends, things like miniaturisation.
“She is also very well-informed about computing power, because what she has seen is vast computers shrink to a smaller scale.”
In the new Smith Centre, which Science Museum supporters and employees will use for networking, events and lectures, the Queen was shown an artefact from internet history.
Dr Tilly Blyth, the museum’s head of collections, told the Queen that Sir Tim Berners-Lee, inventor of the World Wide Web, used the computer to host the first web page.
She pointed out a sticker on the front which read “This machine is a server do not power down” and joked: “If you shut it down you would have turned off the World Wide Web.”
Sir Tim laid out his idea for the web in March 1989 in a document called Information Management: A Proposal.
During her visit, the Queen was amused by a beebot – a robot designed for use by children – which appeared to be escaping from a group of primary school pupils who had programmed it, and later she chatted to other students who had created a light detector using code.
One of the star attractions from the forthcoming exhibition is an Enigma machine loaned by GCHQ – the intelligence, security and cyber organisation.
It was the second time in the past few weeks that the Queen had seen one of the machines which were used by Nazi forces during the Second World War to encrypt their messages.
During a visit to GCHQ’s former home in central London, she was shown the device along with a phone used by Margaret Thatcher to scramble her messages while prime minister.
Sir Ian said the Queen compared the Enigma machine to today’s devices and “commented on the fact that you could see its rather cumbersome cogs – it is a very physical thing – whereas now a lot of modern technology is invisible but infinitely more powerful”.
He added that the royal visitor was particularly struck that the young children she met during the visit, who were taking part in a coding workshop, were “digitally native”.
He said: “It is quite humbling that to them all this new technology is completely natural. They are totally fluent in it. They are very intuitive in the way they deal with it. I think that really amazes her.”