## Participants

31 young healthy adults aged 18–40 years (mean: 28.22 years), with at least a bachelor’s degree, right-handed, consisting of 15 men and 16 women, participated in this study. All steps of the study were approved by the ethical review committee of the Institute with the IRB number of IR.UT.IRICSS.REC.1400.034. All methods complied with standard guidelines, protocols and regulations in accordance with the Declaration of Helsinki. In addition, participants signed an informed consent form and were free to leave the study whenever they wished.

## Experimental Procedure

Before entering the scanner, participants were informed about the task and the procedure through verbal and written explanations.

Our task consisted of 3 sessions and each session consisted of 66 trials. The time limit for each session was 15 minutes, but we did not set a time limit for responding to each trial. The task did not include any jittering in its steps. There was a two-minute break between sessions. After data acquisition, the fMRI data were preprocessed and analyzed with CONN19,20. The adjacency matrices were extracted and in the next step the signed matrices were created with these matrices.

These types of matrices were actually the primary data for extracting the SBT parameters(Fig. 1). These parameters were then used for statistical analysis, extraction of the results, and discussion.

## Experimental design

## Imaging Acquisition

The functional and structural MRI data were acquired using a 3 Tesla Siemens Prisma scanner equipped with a 32-channel head coil. Functional images were obtained with the following parameters: the voxel size was set at 3x3x3 mm³, indicating isotropic dimensions. A repetition time (TR) of 2000 ms was chosen to determine the time interval between successive image acquisitions. The echo time (TE) was 32 ms, which indicates the time span in which the peak echo signal was measured after each excitation pulse. The field of view (FOV) was set to 240 mm, defining the spatial coverage of each imaging volume. Parallel imaging with a GRAPPA algorithm (GeneRalized Autocalibrating Partial Parallel Acquisition) was utilized to reduce acquisition time. The scanner had high-performance gradient coils that facilitate rapid spatial encoding for improved image quality. The flip angle was 80 degrees. The number of slices was chosen to be 35, with a slice thickness of 3.00 mm.

## Experimental Stimuli

We developed a task based on the Dictator Game (DG) to investigate the occurrence of behavioral contagion (ref). The DG is among the experimental paradigms used in behavioral economics studies. In the DG, the participant (as dictator) decides how to divide an endowed amount of money between himself (herself) and an unknown person. The important question for the dictator is: 'How much for me and how much for the other person?'. This game is used to explore socio-economic behavior, altruism, egalitarianism and considerations of fairness or unfairness in decision making.

## Self-Selection-1 trials Prediction-Observation trials Self-Selection-2 trials)

Our task consisted of 3 sessions, and each session had 66 trials. In each trial, participant was shown two different patterns of money allocation between the participant (as self) and the other (Fig. 2). The duration of a trial is the required time to show each pair of patterns and participant’s response. In the first session (entitled as *“Self-Selection-1”* trials), participant (as dictator) was asked to repeatedly choose one of the pairs of patterns in trials. In session 2 (called Observation-Prediction trials), the preferences of a non-real person (entitled as *"other"*) were generated based on the participant’s preferences from session 1 and using the Fehr-Schmidt model that describes socioeconomic behaviors under uncertainty. In this step, the parameters of the Fehr-Schmidt model were extracted on the basis of the participant’s answers. These parameters had to be modified to reflect the preferences for unknown person.

With these modified parameters, the non-real person’s preferences to be used in session 2 were generated for each participant. In session 2, each participant was told that the generated preferences were the choices of an unnamed real person. In this session, each participant was shown the patterns of each trial and asked to guess the unknown person's preferences (66 trials). If the participant's guess was correct, a blue square would appear around the choice on each trial, otherwise the red square would appear. In session 2, the goal was for participants to pay attention to the generated preferences. Indirectly, participants became familiar with the preferences of others in this session. Session 3 (Self-Selections-2 trials) was similar to session 1 and the participant had to choose one of the two patterns in each trial. In this session, if contagion had happened, we would have seen changes in people's preferences. In all sessions, while performing the task, the participants were scanned by the fMRI scanner. We implemented our task using MATLAB R2021a (http://www.mathworks.com/products/matlab/) and Psychtoolbox-3(Clavien & Klein,2010) which is a set of MATLAB functions developed for neuroscience studies that provide a platform for evaluating stimuli and responses in experimental paradigms.

## Fehr and Schmidt Model

The Fehr-Schmidt model provides a framework for explaining how individuals’ preferences regarding fairness and inequality influence economic behaviors. In the context of this model, individuals are classified into two main types based on their socioeconomic behaviors: "fair types" and "selfish types". But most people are of the intermediate types. In this model, the utility function is able to quantify and model individuals' preferences to different levels of fairness and unfairness. This allows researchers to analyze and predict preferences and behaviors influenced by some parameters. The general form of utility function can be described as:

**Ui = Mi –** \(\varvec{\alpha }\varvec{i}\)**max [(Mj- Mi), 0]-** \(\varvec{\beta }\varvec{i}\) **max [(Mi - Mj),0] i** \(\ne\)**j** (1)

In the above equation, *Ui* represents the utility function for individual i. *Mi* denotes the monetary payoff or income of individual i and *Mj* shows the monetary payoff of the other. \(\alpha\) and \(\beta\) denote the weights assigned to the positive and negative difference between the monetary payoffs of individual i (*Mi*) and the other (*Mj*) respectively. They indicate how much the individual likes (or dislikes) having a higher (or lower) payoff compared to others21–24.

## Data analysis

## Behavioral Analysis

