Mathematics of Discontent: A Study of the Panamanian Protests from Graph and Game Theory

During the second half of 2022, Panama faced an unprecedented social event. While there have been protests by certain social sectors in the past, never before had there been such a massive demonstration involving different sectors of Panamanian society. The consequences of the pandemic, inflation and some government policies generated widespread discontent among citizens. From Bocas del Toro, through Panama City, Guna Yala and Darien, protests were reported from different social sectors clamoring for the high cost of living and an end to corruption.

These weeks of protests throughout the country reflected a shift in the discussions of the inhabitants towards a more hostile and polarizing discourse, focused on issues such as corruption, cost of living and politics in general. Politics became present in everyday life, manifesting itself in discussions within isolated social circles and even in daily interactions. The social structure was also affected by the protests. While some social sectors formed alliances around social discourse, social networks such as X (formerly Twitter) reflected segregation and polarization. This context motivated the study of social interactions using mathematics, analytics and computer science to understand the political context, the dynamism of opinions and political activism.

In previous work, tweets from the time of the protests in Panama, both in Spanish and English, were analyzed. Figure 1 shows the density of Sentiment Score in a sample of X (formerly Twitter). Most of the discourse in Spanish is negative compared to the discourse in English. This is due to the nature of the international conversation, which encompasses more topics, in contrast to the conversation in Spanish, influenced by the heated political context that Panama was experiencing. In addition, the traditional media in Panama lost influence in the national conversation. Many new news actors emerged in social networks and became influential in the public discussion. It was even found that fans of BTS (K-pop band) and the Panamanian national soccer team played a significant role in the conversation.

Figure 1: Sentiment analysis on the sample of tweets

To study these protests and understand the complex social scaffolding behind them, graph theory and game theory are used. A graph consists of nodes, which can represent individuals, and links, which represent the relationships between them. In addition, Evolutionary Game Theory analyzes how individuals make decisions based on their own survival. These decisions generate the “survival of the fittest” and trigger various types of social dynamics. These theoretical tools allow the creation of a dynamic opinion model, in which an individual adapts his opinion according to the relationships and social dynamics in which he finds himself. The following model is developed by Arturo Serrano Borrero, a student and researcher in applied mathematics at Datrmouth College in New Hampshire, and was presented at the Quantil seminar available at the following link

The Adaptive Voters Model consists of simulating the process by which the network influences the political opinion of an individual (node of the graph) according to its connections with other individuals (links) in a dynamic context. At each iteration of the model, each node must decide whether to change its political opinion (social learning) or to remain in the same opinion, staying within the same group (homophily). The environment in which individual opinions are more entrenched and the group with which one interacts more frequently influence this type of political decision. The model starts from a scenario of coexistence and predicts either a state of consensus (everyone chooses the same opinion) or a state of fragmentation (society segregates according to its opinions), as shown in Figure 2. Therefore, moderate conviction is included in the model to analyze individual heterogeneity in the simulation of political and social movements.

Figure 2: Network states

The model proposed by the author is executed in two main actions. First, an individual is selected and checked if any of his neighbors is an activist (node with a high conviction component). If there are no activist neighbors, the individual takes no action. However, if there is an activist neighbor who in turn has other activist neighbors, the conviction value of the individual increases. In this way, the convictions of each node are calculated according to the network structure. Once the convictions of the network members have been calculated, the adaptation step is carried out in the model. An individual is chosen at random and its neighbors are identified. Depending on the level of conviction of this individual, he may choose to keep the network as it is or participate in an adaptation, i.e., try to change the opinion of others or close the conversation and connect with nodes that share the same opinion.

After generating different simulations of the proposed model, the following results were obtained. As time passes in the model, activists who start with a high level of conviction tend to give up and become discouraged. If the model favors homophily among individuals, politically viable networks are generated with isolated but highly connected communities of activists. Network connectivity and the level of conviction of individuals are strong predictors of protest. Activist groups survive (maintain their conviction) as long as they are connected to other activists who help keep that conviction alive.

In addition to the above findings, the data can be used to refine the model and reach more precise conclusions. Geography and spatial segregation have a significant impact on the polarization of societies, as physical proximity can reinforce social and cultural barriers between different groups. Also, the sociodemographic conditions of people within the network play a crucial role in the formation and modification of opinions. It is important to recognize that protest is not a uniform phenomenon; different sectors of society may demonstrate at the same time but in response to different issues and in varied ways. Homophily is also influenced by sociodemographic conditions, as people with similar circumstances tend to interact and communicate more frequently.

These findings underscore the complexity of social dynamics in times of protest. The interplay between geography, spatial segregation, and sociodemographic characteristics reveals that social movements cannot be understood simply through a homogeneous analysis. Integrating these factors into the model provides a more complete picture of how opinions are formed and maintained within a social network. Lessons learned highlight the importance of considering multiple dimensions in the analysis of social and political phenomena, and how continuous adaptation of models to new data can significantly improve our understanding of protest and polarization dynamics. This approach allows for a more nuanced and effective assessment of strategies to address and understand the complexities of societies in conflict.

Recent articles

In the Blog articles, you will find the latest news, publications, studies and articles of current interest.

AI Governance

Beyond Automation: Why We Need New Metrics to Understand the Future of Work with AI

In recent years, the conversation about artificial intelligence and employment has been dominated by a substitution narrative: Which jobs will disappear? How many jobs will be replaced by algorithms? While this question is important, it has led us to view the future of work from a narrow perspective…

IA

AI for the Common Good: Capabilities, Power, and Participation

How should we understand the concept of developing Artificial Intelligence for the common good? This is a key question, which, according to philosopher Diana Acosta Navas, opens up two central dimensions: one philosophical and the other political…

IA

SESGO: A Critical Look at AI Biases in Spanish

In recent years, language models have transformed the way we interact with information. From virtual assistants to decision-support systems, these tools have become omnipresent…

Algorithmic Justice

Justice in Artificial Intelligence Models: A New Perspective Based on Algorithm Redesign

In recent years, artificial intelligence models have demonstrated incredible potential to transform industries, from healthcare to finance. However, they have also exposed a troubling issue: algorithmic bias.

Machine Learning

Robust Inference and Uncertainty Quantification for Data-Driven Decision Making

Machine learning models have become essential tools for decision-making in critical sectors such as healthcare, public policy, and finance. However, their practical application faces two major challenges: selection bias in the data and the proper quantification of uncertainty.

Neural Networks

The Potential Impact of Machine Learning on Public Policy Design in Colombia: A Decade of Experiences

This blog is an extended summary of the article Riascos, A. (2025). Since the beginning of the so-called third wave of neural networks (Goodfellow et al., (2016)) in the first decade of this century, there has been great hope in the possibilities of artificial intelligence to transform all human activities. At the same time, warnings have been raised about the risks involved in the introduction of this new technology (Bengio et al., (2024)).