At a campaign rally in Roanoke, Va., before the 2012 election, President Barack Obama opined: “If you were successful, somebody along the line gave you some help. There was a great teacher somewhere in your life.... Somebody invested in roads and bridges. If you've got a business—you didn't build that. Somebody else made that happen.”

Although Obama was making a larger point about the power of collective action, such as building dams, power grids and the Internet, conservative heads exploded at the final sentiment. “I did build that!” is an understandable rejoinder to which I can relate. I research my books, edit my magazine, teach my courses and write these columns (this one is my 200th in a row for Scientific American). If I don't make them happen, nobody else will. But then I started thinking as a social scientist on the role of circumstance and luck in how lives turn out. It's a sobering experience to realize just how many variables are out of our control:

  • The luck of being born in the first place—the ratio of how many people could have been born to those who actually were—is incalculably large, not to mention the luck of being born in a Western country with a stable political system, a sound economy and a solid infrastructure (roads and bridges) rather than, say, in a lower caste in India, or in war-torn Syria, or anarchic Somalia.
  • The luck of having loving and nurturing parents who raised you in a safe neighborhood and healthy environment, provided you with a high-quality K–12 education and instilled in you the values of personal responsibility. If they were financially successful, that's an added bonus because a key predictor of someone's earning power is that of their parents.
  • The luck of attending a college where you happened on good or inspiring professors or mentors who guided you to your calling, along with a strong peer cohort to challenge and support you, followed by finding a good-paying job or fulfilling career that matches your education, talents and interests.
  • The luck of being born at a time in history when your particular aptitudes and passions fit that of the zeitgeist. Would Google's co-founders Larry Page and Sergey Brin be among the richest and most successful people in the world had they been born in 1873 instead of 1973? Both are brilliant and hardworking, so they would probably have been successful in any century—but at the equivalent of nearly $45 billion each? It seems unlikely.

What about intelligence and hard work? Surely they matter as much as luck. Yes, but decades of data from behavior genetics tell us that at least half of intelligence is heritable, as is having a personality high in openness to experience, conscientiousness and the need for achievement—all factors that help to shape success. The nongenetic components of aptitude, scrupulousness and ambition matter, too, of course, but most of those environmental and cultural variables were provided by others or circumstances not of your making. If you wake up in the morning full of vim and vigor, bounding out the door and into the world to take your shot, you didn't choose to be that way. Then there is the problem of übersmart, creative, hardworking people who never prosper, so obviously there are additional factors that determine life outcomes, such as bad luck ... and bad choices.

Volition, too, must be considered in any evaluation of life outcomes, in the sense of knowing your strengths and weaknesses and selecting paths more likely to result in the desired effect. You can become aware of the internal and external influencing variables on your life—and aware of how you respond to them—and then make adjustments accordingly, however restrictive the degrees of freedom may be.

If the cosmic dice rolled in your favor, how should you feel? Modest pride in one's hard work is no vice, but boastful arrogance at one's good fortune is no virtue, so you should cultivate gratitude. What if you've been unlucky in life? There should be consolation in the fact that studies show that what is important in the long run is not success so much as living a meaningful life. And that is the result of having family and friends, setting long-range goals, meeting challenges with courage and conviction, and being true to yourself.