The transformation of the royal residence comes as The Royal Society, the Institute of Physics and the Royal Society of Chemistry have warned that more young people must be inspired to study the sciences to ensure the nation retains its place as a world leader in research so that the UK's economy can flourish.
Almost 1,000 GCSE and A-level students packed into the palace's grand ballroom for the special science day.
Above their heads, amid the chandeliers, dangled a hybrid of Quetzalcoatlus and Arambourgiania philadelphiae, a 36ft pterosaur, called 'Arry for short.
A troop of stand-up comics demonstrated "punk science" using comedy, music and experimentation in the Ball Supper room.
Other exhibits included a demonstration of a terahertz ray scanner that airports can use to spot weapons and a huge model of Einstein's head, balanced on a bicycle.
It's amazing, it looks like the place was made for exhibitions like this." He was showing off a collection of cartoons called Mars in their Eyes, which was inspired by a pocket cartoon by Matt of The Daily Telegraph.
A decade ago, when a debate was raging about whether a Martian meteorite contained fossilised microbes, Matt showed a meteorite being prodded by a scientist, and squealing "ouch".
The debate about life on Mars continues: a study by Mexican scientists of soil from some of the harshest environments on Earth published yesterday has provided new evidence that the Viking missions to the red planet may have missed signs of life. Prof Pillinger said yesterday that even the latest generation of Mars probes could be making the same mistake.
He added it was important to show with the exhibition that, as well as tackling big issues, science can be funny and amusing.
"We have to turn around the drift away from science," he said. "People have got to see that science is interesting. We're trying to teach them it's a laugh.
We have a sense of humour. We're not just men in white coats who give stuffy lectures."
He said the question that interested most of the pupils was whether there was going to be a new Beagle expedition.
And will there? "I hope there will be. I've not given up yet.
"
A giant mosquito was also on show to highlight new research in which insect repellent has been found by studying why some people can return from a camping trip without so much as a nibble when fellow campers are covered in mosquito bites, Rothamsted Research, Herts, and Aberdeen University have isolated chemicals in the body odour of people who naturally repel insects and have filed patents on their discovery. Visitors to the exhibit could test how attractive they are by placing their hand inside a tube and seeing whether the mosquitoes flew towards them.
The science day culminated with a reception last night for 500 members of the British scientific community including Prof Stephen Hawking of Cambridge University, Lord Rees, president of the Royal Society, Lord Sainsbury, the science minister, and Carol Vorderman, the TV presenter.
The event was hosted by the Queen and Prince Philip.
