A person's intelligence is mostly inherited, it's in their genes, but whether a person can expect to be a clever grandma or grandpa relies on both genes and environment.

"Until now, we have not had an estimate of how much genetic differences affect how people's intelligence changes across the lifetime," study researcher Ian Deary, of the University of Edinburgh in the United Kingdom, said in an email to LiveScience. "These new results mean that researchers can seek both environmental and genetic contributionsto successful cognitive aging."

Previous studies of the genetics of intelligence have been performed on sets of twins or siblings who have been adopted and raised in different environments. These studies showed a genetic component of intelligence, but previous studies weren't able to determine how this changes over a lifetime.

Smart Scots

The researchers studied a group of 1,940 Scottish individuals whose intelligence was measured when they were 11 years old. They were tracked down recently and had their intelligence measured again in old age (65, 70 or 79 years of age). The researchers also collected genomic data from blood samples.

They looked to see whether having similar genes impacted a person's cognitive abilities at age 11 and later in life: For example, if two people had certain gene snippets in common, and they both tested above-average at 11 and in old age, those snippets are likely to be important in having and maintaining intelligence.

The researchers didn't identify the specific snippets of DNA involved in intelligence, but they were able to determine how much of a role having the "right" genes — whatever they are — plays in lifelong intelligence.

They found that intelligence (as measured with traditional IQ tests) itself is highly heritable — it can be passed down from parent to child. They also found that it comes from not one gene, but from small effects of many genes, and these same genes affect intelligence in both youth and old age. On the other hand, whether this intelligence changes over time, they found, is very reliant on the environment.

Genes and brains

"These results suggest that genes contribute to our understanding of why some people’s brains have aged better than others, but the environment is probably the larger influence on lifetime changes," Deary said. "The results also suggest that many of the same genetic factors contribute to intelligence differences in childhoodand old age."

The researchers said that about 25 percent of these intelligence changes over time were due to genes, while the rest came from the environment. These genes that are involved in cognitive change could be related to diseases like dementia.

"Clues to the origins of people's differences in cognitive decline could be useful for understanding more about dementia," Deary said. "We are planning to look closely at brain structure with our older people to see if there are links between genes, brain structure and cognitive skills in old age."

Environment also had an impact on intelligence stability; the intelligence of some people improved while others declined. This could be influenced by such things as how active an older person is.

The study will be published in the Jan. 19 issue of the journal Nature.

You can follow LiveScience staff writer Jennifer Welsh on Twitter @microbelover. Follow LiveScience for the latest in science news and discoveries on Twitter @livescience and on Facebook.