When apes make a bad decision or took a gamble that doesn't pay off, they bang on tables and perform other kinds of tantrum-like behaviors, often exhibiting regret by attempting to undo what they had done.

The new findings suggest that for apes, much like for people, the consequence of decisions cause emotions that, in turn, play a major role in shaping future decisions and the willingness to take risks.

"This suggests that the roots of human economic behavior are shared with these nonhumans," said Alexandra Rosati, an anthropologist at Yale University in New Haven, Conn. "One thing it might help explain is why humans show certain types of biases and why people don't seem to be very rational."

VIDEO: Chimps Face Death Like Humans Do

For most people, emotions influence both day-to-day behaviors and long-term decisions. Consider, for example, the choice between a sure-thing: $50, or the opportunity to take a gamble with a 50 percent chance of winning $100 and a 50 percent chance of getting nothing.

For some people, gambling and losing might cause enough disappointment and regret to affect their likelihood of gambling again in the future. People who respond less emotionally, on the other hand, might continue to gamble again and again.

NEWS: Chimps Communicate Like Passionate Italians

To test the same kinds of reactions in animals, Rosati and colleagues trained chimpanzees and bonobos to perform two tasks.

In the first task, the apes had to decide between foods in two bowls. They could pick a mediocre item like peanuts, which taste OK but aren't anything special. Or they could gamble on a mystery bowl, which might yield an awesome treat like a banana or something like a cucumber, which is edible but, as Rosati said, "not awesome."

In the second task, the animals could choose between one piece of banana that they could have immediately or three pieces of banana if they were willing to wait a couple of minutes.

Chimpanzees at the Tchimpounga Sanctuary for primates in Pointe Noire, Republic of Congo.Alexandra Rosati

Chimps and bonobos responded differently to the challenges, Rosati and colleague Brian Hare report today in the journal PLOS ONE.

Compared to their primate cousins, chimpanzees tended to be more willing to delay gratification, but they were also more likely to take risks and gamble. Those differences probably reflect the ecological pressures each type of ape tends to encounter in the wild, Rosati said.

Chimps live in less productive forests, where food is spread out and harder to find, making them more patient and also more willing to take risks for a bigger payoff.

Primates at Risk: Photos

Both species had emotional reactions to the results of their choices. When they were unhappy after making a bad decision, animals moaned, whimpered and screamed – all vocalizations associated with negative feelings. After losing on a gamble, animals also immediately went to the other side of the table in an attempt to get the better option.

"It was like, 'Oh no. I didn't mean it! I want this one," Rosati said. "It was analogous to regret."

Scientists have long known that chimps and bonobos react emotionally to situations in their lives, including joy at seeing a friend and grief after losing a loved one, said Barbara King, an anthropologist at the College of William and Mary in Williamsburg, Va., and author of "How Animals Grieve."

The new study shows that apes also feel emotions as a result of their own decisions, much like people do.

"This work is important for helping us to fully grasp the degree to which animals other than humans feel their lives even as they think through their own choices," King said, "a finding that compels us to think hard about how we treat our fellow creatures and to work for their welfare."