After collecting the fMRI data, the first step was to analyze the behavioral data. In this way, the number of matches between choices in sessions 1 and 2 and the number of matches between the choices in sessions 2 and 3 were calculated. The behavioral contagion rate (BCR) was defined as the difference between the numbers of these matches.

**BCR = N** **s2& s3** **- Ns****1&s2** (2)

Where N presents the number of matched trials and s denotes the session number by 1,2, and 3.

The threshold of BCR was set at 4 for the occurrence of contagion (larger than 5% of 66 trials). Using this threshold, the participants were categorized into two groups: Contagion and No Contagion.

## Neuroimaging Analysis

After data acquisition and behavioral analysis, CONN (version 22a) was used to analyze the fMRI data. The standard CONN pipeline was used to preprocess the data. The steps of this preprocessing are: import of functional and structural data, realignment, coregistration, segmentation, normalization, smoothing, and artifact detection and correction19. The standard atlas in CONN was converted to the Schaefer-400 atlas for our analysis. The Schaefer-400 divides the cerebral cortex into 400 different regions. Compared to many other atlases, the Schaefer-400 provides a finer view to obtain more accurate data. The results of CONN were adjacency matrices of the participants.

## Structural Balance Theory (SBT)

SBT uses two types of triads to study and analyze systems. The balanced triads, whose product of the signs of the three links is positive, are balanced triads (Fig. 3). Triads in which the product of the signs of their links is negative are called imbalanced triads. Two types of balanced triads are defined as strong (T3) and weak (T1). Strong balanced triads have three positive links [+++], but in weak triads there is one positive and two negative links [+--]. In imbalanced triads there are also two types: strong (T2) and weak (T0). The strong imbalanced type has one negative and two positive links [++-], while the weak type has three negative links [---]. The terms "strong" and "weak" in imbalanced triads refer to the degree of frustration that a triad can cause in a network.

The relationship between imbalanced triads and frustration is the basic tenet of structural balance theory. Imbalanced triads refer to the presence of inconsistencies in the relationships between three nodes in a network. Tension and frustration in the networks are the main consequences of imbalanced triads and lead to changes in behavior.

The balanced triads have a lower balance energy than the imbalanced triads, which are in a critical state due to their higher balance energy. Normally, the brain network is active in both resting and non-resting states, so there are a number of balanced and imbalanced triads in both states. In critical states and transitional periods, the imbalanced triads tend to be frustrated and change their links to reach more balanced states.

In SBT, balance energy was defined as the minus of the sum of the total products of the connections of triads in the network. The negative sign in front of the product represents compliance with the physical principle of minimum balance energy. Less balance energy means more stability in a system. In the context of SBT, the increase in balanced triads leads to lower balance energy and more stable systems.

$$\text{U}=-\frac{1}{\left(\genfrac{}{}{0pt}{}{n}{3}\right)}{\sum }_{i,j,k}{S}_{ij}{S}_{ik}{S}_{jk}$$

3

In the above equation, U denotes the total balance energy ,n is the number of nodes in the network, and \({S}_{ij}\) represents the connection between node i and node j, which can be 0 or 1. The term\(\left(\genfrac{}{}{0pt}{}{n}{3}\right)\) is the 3-combination of n, the number of triads that can be formed in a network with n nodes.

TMH (Tendency to Make Hub) is a global hubness measure to evaluate the tendency of a network's connections to form hubs. Based on the signs of connections, two types of negative and positive TMH are known. It is mathematically defined as:

Negative TMH=\(\frac{{\sum }_{i=1}^{n}{{NegD}_{i}}^{2}}{\sum _{i=1}^{n}{NegD}_{i}}\) (4), Positive TMH=\(\frac{{\sum }_{i=1}^{n}{{PosD}_{i}}^{2}}{\sum _{i=1}^{n}{PosD}_{i}}\) (5)

Where positive degree (*PosD*) and negative degree (*NegD*) are the numbers of positive and negative links of node i, respectively, and n represents the number of nodes.

## Calculation of the SBT parameters

Once preprocessing was complete, both first and second level analyses were performed. The adjacency matrices are mathematical representations of the brain network. Each element of these matrices represents the presence or absence of a link between two nodes. These matrices were used to create the signed matrices. The signed values in these matrices represent the directionality of the connections between the nodes. Positive signs represent excitatory links, while negative signs represent inhibitory links (or anti-correlations). The signed matrices were then used to calculate the 11 parameters of the balance theory in both session 1 and session 3 for each participant .The parameters were the number of positive links, the number of negative links, T0, T1, T2, T3, positive TMH, negative TMH, the number of balanced triads, the number of imbalanced triads, and balance energy.

## Statistical Analysis

Various statistical methods were used to assess the differences, relationships and quality of the variables. First, the normality of the calculated parameters had to be checked using the Shapiro-Wilk test. If the SBT parameters of 2 sessions were normally distributed (p-value > 0.05), in the next step they could be measured with a paired t-test, and if not and at least one of each matched pair was not normally distributed, the measurement had to be performed with the Wilcoxon signed-rank test, a non-parametric alternative to the paired t-test. Both tests determined whether there were significant differences between the SBT parameters in the sessions (before and after observing others' preferences).

Another statistical method that we used in our analysis was the independent t-test. The independent t-test is a parametric test that can be used for normally distributed data from two independent groups. If the assumptions of normality for two groups are not met, the Mann-Whitney U-test serves as a suitable alternative to the independent t-test. The Mann-Whitney U-test determines whether the medians of two independent groups are different or not. In our analysis, the independent t-test and the Mann-Whitney U-test were used to compare the SBT parameters of the first sessions of the Contagion and No Contagion groups.