In light of this year's tragic mass shootings — Sandy Hook Elementary and the shooting at a Wisconsin Sikh temple, among others — many are wondering why the people who commit these acts often kill themselves at the end of it.

In a recent Quora thread, Tim Dees, a criminal justice technology writer, offered his opinion that suicide is the shooter's "last great act of revenge and defiance."

"Most of these people are angry at the world over the way they have been treated, or at least the way they perceive they have been treated," Dees wrote on Quora. "This is payback. They go into this situation with the full intent of killing themselves to deny the world its opportunity for retribution."

Lankford studied data from a 2010 New York Police Department report of active shooter incidents in the country where police knew the identity of the shooter and found that about half of the shooters who killed at least two people committed suicide.

The reason, according to Lankford, is that because the more people a shooter kills, the guiltier he feels, meaning he is more likely to kill himself.

"This suggests that those who have the most rage toward others – and therefore end up killing the most victims – would also feel the most guilty and ashamed about their crimes," Lankford wrote for Wired. "They are therefore more likely to engage in “self-punishment” via suicide or suicide by cop. After the initial explosion of rage causes them to open fire, active shooters who see many dead or dying victims around them may feel a correspondingly higher need for self-punishment than shooters with fewer victims."

Lankford also suggested that shooters who come to scene more heavily armed are "possibly fueled by a more powerful sense of “injustice” and hopelessness than other active shooters," meaning they are more likely to kill themselves.