text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Evolution of social relationships between first-year students at middle school: from cliques to circles

## Abstract

People organize their social relationships under a restriction on the number that a single individual can maintain simultaneously (the so-called Dunbar’s number, ~150). Additionally, personal networks show a characteristic layered structure where each layer corresponds to relationships of different emotional closeness. This structure, referred to as Dunbar’s circles, has mostly been considered from a static viewpoint, and their structure and evolution is largely unexplored. Here we study the issue of the evolution of the structure of positive and negative relationships in early adolescence by using data from students in their first year at middle school obtained from surveys conducted in class in two different waves separated by several months. Our results show that, initially, students have a lower number of total relationships but the majority are more intense and over time they report a higher number of total relationships, but the more intense relationships appear in a lower proportion. We have also found differences in the structure of communities at both temporal moments. While in the first instance the communities that appeared are mixed, made up of both boys and girls, in the second they changed so that they were separated primarily by gender. In addition, the size of each community was stabilized around 15 people, which coincides with the size of the second Dunbar’s circle, known as the sympathy group in social psychology. As a consequence, in groups with around 20 students of the same gender, they tend to split in two separate communities of about 10 each, below the second Dunbar’s circle threshold. On the other hand, groups with more stable community structure appear to go through the inverse process of friendship evolution, becoming more focused on their best relationships. All these results suggest how the layered structure of the personal network, as well as the community structure of the social network, emerge directly from the union of both positive and negative relationships. Thus, we provide a new perspective about its temporal evolution that may have relevant applications to improve school life and student performance.

## Introduction

Over the past twenty years1, research has accumulated evidence showing that the number and quality of our social relationships play a key role in our happiness2, our mental and physical health3, 4 and our social capital5, 6. The organization of our friendships and acquaintances is also crucial to understand how contagious diseases propagate and can be contained7, 8. Similar effects arise also when considering information or opinion diffusion9 and social norm formation10. Social network analysis, a discipline combining the insights of sociology and complex systems and networks, is therefore instrumental to advance our knowledge of these phenomena11, 12. In this regard, a key finding is that the average size of personal social networks is approximately 15013,14,15, with typical sizes varying in the range 78–25016. These networks actually consist of a series of layers that correspond to relationships of different quality13, 17, 18. The cumulative account of individuals up to a certain layer is what is referred to in the literature as ‘circles’. Circles exhibit distinct sizes (around 1.5, 5, 15, 50, and 150), i.e., each circle is roughly three times the size of the previous one. The different layers could be characterized as primary partner(s), intimate, best and good friends and, finally, just friends, constituting the so called ‘active network’16. Sociological research on strong and weak ties suggests that the 5-circle is in fact a support network18, while the 15-circle is known in social psychology as a sympathy group, consisting of people whose death would cause great distress19. Recently, it has been shown20 that the existence of circles and of a scaling ratio between them is a consequence of the limitations of our cognitive capacity and of the different time devoted to friendships of different emotional closeness.

While the above framework has proven itself both accurate and useful, there are two main issues that require further research to better benefit from its application to social phenomena. First, the static picture of the layers must be scaled to take into account temporal effects and its dynamical evolution21. There are some studies incorporating the time dimension to the data collection process, either for short time-scales22, 23 or for longer ones24, 25. However, much more research is needed to characterize in detail the evolution of friendships and, in particular, to shed light on the relevant mechanisms driving it. Second, the size and structure of personal networks is subject to strong age effects13, 26, 27. 20-year-old people usually have more friends than 60-year-old ones, mostly because the elderly tend to have outside layers with lower numbers of friends28. Middle age is characterized as a stability period until a rapid declining in the number of friendships sets in27, 29. In turn, adolescents have very sensitive networks, suffering dramatic modifications when changing homes30 or starting college31.

In this paper, we study the issue of the evolution of friendships in early adolescence by using data from high school students. In contrast to previous research23, 32,33,34,35, here we focus on the existence and evolution of a Dunbar's circle structure in the students’ personal networks. To that end, we carried out two survey waves in different moments of the academic year, so we could compare the resulting networks. In addition, we include in our study not only positive relationships (friendships) but also negative ones (enmities). Due to the scarcity of negative links, the existence of Dunbar-like circles could be assessed for positive relationships only. However, a proper study of group or community-formation process in classes requires taking into account negative links as well. Indeed, community detection algorithms based on positive links only typically split a network into subgraphs or modules characterized by high link density36. However, in a social group such as a school class, where students interact daily for many hours, it seems only natural to consider the possibility that some students have bad relationships with others. It is clear that this could distort the picture arising from looking only at the positive relationships and, as a consequence, new community detection algorithms must be applied37.

## Results

### Individuals and Dunbar’s circles

We studied a group of students from a high school in Madrid, IES Blas de Otero, in the first year of secondary school (students between the ages of 12 and 13). Practically all students are new to the high school, having finished primary school somewhere else in the preceding year. A few students were taking first year again having failed the year before. Two data collection sessions were held respectively in December 2018 (wave 1) and May 2019 (wave 2). 151 students (73 boys and 78 girls, cf. Supplementary Information for more disaggregated numbers) and their families agreed to participate. The percentage of participation was 97% in the first wave and 90% in the second wave.

Students were born in 2006 (75%), 2005 (23%) and 2004 (3%). Classes were organized in 5 groups and were all enrolled at first year of ESO (mandatory secondary education, similar to middle school). Groups were labeled with letters, from A to E. Groups A and B received most of their teaching in English (all subjects except Math, Spanish and the chosen option between Religion and Ethical Values), whereas groups C through E were taught in Spanish except in Arts and Physical Education, where classes took place in English.

Students were presented with a list of all other 150 participants and were asked a set of questions allowing us to infer positive and negative relationships with three levels of intensity (cf. Table 1). For various reasons, participants were not able to correctly discriminate between the two lower intensity levels, which were merged into a single level. Therefore, both positive and negative relationships were classified into two levels of intensity, which we will henceforth refer to as ‘friend’ and ‘best friend’ for positive relationships, and ‘enemy’ and ‘worst enemy’ for negative relationships. Data on the original answers prior to merging categories can be found in the Supplementary Information.

Our first result concerns the composition of the two circles of positive relationships and the comparison to the expected Dunbar’s circle structure. As can be seen from Fig. 1, the basic structure of the first two circles appears, with average sizes that vary considerably across groups. In wave 1, the global average over all participants in the survey yields a mean size for the “best friends” circle (hereafter, circle 1) of 14.48 and for the “friends” circle (hereafter, circle 2) of 27.01 which are clearly larger than the typical sizes reported for these two circles. In wave 2, these values become 11.27 and 28.47, respectively, still far from the expected values. There are several possible explanations for this finding. A first one is that students are still in an exploring phase, they have already established several relationships with people they did not know from school, while keeping friends with other students coming from their same school. Unfortunately, the onset of the Covid-19 pandemics prevented us from continuing our historical series of waves when schools were put under lockdown, so we cannot say much more about the evolution of friendships. Another possibility is that our questions are in fact not eliciting circles 1 and 2, but instead circles 2 and 3. In that case, the results would be more in line with the expected Dunbar's circle structure (albeit circle 3 might be not entirely elicited), but we cannot be sure whether students interpreted our questions in that manner.

Another hypothesis that may explain the large observed values is that students treat relationships in their group differently from those with other groups, thus devoting separate cognitive efforts to each set. For each group, the majority of the relationships reported (67.22% in wave 1, 56.98% in wave 2) are with students in the same group (cf. Fig. 2). It is interesting to note that students in the English groups (A and B) declare practically no relationship with students in the Spanish groups (C, D, E) in wave 1, and only a few more in wave 2, and vice-versa. This may have to do with their primary schools of origin, as English groups can only be joined by students coming from English speaking primary schools and practically all of them come from just two such schools. If we restrict ourselves to intra-group relationships, the average sizes of the circles become 8.79 and 15.64 in wave 1 and 6.47 and 15.56 (cf. Fig. 3), much closer to the typical values for the first Dunbar's circles, which would suggest that the hypothesis advanced at the beginning of the paragraph may have some truth to it.

As for reported negative relationships, their absolute number is much smaller than that of positive ones, with average values of 4.82 for bad relationships and 2.07 for very bad ones (7.83 and 2.11 in wave 2; plots for negative relationships are included in the Supplementary Information). Even if there are not that many negative links, it is important to note that while the number of very bad relationships remains constant, there is a relatively large increase of the number of bad relationships from wave 1 to wave 2.

Looking now at the time evolution between the two waves, Figs. 1 and 2 along with the data above suggest a general trend in which the size of circle 1 decreases and the size of circle 2 remains constant or even increases. To analyze this possibility in more detail, we resorted to the use of the parameter $$\mu$$, which was introduced in Ref. 20 as a summary of the circle structure of a given individual (cf. Methods below for more details). In a nutshell, $$\mu =\log \big ((C_2-C_1)/C_1\big )$$, $$C_i$$ being the number of relationships in circle i (see Methods). When $$\mu >0$$ we have a typical structure of the circles, with the number of friendships in each one increasing rapidly as we move outside; a value $$\mu \sim 0.7$$ arises when the scaling ratio between circle sizes is around 3, as frequently observed. On the contrary, when $$\mu <0$$ most friendships are already in circle 1, with additional circles bringing in very few additional people. We fitted the analytical expression from Ref. 20 to the reported numbers of friendships in the two circles for each student, thus assigning them a specific value of $$\mu$$. Figure 4 shows the distribution of the values of $$\mu$$ in the two waves, and the distribution of their difference. It turns out that the average $$\mu$$ in wave 1 is positive only for groups B and D (cf. Table 2), while the increment in the value of $$\mu$$ between waves is positive in all cases except in group B. Further details about the changes of $$\mu$$ can be found in the plots in the Supplementary Information.

Figure 5 shows the distribution of individual differences in the value of $$\mu$$ between waves, which is normally distributed for all groups (Shapiro-Wilk test). A one-sample t-test showed that the mean for the $$\mu$$ difference was statistically different from 0 only for groups A, C and E. A one-way ANOVA test determined that there was a statistically significant difference between groups ($$F(4,117)=6.674$$, $$p<10^{-4}$$). The Tukey HSD post hoc test showed that group B was significantly different to groups A, C and E, while group D was significantly different from groups A and C. Altogether, we can conclude that groups B, D and E, behave differently to groups A and C. The high frequency of cases in which $$\mu$$ decreases could indicate that these groups (B, D and E) have some particular feature which, if it exists, is not related to the teaching language, as both English- and Spanish-speaking show this behavior.

To gain further insight on this result, we resorted to consider the network of nominations received. Thus far, we have looked at friendships from the perspective of ego, i.e., the nominating student, considering as friends or best-friends all those they mentioned in the survey (outgoing links). The question we ask now is whether looking at the network from the perspective of being nominated, i.e, of the incoming links, we observe something similar to what we have noticed above. In this regard, it is interesting to note that in our results, 56.6% of the positive relationships are reciprocated in wave 1, and 58.3% in wave 2 (in line with the fact that surveys produce only approximately a 50% of reciprocated nominations39, 40). However, if we rewire the links in the network at random, the reciprocity is much smaller ($$22.6\%$$, CI: $$(21.4\%; 23.8\%)$$ in the network of wave 1, $$24.6\%$$, CI $$(23.4\%; 25.8\%)$$ in wave 2; see Supplementary Information for details of the comparison with the reciprocity of randomly rewirings of our networks), meaning that the observed reciprocity is large and that the network of incoming nominations may exhibit properties similar to the outgoing ones. To carry out the analysis, we introduce the parameter $$\rho$$, which plays the same role as $$\mu$$ but using in-degrees instead of out-degrees. The results of this analysis confirm the picture we have presented above, perhaps even more clearly (cf. figures in the Supplementary Information). We can thus say that most students in groups A and C, and a majority of those in the rest of the groups, change from having mostly best friends and only a few friends to a more standard circle structure with less best friends and more friends. Finally, we have not carried out a similar study with negative relationships because the small number of them prevents us from extracting meaningful values for $$\mu$$ or $$\rho$$ for enmities.

### Networks and community structure

Beyond the evolution they reflect at the level of individual students, changes in $$\mu$$ might be also reflecting structural changes in the social network. In order to assess this possibility, we have carried out a study of the structure of the groups by means of community analysis (see Methods below for a discussion of how we implement the analysis taking into account that we have a signed, directed network). We begin discussing the corresponding results by looking at the network at the global level, i.e., including all the students and all their relationships in a single network. Figure 6 represents the global network obtained from the two waves, with the nodes separated in communities. The plotting algorithm is ForceAtlas238, which yields itself a community analysis—as a matter of fact, the high correlation between colors and position in the plot is an outcome of this algorithm and has not been externally imposed. This in turn means that the communities found are quite robust. As can be seen from the data summarized in Table 3, in the network of wave 1 community C1 is formed by the students in the two English-speaking groups, whereas community C3 contains groups C and D and community C4 contains group E; community C2 is formed by a minority of students from almost every group, but mostly from D. The separation observed in the plot between community C1 and the rest speaks of the deep separation between the two English-speaking groups and the three Spanish-speaking ones. This division most likely originates from the fact that students that just entered the high school two months prior to wave 1 still rely more on colleagues from the same primary school. Unfortunately, we do not have data on their school of origin, which could help us understand why the Spanish-speaking groups end up separated in two communities.

It is worth noting that the plot of the network in wave 2 looks more spatially extended than that of wave 1. This is a consequence of the almost doubling in the number of bad relationships mentioned above while the number of positive links remains more or less constant. However, at the level of the whole group negative links do not seem to have a strong influence in the community structure. As can be seen from the figures in the Supplementary Information, if the community analysis is carried out without the negative links, the only change is in wave 1, where the community arising from group E is merged with community C2, formed by an assortment of students from all Spanish-speaking groups. In wave 2 there is not any significant change in the number or composition of the clusters. Therefore, we conclude that identity factors (English- vs Spanish-speaking, along with school of origin) are what is most relevant at this level and negative links lead to small changes, if at all.

In wave 2, Fig. 6 shows that even if a whole academic course has passed, the separation between groups speaking different languages still remains. However, the increase in the number of friends is visible in the fact that the two communities are now somewhat closer. Interestingly, our algorithm detects one fewer community, the reason being that now all Spanish-speaking groups appear in a single community, C3. C1 continues to be the English-speaking part of the students, now including all but one of them, while C2 is a smaller community formed by people of groups C and D. It is interesting to note that group D remains in the two waves split into two communities, being the only one that is thus separated. It is very likely that there is something acting as a dichotomizing criterion here, such as the school or the country of origin, but unfortunately we do not have the data to assess the mechanism explaining this splitting. The table of the number of people that change between communities in the Supplementary Information confirms that the movements of individuals between communities took place as we have just discussed. It can also be seen from the numerical data that while communities C1 and C3 have the gender distribution that they inherit from the constituent groups, with a 2:1 girl-to-boy ratio in C1 and almost 1:1 in C3, C2 is practically a male only community, with 19 boys and 2 girls.

Having discussed the network as a whole, we now turn our attention to each group separately. For this study, we consider only the links within the groups and discard the reported friendships with students in other groups. The main feature observed at this level is a strong division by gender. For instance, consider group C (cf. Fig. 7 and tables in the Supplementary Information). The group is formed by 15 boys and 15 girls, and in wave 1 our community algorithm returns two communities, one with 12 boys and 5 girls, and another one with 10 girls and 3 boys. This division remains in wave 2, with only two students exchanging communities. However, when the groups are less gender-balanced, the situation becomes more complicated. Take one of the English-speaking groups, e.g. group A, with 20 girls and 9 boys. In wave 1, we find a community consisting of 11 girls and only 2 boys, whereas the other communities are better (or exactly) gender balanced. In wave 2, we again find three communities but now all of them are gender dominated: 12 girls and 0 boys, 3 girls and 8 boys, and 5 girls and 1 boy. As can be seen from the top panel of Fig. 7, the process has been quite complex, with a lot of students exchanging communities: if we look for instance at community C1 in wave 1, of its 13 original members only 5 remain in it, with two groups of 4 moving to the other two communities. This reinforces our interpretation of an evolution strongly dominated by gender homophily, but also suggests that the limits imposed by Dunbar’s circles are destabilizing the process of forming a unique, large cluster composed only by same gender children, making for a situation that is difficult to accommodate. The same is observed in the other groups, with the exception of group D, which in comparison turns out to be remarkably stable. Its 10 boy-1 girl, 9 boy-1 girl, and 9 girls only clusters almost do not not change between waves (again, with the exception of 3 students who exchange communities). We stress here that our algorithm is agnostic with respect to the number of communities it should produce, finding simply the best partition in terms of modularity (see Methods). Therefore, the fact that we never observe a cluster with more than 13 persons of the same gender in spite of the gender homophily bias, along with the intense dynamics of the communities, support the idea that other mechanisms, such as those behind the formation of Dunbar’s circles, are at work here.

These findings about the community structure must also be contrasted with the different types of evolution of the parameter $$\mu$$: in groups B and D, where the community structure is more stable, we observe that for a large percentage of the group their value of $$\mu$$ decreases, indicating that relationships with best friends (circle 1) are becoming more relevant. Conversely, in the other groups $$\mu$$ increases for practically all the students, in a manner consistent with the exploration of new personal networks and the restructuring of the communities. Thus, it appears that the evolution of $$\mu$$ might indeed be linked to structural properties of the groups. An important caveat is in order here, namely that Dunbar's circles refer to ego- or personal networks, the set of relationships of one person, whereas communities pertain to the realm of social networks, the set of all relationships among a set of people. Still, we believe that the connection we have suggested above makes sense in view of the fact that, as stated above, our networks are highly reciprocal, turning the clusters into something closer to cliques. In the limit of a perfect clique, everybody’s personal network would contain everybody else; with our percentage of reciprocity, personal networks in a cluster still contain most of the rest of the group and thus the Dunbar limits could have a say in their evolution.

There is an interesting analysis that reveals the key role played by the negative relationships, despite their relative small number, at the scale of the group. Figure 8 shows an example of the differences in the community structure of the network corresponding to group B in wave 1 with and without the negative links. We can see how communities C1 and C2 would merge together almost perfectly if the negative links did not exist. Given that the resulting community would contain 26 nodes compared to the 15 and 12 of the actual communities, one wonders if the existence of negative links is tied to the natural size of the sympathy network, so that it would be more likely for them to appear when the community exceeds its typical size. Another example of the same phenomenon is shown in the Supplementary Information (notice that in none of the groups or waves the opposite ever happens, i.e., there are never two communities in the network of only positive links that merge into one by inclusion of negative links). We note that contrary to what happens at the level of the whole network, by looking at relationships within single groups the results can not be understood in terms of us vs them or ingroup vs outgroup (or identity labels), thus leading to a more relevant role for the negative links. This suggestive hypothesis deserves further scrutiny.

Finally, a natural question about a network with positive and negative links is whether it satisfies social balance. The theory of social balance41,42,43,44, captured by the aphorism ‘my friend’s friend is my friend’, posits that triangles with an odd number of negative links create a cognitive dissonance that makes them unstable and prone to be ‘resolved’ into a more balanced configuration (by changing the sign or removing one link). A perfectly balanced network can be decomposed into two positive subnetworks joined by purely negative links42, 43. Under this strict definition of balance, no real network with positive and negative links is ever balanced—ours contain many unbalanced triangles. However, one can relax this condition by introducing a null model against which to test whether the number of unbalanced triangles can be considered relevant or not. The usual null model to test social balance in a network is obtained by randomly permuting the links belonging to some triangle without changing their signs. This test has been criticized though45, on the basis that positive and negative networks have very different properties—while the latter are essentially random, the former have structure. Thus, permuting both kinds of links can alter the nature of the network and overestimate imbalance. A less biased null model can be obtained if links are classified according to their embedding (number of triangles which they belong to) and only links with the same embedding are permuted45.

Our networks contain links of two intensities, which calls for an extension of the theory of social balance. However, negative links are too few to maintain such a distinction and still have statistical significance. Accordingly, for testing social balance we have ignored the intensity of links. Also, our links are directional and not always reciprocated. Even if they are, often the signs of the two directional links are different. We do not know why this happens, but the number of opposite-sign directional links is not negligible. In view of this, we have adopted two criteria to project our network onto a bidirectional network: (a) consider a negative link only if the interaction between a pair of nodes is negative in both directions, or (b) assuming that the presence of a single negative interaction between a pair of nodes is already an evidence of a conflict and also consider those cases as negative links. The number of triangles with 0 through 3 negative links is very different in both cases (see Table S11 of the Supplementary Information), but regardless of this, embedding-preserving permutations never produce configurations with fewer unbalanced triangles than the empirical network—as a matter of fact, except for very few cases, this number is actually larger (see Fig. 9). We then conclude that, even though the existence of negative links creates lots of unbalanced triangles, the configuration in which they appear is compatible with a very strong bias toward balance.

## Discussion

In this paper, we have studied the evolution of positive and negative relationships among students in a high school by looking at two waves of data collection separated by several months. In both surveys, we find evidence for a circle structure for positive friendships, similar to the one proposed by Dunbar, although the typical numbers for Dunbar’s circles are only found when looking at intra-group relationships. We suggest that this may come from the fact that students think differently of their intra-group and their inter-group relations. Importantly, and beyond the question of the circle sizes, our results show that when students have just arrived at the high school, their relationships are intense and with a limited number of classmates, i.e., they have a structure which resembles cliques involving typically 4–6 students. By the end of their first year in high school, the structure of their relationships has experienced a large change, with fewer intense friendships and more friendships in general, becoming more resemblant of a circle distribution. We have been able to precisely quantify this evolution by means of a parameter, $$\mu$$, that is obtained by a fit to the students’ reported answer. We find a very small number of reported negative relationships, which nevertheless increases from the first to the second wave.

As a way to gain further insight on the evolution of relationships, we have looked at the community structure of the whole social network both at the level of the five groups considered together and at the group level. The communities found from the analysis of the first wave are somewhat mixed, made up of both boys and girls, but they evolve so that in the second wave they appear to be largely segregated by gender. At the group level, the size of each community was stabilized around 12 people, which coincides with the size of the second Dunbar’s circle, known as sympathy group in social psychology. As a consequence, in classes with around 20 students of the same gender, their group split in two separate communities of about 10 each to stay below the second Dunbar’s circle. Interestingly, we have also observed that for this separation to arise in the community analysis it is necessary to include the negative relationships; otherwise, the analysis yields a unique community formed by almost all students of the same gender. Another relevant finding is that when the community structure is more stable, relationships with best friends intensify, and there is an evolution opposite to the general one of cliques relaxing to circles: more stable communities result in a decrease of the $$\mu$$ parameter and in an intensification of the focus on best friends (circle 1).

The existence of negative links puts the question of balance into play. The theory of social balance predicts that triangles with an odd number of negative links create a cognitive dissonance that renders them unstable and prone to disappear over time. Ideally, social networks should be free of unbalanced triangles. However, negative links are constantly being formed, so the question is not so much whether the network is free from those triangles as to whether they appear in a number that is significantly below what a null model would yield for that particular number of negative ties. We have run a recently proposed test whose null model takes into account the different nature of the positive and negative subnetworks, and have found that in one million realizations of the null model a network with fewer unbalanced triangles than the original network never shows up. This result forces us to conclude that there seems to be a strong tendency to reduced imbalance in middle-school classrooms.

Aside from their relevance towards understanding how we organize our relationships and how they evolve in time, which is particularly important in such a crucial age in development as early adolescence, we believe our results have practical implications about the school social network and atmosphere. Thus, we have observed that the co-existence of two working languages in the same high school leads to the splitting of the social network of the school in two groups with very little communication or very few positive connections. To avoid this, it would be important that the school direction would design some joint activities so that the students of both groups would get to know each other. Another very relevant finding is the instability associated to gender imbalance in the groups. In such a situation, the gender homophily typical of this age leads to tensions between all students of the majority gender wanting to be in the same community and the fact that there are limits to the number of friendships of a given intensity. In this case, we have seen that negative relationships appear that split the majority gender community in two, which could lead to increased polarization of the group atmosphere. Our results suggest that this is a problem that can be easily avoided by making gender balance a priority or else by reducing the group size (which may not be possible, like in public schools in the Madrid region whose group size is determined by the Regional Government). Another related measure would be to take this into account when forming groups in subsequent academic years, by separating students belonging to such gender-segregated communities in different classes to avoid perpetuating intra-group divisions. All these insights point to the fact that, beyond its very appealing interest from the scientific viewpoint, this kind of social network analysis is an efficient and easy to implement tool that can be used to foster a friendlier school environment which could also have connections with students’ performance.

## Methods

This study was approved by the Ethics Committee of Universidad Carlos III de Madrid, the institution responsible for funding the project, and the surveys were subsequently carried out in accordance with the approved guidelines. In particular, informed consent was obtained from both the participating students and their parents or legal tutors.

### Exploring social structure: the $$\mu$$ parameter

We explored the social structure for each individual following the model presented in Ref.20, which explains Dunbar’s circle structure as a result of allocating a finite cognitive resource among a certain number of links. According to the model, if layer k has $$l_k$$ links and an associated cost $$s_k$$, for each individual, the ratio of the number of links between consecutive layers is given by $$l_{k+1}/l_{k}=e^{\mu \left| \Delta s_k\right| }$$, where $$\left| \Delta s_k\right| =\left| s_{k+1}-s_k\right|$$ is the costs increment between consecutive. The assumption $$|\Delta s_k|=1$$ explains the constant proportionality between successive layers.20 We have considered only two intensity levels of relationship: $$k=1$$ (‘best friend’ for positive and ‘worst enemy’ for negative relationships), and $$k=2$$ (‘friend’ for positive and ‘enemy’ for negative relationships). Thus

\begin{aligned} \mu =\log \left( \frac{l_2}{l_1}\right) =\log \left( \frac{C_2-C_1}{C_1}\right) , \end{aligned}
(1)

$$C_i$$ being the number of links in clircle i. When a participant selects another student, a directed, weighted link is created. Its weight can be $$-2,-1,1,2$$ depending on whether the reported relationship is “worst enemy”, “enemy”, “friend”, “best friend”, respectively. In a few cases the same relation is reported simultaneously as “friend” and “best friend” or as “enemy” or “worst enemy”. In those cases the weight corresponds to the most intense one. In other few cases the relation is marked both, as positive and negative. To resolve this we have added the corresponding weights, removing the link if the resulting weight is zero. Once each link has a well-defined weight, the calculation of $$\mu$$ for positive ($$\mu ^+$$) and negative ($$\mu ^-$$) relationships is achieved using equation 1.

### Community detection

To solve the problem of community detection we use the modularity optimization method proposed by Newman 46, which allows us to determine how far is the studied network structure from a random distribution of the links. More specifically, in order to incorporate all the information collected from the student surveys, we make use of the most general definition of modularity Q, which considers the existence of directed, weighted and signed links 47. That is

\begin{aligned} Q=\frac{w^{+}}{w^{+}+|w^{-}|} Q^{+}-\frac{|w^{-}|}{w^{+}+|w^{-}|} Q^{-}, \end{aligned}
(2)

where $$w^+$$ and $$w^-$$ represent the total strength of positive and negative relationships, respectively. The construction of Q using both the positive ($$Q^+$$) and negative ($$Q^-$$) modularities implicitly involve the possibility of establishing signed links independently. Therefore, the total modularity represents the equilibrium between the inclination of positive relationships to build communities and the tendency of negative ones to break up them. For our particular case of study, links in the network can only take values $$\left\{ -2,-1,1,2 \right\}$$ depending on the relationship sign (enmity or friendship) and intensity.

The positive modularity $$Q^+$$ is defined as

\begin{aligned} Q^{+}=\frac{1}{2 w^{+}} \sum _{i,j}\left( w_{i j}^{+}-\frac{w_{i}^{+,out} w_{j}^{+,in}}{2 w^{+}}\right) \delta \left( C_{i}, C_{j}\right) , \end{aligned}
(3)

where $$w_{ij}^+$$ is the (ij) element of the positive weighted adjacency matrix and $$w_{i}^{+,out}$$ and $$w_{j}^{+,in}$$ are the outer and inner positive strengths associated to each node. $$C_{i}$$ represents the community which individual i belongs to, so the Kronecker delta $$\delta (C_i,C_j)$$ takes value 1 if both nodes share community and 0 otherwise. The negative modularity $$Q^-$$ is defined by an analogous expression to 3 but using the absolute values of the negative weights.

The optimization of modularity is a NP-hard problem, due to the number of possible combinations growing exponentially with the number of individuals. For this reason, we use a combination of heuristic algorithms (routines extremal, louvain, reposition, spectral, tabu, and fast from the software package Radatools, https://deim.urv.cat/~sergio.gomez/radatools.php) to find the best partition of the network into communities (the one which maximizes Q in equation 2).

## References

1. 1.

Dunbar, R. I. M. The anatomy of friendship. Trends Cog. Sci. 22, 32–51 (2017).

2. 2.

Demir, M. & Weitekamp, L. I am so happy ’cause today I found my friend: Friendship and personality as predictors of happiness. J. Happiness Stud. 8, 181–211 (2007).

3. 3.

Reblin, M. & Uchino, B. N. Social and emotional support and its implication for health. Curr. Opin. Psychiatry 21, 201–205 (2008).

4. 4.

Smith, K. P. & Christakis, N. A. Social networks and health. Am. J. Sociol. 34, 405–429 (2008).

5. 5.

Dominguez, S. & Arford, T. It is all about who you know: social capital and health in low-income communities. Health Sociol. Rev. 19, 114–129 (2010).

6. 6.

Jackson, M. O., Rodriguez-Barraquer, T. & Tan, X. Social capital and social quilts: network patterns of favor exchange. Am. Econ. Rev. 102, 1857–97 (2012).

7. 7.

Anderson, R. M. & May, R. M. Infectious Diseases of Humans: Dynamics and Control (Oxford University Press, 1991).

8. 8.

Read, J. M., Eames, K. T. & Edmunds, W. J. Dynamic social networks and the implications for the spread of infectious disease. J. R. Soc. Interface 5, 1001–1007 (2008).

9. 9.

López-Pintado, D. An overview of diffusion in complex networks. In: Complex Networks and Dynamics, Commendatore, P., Matilla-García, M., Varela, L.M., Cánovas, J.S. (Eds.), pp. 27–48. Springer (2016).

10. 10.

Jackson, M. O. The friendship paradox and systematic biases in perceptions and social norms. J. Polit. Econ. 127, 777–818 (2019).

11. 11.

Borgatti, S. P., Mehra, A., Brass, D. J. & Labianca, G. Network analysis in the social sciences. Science 323, 892–895 (2009).

12. 12.

McCarty, C., Lubbers, M., Vacca, R. & Molina, J. L. Conducting Personal Network Research: A Practical Guide (Guilford Press, 2019).

13. 13.

Hill, R. A. & Dunbar, R. I. M. Social network size in humans. Hum. Nat. 14, 53–72 (2003).

14. 14.

Roberts, S. B. G., Dunbar, R. I. M., Pollet, T. V. & Kuppens, T. Exploring variations in active network size: constraints and ego characteristics. Soc. Netw. 31, 138–146 (2009).

15. 15.

MacCarron, P., Kaski, K. & Dunbar, R. I. M. Calling Dunbar’s numbers. Soc. Netw. 47, 151–155 (2016).

16. 16.

Dunbar, R. I. M. Structure and function in human and primate social networks: implications for diffusion, network stability and health. Proc. R. Soc. A 476, 20200446 (2020).

17. 17.

Dunbar, R. I. M. & Spoors, M. Social networks, support cliques and kinship. Hum. Nat. 6, 273–290 (1995).

18. 18.

Sutcliffe, A. G., Dunbar, R. I. M., Binder, J. & Arrow, H. Relationships and the social brain: integrating psychological and evolutionary perspectives. Br. J. Psychol. 103, 149–168 (2012).

19. 19.

Buys, C. J. & Larsen, K. L. Human sympathy groups. Psychol. Rep. 45, 547–553 (1979).

20. 20.

Tamarit, I., Cuesta, J. A., Dunbar, R. I. M. & Sánchez, A. Cognitive resource allocation determines the organization of personal networks. Proc. Natl. Acad. Sci. USA 115, 8316–8321 (2018).

21. 21.

Holme, P. & Saramäki, J. Temporal networks. Phys. Rep. 519, 97–125 (2012).

22. 22.

Cattuto, C. et al. Dynamics of person-to-person interactions from distributed RFID sensor networks. PLOS ONE 5, (2010).

23. 23.

Stehlé, J. et al. High-resolution measurements of face-to-face contact patterns in a primary school. PLOS ONE 6, (2011).

24. 24.

Roberts, S. B. G. & Dunbar, R. I. M. The costs of family and friends: an 18-month longitudinal study of relationship maintenance and decay. Evol. Hum. Behav. 32, 186–197 (2011).

25. 25.

Sekara, V., Stopczynski, A. & Lehmann, S. Fundamental structures of dynamic social networks. Proc. Natl. Acad. Sci. USA 113, 9977–9982 (2016).

26. 26.

Dunbar, R. I. M. Coevolution of neocortex size, group size and language in humans. Behav. Brain Sci. 16, 681–735 (1993).

27. 27.

Bhattacharya, K., Ghosh, A., Monsivais, D., Dunbar, R. I. M. & Kaski, K. Gender differences in social focus across the life cycle in humans. R. Soc. Open Sci. 3, (2016).

28. 28.

Fung, H. H., Carstensen, L. L. & Lang, F. R. Age-related patterns in social networks among European Americans and African Americans: implications for socioemotional selectivity across the life span. Int. J. Aging Human Dev. 52, 185–206 (2001).

29. 29.

Carstensen, L. L. Selectivity theory: social activity in life- span context. Annu. Rev. Gerontol. Geriatr. 11, 195–217 (1991).

30. 30.

South, S. J. & Haynie, D. L. Friendship networks of mobile adolescents. Soc. Forces 83, 315–350 (2004).

31. 31.

Roberts, S. B. G. & Dunbar, R. I. M. Managing relationship decay: network, gender, and contextual effects. Hum Nat. 26, 426–45 (2015).

32. 32.

Liu, M. & Chen, X. Friendship networks and social, school and psychological adjustment in Chinese Junior High School students. Psychol. Schools 40, 5–17 (2003).

33. 33.

Guclu, H. et al. Social Contact Networks and Mixing among Students in K-12 Schools in Pittsburgh. PA. PLoS ONE 11, (2016).

34. 34.

Stadtfeld, C., Takács, K. & Vörös, A. The emergence and stability of groups in social networks. Soc. Netw. 60, 129–145 (2020).

35. 35.

Kucharski, A. J. et al. Structure and consistency of self-reported social contact networks in British secondary schools. PLOS ONE 13, (2018).

36. 36.

Fortunato, S. Community detection in graphs. Phys. Rep. 486, 75–174 (2010).

37. 37.

Granell, C., Gómez, S. & Arenas, A. Mesoscopic analysis of networks: Applications to exploratory analysis and data clustering. Chaos 21, (2011).

38. 38.

Jacomy, M., Venturini, T., Heymann, S. & Bastian, M. ForceAtlas2, a Continuous Graph Layout Algorithm for Handy Network Visualization Designed for the Gephi Software. PLoS ONE 9, (2014).

39. 39.

Almaatouq, A., L. Radaelli, L., Pentland, A., Shmueli, E. Are you your friends friend? poor perception of friendship ties limits the ability to promote behavioral change. PloS ONE 11, e0151588 (2016).

40. 40.

Huitsing, G. et al. Univariate and multivariate models of positive and negative networks: Liking, disliking, and bully-victim relationships. Soc. Netw. 34, 645–657 (2012).

41. 41.

Heider, F. Attitudes and cognitive organization. J. Psychol. 21, 107–112 (1946).

42. 42.

Cartwright, D. & Harary, F. Structural balance: a generalization of Heider’s theory. Psychol. Rev. 63, 277–293 (1956).

43. 43.

Harary, F. On the measurement of structural balance. Behav. Sci. 4, 316–323 (1959).

44. 44.

Taylor, H. F. Balance in Small Groups (Van Nostrand Reinhold, 1970).

45. 45.

Feng, D., Altmeyer, R., Stafford, D., Christakis, N. A. & Zhou, H. H. Testing for balance in social networks. J. Amer. Stat. Assoc. 1–19 (2020).

46. 46.

Newman, M.E.J. Analysis of weighted networks. Physical Review E 70, 056131(2004).

47. 47.

Gómez, S., Jensen, P. & Arenas, A. Analysis of community structure in networks of correlated data. Physical Review E 80, 016114(2009).

## Acknowledgements

We are very thankful to Miguel Ángel Villa, Pilar Pascual, Carmen Gonzalo and Silvia Ibáñez at IES Blas de Otero for their invaluable help in carrying out the research and the informative discussions of the results. We are grateful to the students participating in the study and their families for their collaboration. We are also thankful to Jesús Herrera for his help in carrying out the surveys and with the survey software. This research has been funded by the Spanish Ministerio de Ciencia, Innovación y Universidades-FEDER funds of the European Union support, under project BASIC (PGC2018-098186-B-I00) and by the Comunidad de Madrid under projects PRACTICO-CM and CAVTIONS-CM-UC3M (the latter co-funded by Universidad Carlos III de Madrid).

## Author information

Authors

### Contributions

J.A.C. and A.S. conceived the experiment(s), D.E., F.J.L., J.A.C. and A.S. conducted the experiment(s), D.E. and V.D.-M. analyzed the results, and all authors discussed the results and wrote and reviewed the manuscript.

### Corresponding author

Correspondence to Angel Sánchez.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

Escribano, D., Doldán-Martelli, V., Lapuente, F.J. et al. Evolution of social relationships between first-year students at middle school: from cliques to circles. Sci Rep 11, 11694 (2021). https://doi.org/10.1038/s41598-021-90984-z

• Accepted:

• Published:


text:
# Photon energy and frequency relationship

### Photon energy - Wikipedia

It is proposed a photon energy-frequency relation $$E = h \nu/2$$ is necessary for wavelength and frequency to energy relationships. The. Photon energy is the energy carried by a single photon. The amount of energy is directly proportional to the photon's electromagnetic frequency and inversely proportional to the wavelength. The higher the photon's frequency, the higher its energy. where f is frequency, the photon energy equation can be simplified to. I read in a book the following paragraph and there was no explanation: "The emission is a great flood of photons, their energy increases when their frequency .

So there's a photon, here's another photon. Basically, this is the problem. This is the main problem with wave particle duality, it's called.

The fact that light, and everything else, for that matter, can behave in a way that shows wavelike characteristics, it can show particle-like characteristics, there's no classical analog of this. We can't envision in our minds anything that we've ever seen that can do this, that can both behave like a wave and a particle.

So it's impossible, basically, to draw some sort of visual representation, but, you know, it's always good to draw something. So we draw our photons like this. And so, what I'm really saying here is, if you had a detector sitting over here that could measure the light energy that it receives from some source of light, what I'm saying is, if that detector was sensitive enough, you'd either get no light energy or one jump, or no light energy or, whoop, you absorbed another photon.

You couldn't get in between. If the quantum jump was three units of energy I don't want to give you a specific unit yet, but, say, three units of energy you could absorb, if that was the amount of energy for that photon, if these photons were carrying three units of energy, you could either absorb no energy whatsoever or you could absorb all three. You can't absorb half of it. You can't absorb one unit of energy or two units of energy. You could either absorb the whole thing or nothing.

That's why it's quantum mechanics. You get this discrete behavior of light depositing all its energy in a particle-like way, or nothing at all. Well, we've got a formula for that. The amount of energy in one photon is determined by this formula. And the first thing in it is Planck's constant. H is the letter we use for Planck's constant, and times f. It's a simple formula. F is the frequency.

Wavelength frequency and energy

What is Planck's constant? Well, Planck was basically the father of quantum mechanics. Planck was the first one to figure out what this constant was and to propose that light can only deposit its energy in discrete amounts. So Planck's constant is extremely small; it's 6. There aren't many other numbers in physics that small. Times the frequency -- this is regular frequency.

So frequency, number of oscillations per second, measured in hertz. So now we can try to figure out, why did physicists never discover this before?

And the reason is, Planck's constant is so small that the energy of these photons are extremely small. The graininess of this discrete amount of energy that's getting deposited is so small that it just looks smooth. You can't tell that there's a smallest amount, or at least it's very hard to tell. So instead of just saying 'three units,' let's get specific. For violet light, what's the energy of one violet photon? Well, the frequency of violet light is 7.

So if you take that number times this Planck's constant, 6. Five times ten to the negative 19th, that's extremely small. That's hard to see. That's hard to notice, that energy's coming in this discrete amount. I mean, water from your sink. Water flowing out of your sink looks continuous. We know there's really discrete water molecules in there, and that you can only get one water molecule, no water molecules, 10 water molecules, discrete amounts of these water molecules, but there's so many of them and they're so small, it's hard to tell that it's not just completely continuous.

The same is happening with this light. This energy's extremely small. Each violet photon has an extremely small amount of energy that it contributes. In fact, if you wanted to know how small it is, a baseball, a professional baseball player, throwing a ball fast, you know, it's about joules of energy.

If you wanted to know how many of these photons, how many of these violet photons would it take to equal the energy of one baseball thrown at major league speed?

It would take about two million trillion of these photons to equal the energy in a baseball that's thrown. That's why we don't see this on a macroscopic scale.

### Photons - Chemistry LibreTexts

The wavelength is defined as the distance between two peaks of the electric field with the same vector. The frequency of a photon is defined as how many wavelengths a photon propagates each second.

Unlike an electromagnetic wave, a photon cannot actually be of a color. Instead, a photon will correspond to light of a given color. As color is defined by the capabilities of the human eye, a single photon cannot have color because it cannot be detected by the human eye.

In order for the retina to detect and register light of a given color, several photons must act on it. Only when many photons act in unison on the retina, as an electromagnetic wave, can color be perceived. As Described by Maxwell's Equations The most accurate descriptions we have about the nature of photons are given by Maxwell's equations.

Maxwell's equations mathematically predict how photons move through space. Fundamentally, an electric field undergoing flux will create an orthogonal magnetic field. The flux of the magnetic field then recreates the electric field. The creation and destruction of each corresponding wave allows the wave pair to move through space at the speed of light.

Maxwell's equations correctly describe the nature of individual photons within the framework of quantum dynamics. Creation of Photons Photons can be generated in many different ways. This section will discuss some of the ways photons may be emitted. As photons are electric field propagating through space, the emission of photons requires the movement of charged particles.

Blackbody Radiation As a substance is heated, the atoms within it vibrate at higher energies. These vibrations rapidly change the shape and energies of electron orbitals. Blackbody radiation is what causes light bulbs to glow, and the heat of an object to be felt from a great distance.

The simplification of objects as blackbodies allows indirect temperature calculation of distant objects. Astronomers and kitchen infrared thermometers use this principle every day.

## Photon energy

The technical term for this drop in energy is a relaxation. Electrons undergoing this type of emission will produce a very distinctive set of photons based on the available energy levels of their environment. This set of possible photons is the basis for an emission spectrum.

Flourescence Florescence is special case of spontaneous emission. In florescence, the energy of a photon emitted does not match the energy used to excite the electron. An electron will fluoresce when it loses a considerable amount of energy to its surroundings before undergoing a relaxation. Generally florescence is employed in a laboratory setting to visualize the presence of target molecules. UV light is used to excite electrons, which then emit light at visible wavelengths that researchers can see.

Stimulated Emission An excited electron can be artificially caused to relax to a lower energy state by a photon matching the difference between these energy states. The electric field's phase and orientation of the resultant photon, as well as its energy and direction will be identical to that of the incident photon. The light produced by stimulated emission is said to be coherent as it is similar in every way to the photon that caused it. Lasers produce coherent electromagnetic radiation by stimulated emission.

Synchrotrons electron bending Electrons with extremely high kinetic energy, such as those in particle accelerators, will produce high energy photons when their path is altered. This alteration is accomplished by a strong magnetic field.

All free electrons will emit light in this manner, but synchrotron radiation has special practical implications. Synchrotron radiation is currently the best technology available for producing directional x-ray radiation at precise frequencies. Nuclear Decay Certain types of radioactive decay can involve the release of high energy photons.

One such type of decay is a nuclear isomerization. In an isomerization, a nucleus rearranges itself to a more stable configuration and emits a gamma ray. While it is only theorized to occur, proton decay will also emit extremely high energy photons. The Photoelectric Effect Light incident on a metal plate may cause electrons to break loose from the plate surface Fig. This interaction between light and electrons is called the photoelectric effect.

The photoelectric effect provided the first conclusive evidence that beams of light was made of quantized particles. As metals generally have ionization energies of several electron-volts, the photoelectric effect is generally observed using visible light or light of even higher energy. At the time this phenomenon was studied, light was thought to travel in waves.

Einstein later explained this difference by showing that light was comprised of quantized packets of energy called photons.

### HubbleSite - Reference Desk - FAQs

His work on the photoelectric effect earned him the Nobel Prize. The photoelectric effect has many practical applications, as current may be generated from a light source.

Generally, the photoelectric effect is used as a component in switches that respond to light. Some examples are nightlights and photomultipliers.

format: plain


text:
# Answer: In which category did Albert Einstein win a Nobel Prize?

The Question: In which category did Albert Einstein win a Nobel Prize?

Physics)
Chemistry)
Medicine)
Peace


text:
# Small question about maxwell's equation curl of H

The first page of this short pdf from MIT sums the starting point to formulate my question:
https://ocw.mit.edu/courses/physics...gnetism-fall-2006/lecture-notes/lecture29.pdf

We can see that
∇xH = Jfree
and
∇xB o (Jfree +∇xM)
∇xB o (Jfree +JB)

And now my question is, if KB ≠ 0 , how I can't see its contribution to B in the last equation?
I have been solving problems in class and in them it appears a contribution to B , after using the curl theorem, like this
∫KB·dl

jtbell
Mentor
I assume that by ##\vec K_B## you mean the bound surface currents on a magnetized material. These are a subset of the bound current density ##\vec J_B##, namely the bound currents that lie on the surface of the material (idealized as an infinitesimally thin sheet) rather than being distributed through the volume of its interior.

Mathematically I think you might incorporate ##\vec K_B## into the last equation by multiplying it by a Dirac delta function that represents the surface, thereby converting it to a volume current density.

Homework Helper
Gold Member
The evaluation of ## \nabla \times \vec{M} ## includes surface currents, and, as by Stokes theorem, the discontinuity in ## \vec{M} ## at the boundary results in a surface current per unit length ## \vec{K}_m=\vec{M} \times \hat{n} ##, that comes from ## \nabla \times \vec{M}=\vec{J}_m ##. ## \\ ## Basically, this derivation, (of ## \nabla \times \vec{H}=\vec{J}_{free} ##), starts with ## \vec{B}=\mu_o (\vec{H}+\vec{M}) ##, and you take the curl of both sides. The derivation of the equation ## \vec{B}=\mu_o (\vec{H}+\vec{M}) ## can be somewhat lengthy, and the derivation is often omitted in many E&M textbooks. They like to use the analogous electrostatic equation ## \vec{D}=\epsilon_o \vec{E} +\vec{P} ##, to justify it.

Last edited:
Thank's both, and sorry for replying late. I thing I understood the general idea of your replies but for the moment Im going to look up in the bibliography the said discontinuity at the boundary.


text:
# Bibliography

Export 1 results:
Author Title Type [ Year]
Filters: Keyword is host-independent  [Clear All Filters]
2001
. Tangler: a censorship-resistant publishing system based on document entanglements. In: Proceedings of the 8th ACM Conference on Computer and Communications Security (CCS 2001). Proceedings of the 8th ACM Conference on Computer and Communications Security (CCS 2001). ; 2001. pp. 126–135. Available from: http://portal.acm.org/citation.cfm?id=501983.502002&coll=GUIDE&dl=GUIDE&type=series&idx=SERIES320&part=series&WantType=Proceedings&title=CCS&CFID=75729899&CFTOKEN=36385677


text:
# Efamol Efalex Brain Booster Kids

by Efamol
\$47.99
Size

### Description & Features

Help your kids to bridge the learning gap and give them the boost they may need to succeed in school, and beyond, with the help of the unique blend of long-chain Essential Fatty Acids (EFAs) in clinically-proven Efamol Efalex. The EFAs in Efalex help support your child’s cognitive health and brain function. This delicious lemon and lime flavoured liquid also helps support the development of the brain, eyes, and nerves in children up to 12 years of age. Efamol Efalex may just be the recipe for success needed to help your kids meet their goals and reach their dreams.

Ingredients:
Per 5ml (1 teaspoon)
Efamol Evening Primrose Oil . . . . . . . . . . . . . . . . . . . . . . . . . . . .213 mg
Tuna Oil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 mg
Eicosapentaenoic acid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 mg
Gamma-Linolenic Acid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 mg
Docosahexaenoic Acid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 mg
Arachidonic Acid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 mg

Non-Medicinal Ingredients:
Sunflower oil, lemon oil, dl-alpha tocopheryl acetate, natural lime flavour, dl-alpha tocopherol, thyme oil.
Dosage: Adults and children (5 years+): Taking the product for the first time, for the first 12 weeks, take 2 teaspoons 2 times daily (once in the morning and once in the afternoon) with food. Thereafter, take 2 teaspoons once daily with food.

### You recently viewed

Clear recently viewed


text:
# Norman invasion of Malta

Norman invasion of Malta
Part of the Norman conquest of southern Italy

A possible reconstruction of medieval Medina (model by Richard Azzopardi and Stephen C. Spiteri, displayed at the Fortifications Interpretation Centre)
Date June or July 1091 Malta Norman victory
Belligerents
County of Sicily Muslims of Malta
Roger I of Sicily Unknown
Casualties and losses
Unknown Some killed

The Norman invasion of Malta was an attack on the island of Malta, then inhabited predominantly by Muslims, by forces of the Norman County of Sicily led by Roger I in 1091. The invaders besieged Medina (modern Mdina), the main settlement on the island, but the inhabitants managed to negotiate peace terms. The Muslims freed Christian captives, swore an oath of loyalty to Roger and paid him an annual tribute. Roger's army then sacked Gozo and returned to Sicily with the freed captives.

The attack did not bring about any major political change, but it paved the way for the re-Christianization of Malta, which began in 1127. Over the centuries, the invasion of 1091 was romanticized as the liberation of Christian Malta from Muslim rule, and a number of traditions and legends arose from it, such as the unlikely claim that Count Roger gave his colours red and white to the Maltese as their national colours.

## Background

The Norman conquest of southern Italy began in around the beginning of the 11th century. The conquest of Sicily was complete by 1091, with the fall of the last Muslim stronghold of Noto. Their location off the coast of Sicily made the Maltese Islands a natural target for Norman expansion to conclude the conquest of Sicily.[1] Plans to attack Malta had been made by Robert Guiscard as early as 1072.[2]

At the time, Malta was primarily inhabited by Muslims. According to Al-Himyarī, the island had been depopulated following an Aghlabid attack in 870 AD and it was repopulated by a Muslim community in 1048–49. Archaeological evidence suggests that Medina was a thriving Muslim settlement by the beginning of the 11th century, so 1048–49 might be the date when the city was officially founded and its walls were constructed.[3] It is possible that the Muslims who inhabited Malta were refugees who had fled Sicily due to the Arab–Byzantine wars.[4] The Byzantines made an unsuccessful attempt to recapture Malta in 1053–54.[5]

## Invasion and aftermath

The Norman fleet led by Count Roger I left Cape Scalambri in Sicily in June[6] or July[2] 1091 and arrived in Malta within two days. Roger's eldest son, Jordan of Hauteville, had wanted to command the expedition against Malta but Roger decided to go in person, possibly because he feared that his son might defect to the Muslims.[2] Roger's ship arrived first since it was faster than the others, and he initially disembarked with thirteen knights. The inhabitants offered some resistance to the invaders, but some were killed and the rest fled. Count Roger went after some of those who fled, and returned to the landing point later that day. By then the entire army had disembarked and was encamped on the shoreline.[1]

At daybreak on the next day, Roger and his army marched to the island's capital, Medina, and besieged it. The ruler of the city and its inhabitants were reportedly terrified at the invading army, and asked to meet the Count to discuss peace terms. They freed all the Christian prisoners, and gave horses, mules, all their weapons and a sum of money to the Normans. They also agreed to swear an oath of loyalty to Roger and pay an annual tribute.[1]

The Christian captives reportedly rejoiced at their freedom, and they held wooden or reed crosses, sang Kyrie eleison and flung themselves at Roger's feet. The Christians embarked on Roger's ships, and eventually they went to Sicily. On the way, the Normans invaded and sacked Malta's sister island, Gozo. Upon arrival on Sicily, Roger offered to build a settlement known as "Villafranca" (free village) for the freed captives, which would be exempt from taxation. Those who chose to return to their homes were offered free passage through the Straits of Messina.[1]

In 1192, Tancred of Sicily appointed Margaritus of Brindisi the first Count of Malta, perhaps for his unexpected success in capturing Empress Constance contender to the throne. In 1194 Henry VI, Holy Roman Emperor husband of Constance conquered Kingdom of Sicily, thus the county of Margaritus was forfeited.

## Analysis

The most reliable near-contemporary source regarding the Norman invasion of Malta is an account by the 11th-century historian Goffredo Malaterra.[1] This highly acclaims the actions of Count Roger. In later centuries, the Norman invasion was romanticized into a tale where Roger liberated the Christians of Malta from oppressive Muslim rule, and this concept entered Maltese tradition and folklore. The idea of a surviving Maltese Christian population throughout the period of Muslim rule was promoted by the 17th-century historian Giovanni Francesco Abela. There is no evidence of a surviving indigenous Christian population,[6] although this has been disputed and there is very little evidence from the period of 870–1091 in general.[7] It is believed that the Christian captives freed in 1091 were not indigenous Maltese or Sicilians, but were possibly from Italy or elsewhere in Europe.[8]

Historical coat of arms of the Hauteville family (left) and the modern flag of Malta (right). The tradition that the colours of the latter originate from the Norman invasion seems to have been a 19th-century invention.

By the 19th century, a number of unsourced "details" had been gradually added by different authors into accounts of the Norman invasion. These include speculation that some Maltese assisted the Normans in their attack against the Muslims, and that Roger allowed the Arabs to remain in Malta and continue to practice their religion. Some accounts stated that after the invasion Roger established a popular council and gave laws and privileges to the Maltese. Roger was also credited with granting the colours of the Hauteville family – red and white – to the Maltese as their coat of arms and national colours. This attribution seems to originate from a pamphlet dated 1841. Today, red and white form the basis of the flag and coat of arms of Malta, but the claim that the colours originate from the 1091 invasion is unsubstantiated and unlikely.[6][9]

Local traditions and legends related a number of places around Malta to the Norman invasion. Miġra l-Ferħa, a small inlet near Mtaħleb on the western coast of Malta, is said to have been the place where Roger and his army landed. Ferħ means "joy" in Maltese, and it was eventually thought that the place name originated from the welcoming of the Count. In reality, the inlet would not have been suitable for a landing, since it can only accommodate two or three ships and is unsafe. Wied ir-Rum (Valley of the Christians), located west of Mdina, also became identified as a place where Maltese Christians lived during the period of Muslim rule, and where the Maltese met before welcoming Count Roger.[9]

Today, the Norman invasion is regarded as little more than a razzia (raid), and not as an attempt to establish a permanent occupation of the islands.[6] However, it did pave the way[how?] for the Christianization and Latinization of Malta, and it left a profound cultural impact on the Maltese in later centuries.[7] The establishment of a Christian regime on Malta only occurred after another invasion by Count Roger's son, King Roger II of Sicily, in 1127. At this point, Christian settlers arrived in Malta, including administrators, garrison members, traders and clergy. Their languages merged with the Siculo-Arabic dialect spoken by the Muslim population, eventually evolving into the Maltese language. This brought about the Christianization of Malta, although Islam survived in the islands until around 1250.[6]

The invasion was formerly thought to have occurred in the year 1090,[10] but it is now believed to have occurred in 1091.[6]

## References

1. McDonald, Neil (2016). Malta & Gozo – A Megalithic Journey. Megalithic Publishing. pp. 67–72. ISBN 9781326598358.
2. ^ a b c Dalli, Charles (2005). "The Siculo-African Peace and Roger I's Annexation of Malta in 1091". In Cortis, Toni; Gambin, Timothy (eds.). De Triremibus: Festschrift in honour of Joseph Muscat (PDF). Publishers Enterprises Group (PEG) Ltd. p. 273. ISBN 9789990904093. Archived from the original (PDF) on 2 January 2018.
3. ^ Blouet, Brian W. (2007). The Story of Malta. Allied Publications. p. 41. ISBN 9789990930818.
4. ^ Cassar, Carmel (2000). A Concise History of Malta. Msida: Mireva Publications. p. 59. ISBN 1870579526.
5. ^ Brincat, Joseph M. (1995). "Malta 870–1054 Al-Himyari's Account and its Linguistic Implications" (PDF). Valletta: Said International: 1–52. Archived from the original (PDF) on 6 June 2015. Cite journal requires |journal=
6. Wettinger, Godfrey (1995). "The 'Norman' Heritage of Malta : GODFREY WETTINGER sifts the evidence surrounding Count Roger's visit in 1091" (PDF). Treasures of Malta. 1 (3): 34–39. Archived from the original (PDF) on 8 December 2017.
7. ^ a b Brincat, M. (11 February 1990). "Christianity in Malta under the Arabs" (PDF). The Sunday Times. Archived from the original (PDF) on 27 March 2017.
8. ^ Luttrell, Anthony (1992). "Slaves and Captives on Malta: 1053/4 and 1091" (PDF). Hyphen: A Journal of Melitensia and the Humanities. 7: 97–104. Archived from the original (PDF) on 26 March 2017.
9. ^ a b Cassar Pullicino, Joseph (October–December 1945). "Norman legends in Malta" (PDF). Scientia. 11 (4): 152–165. Archived from the original (PDF) on 26 March 2017.
10. ^ Castillo, Dennis Angelo (2006). The Maltese Cross: A Strategic History of Malta. Greenwood Publishing Group. p. 30. ISBN 9780313323294.

This page was last updated at 2020-10-06 04:27 UTC. . View original page.

All our content comes from Wikipedia and under the Creative Commons Attribution-ShareAlike License.

Contact

Top


text:
# Place chapter heading in margin

I'm using the memoir class.

I would like the \chapter{xxx} command to place the chapter heading in the margin instead of above the text. Like this:

This question is somewhat similar, but in that question the person wanted the chapter title in the margin of every page. My request is simpler (I hope). I want the chapter title in the margin of the first page instead of above the text.

Do I need to use a similar complex mechanism, or is there a simpler way to achieve what I want?

• Will a new chapter always begin at the top of a page? Another way of asking this is "what document class are you intending to use?" – Steven B. Segletes Jun 18 '14 at 13:47
• Yes, a chapter always starts a new page. (The default for the memoir class, I believe.) – oz1cz Jun 18 '14 at 13:48
• Will the title always be short? From your example, it does not take much before it runs out of space. – daleif Jun 18 '14 at 13:58
• @daleif, In my case, there will always be room for the title on a single (vertical) line. – oz1cz Jun 18 '14 at 14:00
• is the width of the text block the same on all pages, or is it narrowed for the first page of a chapter to accommodate the title? – barbara beeton Jun 18 '14 at 14:16

Here is something that might be used as a building block so see it as a proof of concept.

\documentclass[a4paper]{memoir}
\usepackage{kantlipsum,graphicx}

% picture syntax with std units
\usepackage{picture,calc,xcolor}

\usepackage{eso-pic}

\makeatletter

\makechapterstyle{hmm}{%
\renewcommand\printchaptername{}
\renewcommand\printchapternum{}
\renewcommand\afterchapternum{}
\renewcommand\printchapternonum{}
\renewcommand\chaptitlefont{\normalfont\Large\bfseries\sffamily}
\renewcommand\printchaptertitle[1]{%
\begingroup%
\put(\paperwidth-\foremargin+15mm,
\paperheight-\textheight-\uppermargin
){\rotatebox{90}{\parbox[t]{\textheight}{%
\makebox[\textheight-\topsep][l]{\hfill
\chaptitlefont
\@chapapp~\thechapter\ --
##1}
}%
}%
}%
}%
\endgroup%
}
\renewcommand\afterchaptertitle{}
}
\chapterstyle{hmm}
\makeatother

\begin{document}

\chapter{Lorem Ipsum}

\kant

\end{document}

• That looks very promising, @daleif. I can probably get this to work with my document. (I'll just wait a few hours before I acknowledge this as an answer.) – oz1cz Jun 18 '14 at 14:37
• I successfully got this to work with my document. Wonderful. Thank you very much. – oz1cz Jun 18 '14 at 15:43


text:
# The Non-parametric Bootstrap as a Bayesian Model

The non-parametric bootstrap was my first love. I was lost in a muddy swamp of zs, ts and ps when I first saw her. Conceptually beautiful, simple to implement, easy to understand (I thought back then, at least). And when she whispered in my ear, “I make no assumptions regarding the underlying distribution”, I was in love. This love lasted roughly a year, but the more I learned about statistical modeling, especially the Bayesian kind, the more suspect I found the bootstrap. It is most often explained as a procedure, not a model, but what are you actually assuming when you “sample with replacement”? And what is the underlying model?

Still, the bootstrap produces something that looks very much like draws from a posterior and there are papers comparing the bootstrap to Bayesian models (for example, Alfaro et al., 2003). Some also wonder which alternative is more appropriate: Bayes or bootstrap? But these are not opposing alternatives, because the non-parametric bootstrap is a Bayesian model.

In this post I will show how the classical non-parametric bootstrap of Efron (1979) can be viewed as a Bayesian model. I will start by introducing the so-called Bayesian bootstrap and then I will show three ways the classical bootstrap can be considered a special case of the Bayesian bootstrap. So basically this post is just a rehash of Rubin’s The Bayesian Bootstrap from 1981. Some points before we start:

• Just because the bootstrap is a Bayesian model doesn’t mean it’s not also a frequentist model. It’s just different points of view.

• Just because it’s Bayesian doesn’t necessarily mean it’s any good. “We used a Bayesian model” is as much a quality assurance as “we used probability to calculate something”. However, writing out a statistical method as a Bayesian model can help you understand when that method could work well and how it can be made better (it sure helps me!).

• Just because the bootstrap is sometimes presented as making almost no assumptions, doesn’t mean it does. Both the classical non-parametric bootstrap and the Bayesian bootstrap make very strong assumptions which can be pretty sensible and/or weird depending on the situation.

# A Speed Comparison Between Flexible Linear Regression Alternatives in R

Everybody loves speed comparisons! Is R faster than Python? Is dplyr faster than data.table? Is STAN faster than JAGS? It has been said that speed comparisons are utterly meaningless, and in general I agree, especially when you are comparing apples and oranges which is what I’m going to do here. I’m going to compare a couple of alternatives to lm(), that can be used to run linear regressions in R, but that are more general than lm(). One reason for doing this was to see how much performance you’d loose if you would use one of these tools to run a linear regression (even if you could have used lm()). But as speed comparisons are utterly meaningless, my main reason for blogging about this is just to highlight a couple of tools you can use when you grown out of lm(). The speed comparison was just to lure you in. Let’s run!

# Wrapping up Bayes@Lund 2015

For the second year round I and Ullrika Sahlin arranged the mini-conference Bayes@Lund, with the aim of bringing together researchers in the south of Sweden working with Bayesian methods. This year the committee was also beefed up by Paul Caplat and Krzysztof Podgorski. What originally made me and Ullrika start this get-together is our feeling that Lund University is lagging behind with regards to Bayesian methods (we don’t have a single introductory course on Bayes stats!) and that we need a venue where people doing Bayes can meet and discuss what cool stuff they are working on. And so, last Tuesday, over 60 researchers got together to listen to twelve interesting talks, discuss, and (not least) fika. Here follows some highlights from Bayes@Lund 2015.

# Probable Points and Credible Intervals, Part 2: Decision Theory

“Behind every great point estimate stands a minimized loss function.” – Me, just now

This is a continuation of Probable Points and Credible Intervals, a series of posts on Bayesian point and interval estimates. In Part 1 we looked at these estimates as graphical summaries, useful when it’s difficult to plot the whole posterior in good way. Here I’ll instead look at points and intervals from a decision theoretical perspective, in my opinion the conceptually cleanest way of characterizing what these constructs are.

If you don’t know that much about Bayesian decision theory, just chillax. When doing Bayesian data analysis you get it “pretty much for free” as esteemed statistician Andrew Gelman puts it. He then adds that it’s “not quite right because it can take effort to define a reasonable utility function.” Well, perhaps not free, but it is still relatively straight forward! I will use a toy problem to illustrate how Bayesian decision theory can be used to produce point estimates and intervals. The problem is this: Our favorite droid has gone missing and we desperately want to find him!

# Peter Norvig’s Spell Checker in Two Lines of Base R

Peter Norvig, the director of research at Google, wrote a nice essay on How to Write a Spelling Corrector a couple of years ago. That essay explains and implements a simple but effective spelling correction function in just 21 lines of Python. Highly recommended reading! I was wondering how many lines it would take to write something similar in base R. Turns out you can do it in (at least) two pretty obfuscated lines:

While not working exactly as Norvig’s version it should result in similar spelling corrections:

So let’s deobfuscate the two-liner slightly (however, the code below might not make sense if you don’t read Norvig’s essay first):

# Eight Christmas Gift Ideas for the Statistically Interested

### 1. Games of probability

A recently released game where probability takes the main role is Pairs, an easy going press-your-luck game that can be played in 10 minutes. It uses a custom “triangular” deck of cards (1x1, 2x2, 3x3, …, 10x10) and is a lot of fun to play, highly recommended!

Another good gift would be a pound of assorted dice together with the seminal Dice Games Properly Explained by Reiner Knizia. While perhaps not a game, a cool gift to someone that already has a pound of dice would be a set of Non transitive Grime dice.

# How to Summarize a 2D Posterior Using a Highest Density Ellipse

Making a slight digression from last month’s Probable Points and Credible Intervals here is how to summarize a 2D posterior density using a highest density ellipse. This is a straight forward extension of the highest density interval to the situation where you have a two-dimensional posterior (say, represented as a two column matrix of samples) and you want to visualize what region, containing a given proportion of the probability, that has the most probable parameter combinations. So let’s first have a look at a fictional 2D posterior by using a simple scatter plot:

Whoa… that’s some serious over-plotting and it’s hard to see what’s going on. Sure, the bulk of the posterior is somewhere in that black hole, but where exactly and how much of it?

# Tidbits from the Books that Defined S (and R)

Why R? Because S!

R is the open source implementation (and a pun!) of S, a language for statistical computing that was developed at Bell Labs in the late 1970s. After that, the implementation of S underwent a number of major revisions documented in a series of seminal books, often just referred to by the color of their cover: The Brown Book, the Blue Book, the White Book and the Green Book. To satisfy my techno-historical lusts I recently acquired all these books and I though I would share some tidbits from them, highlighting how S (and thus R) developed into what we today love and cherish. But first, here are the books in chronological order from left to right:

# Probable Points and Credible Intervals, Part 1: Graphical Summaries

After having broken the Bayesian eggs and prepared your model in your statistical kitchen the main dish is the posterior. The posterior is the posterior is the posterior, given the model and the data it contains all the information you need and anything else will be a little bit less nourishing. However, taking in the posterior in one gulp can be a bit difficult, in all but the most simple cases it will be multidimensional and difficult to plot. But even if it is one-dimensional and you could plot it (as, say, a density plot) that does not necessary mean that it is easy to see what’s going on.

One way of getting around this is to take a bite at a time and look at summaries of the marginal posteriors of the variables of interest, the two most common type of summaries being point estimates and credible intervals (an interval that covers a certain percentage of the probability distribution). Here one is faced with a choice, which of the many ways of constructing point estimates and credible intervals to choose? This is a perfectly good question that can be given an unhelpful answer (with a predictable follow-up question):

- That depends on your loss function.
- So which loss function should I use?

# Tiny Data, Approximate Bayesian Computation and the Socks of Karl Broman

Big data is all the rage, but sometimes you don’t have big data. Sometimes you don’t even have average size data. Sometimes you only have eleven unique socks:

Karl Broman is here putting forward a very interesting problem. Interesting, not only because it involves socks, but because it involves what I would like to call Tiny Data™. The problem is this: Given the Tiny dataset of eleven unique socks, how many socks does Karl Broman have in his laundry in total?

If we had Big Data we might have been able to use some clever machine learning algorithm to solve this problem such as bootstrap aggregated neural networks. But we don’t have Big Data, we have Tiny Data. We can’t pull ourselves up by our bootstraps because we only have socks (eleven to be precise). Instead we will have to build a statistical model that includes a lot more problem specific information. Let’s do that!


text:
The goal here was to get the basic shaders to work, in order to do this I had to learn a little about shaders (which I found semi non-intuitive and the documentation is poor at best).

### Algorithm

• Create a renderTarget with a depth and color buffer
• Create your shapes and color index assignments into the palette
• Each iteration
• Clear the buffer
• Update your world state -draw the render target to the screen

The shader looks at each pixel matches its color against the palette, does the mod math from C01_ColorStudy_AddingIndex and C02_ColorStudy_2dcity and then outputs the new color to that pixel. See sketches/C01_ColorStudy_AddingIndex#The Wrapped Color Palette Math for details on the color palette

Take the current color buffer state for the render target (the current image) as a texture. Then within that texture find where the present fragment is. After that we can modify the state by returning a new color for that fragment.

Shaders in OpenRNDR use a combination of GLSL (OpenGLs Shader language) and a few conventions around making fragment and vertex shaders. Vertex shaders basically determine how shape vertexes and triangles get mapped to the final displayed image. Fragment or pixel shaders, determine how the individual pixels are rendered.

To get this to work I created the following class which implements a fragment shader shadeStyle:

open class ShaderColorPaletteModMath(
colorBuffer: ColorBuffer,
width: Int,
height: Int,
colorIdx: Int,
palette: BasePalette

var colorBuffer: ColorBuffer by Parameter()
var width: Double by Parameter()
var height: Double by Parameter()
var colorIdx: Int by Parameter()
var palette: Array<Vector4> by Parameter()

init {
this.colorBuffer = colorBuffer
this.width = width.toDouble()
this.height = height.toDouble()
this.colorIdx = colorIdx
this.palette = palette.toVector4Array()

fragmentTransform = """
vec2 invSize = vec2(1/p_width, 1/p_height);
// Reflect the axis so that the upper left hand corner is 0,0
vec2 coord = vec2(0,1) - c_screenPosition.xy*invSize * vec2(-1,1);

// Load the current screen state as a 2d texture
vec4 c = texture2D(p_colorBuffer, coord);

// find the color index represented by the current color, if it
// is not found we will color over it unless it is black.
int bg_idx = 0;
for(int i = 0; i < p_palette_SIZE; i++) {
if (c.rgb == p_palette[i].rgb) {
bg_idx = i;
break;
} else if (c.rgb == vec3(0.0, 0.0, 0.0)) {
bg_idx = -1;
break;
}
}

if (bg_idx >= 0) {
int next_idx = (p_colorIdx + bg_idx) % p_palette_SIZE;
x_fill.rgb = p_palette[next_idx].rgb;
} else {
x_fill.rgb = c.rgb;
}

// Setting the stroke alpha to 1 prevents the weird smoothing effect that was causing issues at the
// edges
strokeAlpha = 1.0;
""".trimMargin()
}
}

This is a shader which uses the present screen color buffer as a texture. To get the pixel lookup to line up I had to scale and reflect the cordinate position so that the upper left hand corner is (0.0, 0.0) and the bottom right hand corner is (1.0, 1.0). Once doing this this texture lookup works properly.

Afte this we search through the palette to match the present color agains the background color. This will allow us to find the next index in the palette for the current color.

At the end I set strokeAlpha = 1.0, which seems to prevent some weird effects at the edges of the stroke our outlines placed on colors, likely due to mixing the stroke or color into the shape.

To improve this I would use a texture that represented the indexes directly with no aliasing or anything, then rendered the colors from that using 2 different buffers. I think this would avoid all of the weird aliasing issues I have been running into, since the color boundaries would always be clearly defined.

### Progression

#### Porting over C02

Having some issues with outlines etc

#### Getting rid of the outlines

To get rid of the outlines simply setting the strokeAlpha = 1.0 at the end of the shader seemed to help the most. I also had to subtract 2 pixels from the height and somewhere between 1 and 2 pixels from the width depending on the dx of the rhombus… I have not yet quite figured this out yet.

#### References

I had to look at the ShaderError.txt output a lot to get an idea of what parameters are available to me

the sampler2d is still a bit of a mystery


text:
1. Trig integral:

$\int \frac{1}{5+4\sec{x}} dx$

please give only hints in solving this integral
ireally dont know what to do first

thanks

2. Try this substitution: u=tan(x/2)

3. whats the u here?
x = 2arctan(u)
dx = 2 ( 1/ (1 + u^2))

i dint understand still

4. $\sec x = \frac{(1+u^2)^2}{(1-u^2)^2}$

whats the u here?
x = 2arctan(u)
dx = 2 ( 1/ (1 + u^2))du
Yes. And cosx=(1-u^2)/(1+u^2). So this makes the integrand a rational fraction.

6. thanks!
oh yeahhh i forgot this was all easy using trig sub...
thanks a lot for the help


text:
# Triple integral of $r^{2}e^{ir\cos\theta}\sin\theta \,dr\,d\theta \,d\phi$

I'm trying to calculate this integral but I'm a bit stuck. Has anyone got any tips/tricks to deal with the $e^{ir\cosθ}$ part?

$$\iiint r^{2}e^{ir\cos\theta}\sin\theta \,dr\,d\theta \,d\phi$$

Limits: $0\leq r \leq a$, $0\leq\theta\leq \pi$, $0\leq\phi\leq2\pi$.

I'm a first year chemistry student so keep the maths as simple as possible!

-

Your integral can be rewritten (by Fubini): $$\left(\int_{\phi=0}^{2\pi}d\phi\right)\left(\int_{r=0}^ar^2\left(\int_{\theta=0}^\pi e^{ir\cos\theta}\sin\theta d\theta\right)dr\right)$$ Of course, the first factor is $2\pi$. Now for every $r>0$, do the change of variable $u=ir\cos\theta$, $du=-ir\sin\theta d\theta$ in the middle integral to get $$\int_{\theta=0}^\pi e^{ir\cos\theta}\sin\theta d\theta=\int_{ir}^{-ir}e^u\frac{-du}{ir}=\frac{1}{ir}\int_{-ir}^{ir}e^udu=\frac{1}{ir} e^u\rvert_{-ir}^{ir}= \frac{1}{ir}(e^{ir}-e^{-ir}).$$ Now $$\int_{r=0}^ar^2\left(\int_{\theta=0}^\pi e^{ir\cos\theta}\sin\theta d\theta\right)dr=\frac{1}{i}\int_0^ar(e^{ir}-e^{-ir})dr=2\int_0^ar\sin r dr$$ by Euler's formula $e^{ir}-e^{-ir}=2i\sin r$.

It only remains to integrate by parts $$\int_0^ar\sin dr=(-r\cos r)\rvert_0^a+\int_0^a\cos r dr=-a\cos a+\sin r\rvert_0^a=-a\cos a+\sin a.$$ Finally, your integral is worth $$2\pi\cdot2(\sin a-a\cos a)=4\pi(\sin a -a\cos a).$$

-
And you wonder why I put my $d$'s next to my integrals? –  Ron Gordon Mar 14 '13 at 19:31
@RonGordon He he he...I see it now. –  1015 Mar 14 '13 at 19:33

Hint: $$(e^{\cos{t}})'=-\sin{t} \cdot e^{\cos{t}}$$ Integrate with respect to $\theta$ first, you should get $ir(e^{ir}-e^{-ir})$.

Use the formula $$sinr=\frac{e^{ir}-e^{-ir}}{2i}$$

You should be able to come up with the rest.

-


text:
# Missing/wrong image?

In reading over this page, it seems to me that the Merode altarpiece is not the image being referred to in points 1-8. Although neither of the originals for this content have an image included (which seems an oversight as the text clearly needs an image to understand the points being made), I believe the image being referred to is the Arnolfini Portrait by Van Eyck (shown at right). I suggest replacing the Merode altarpiece image with the image of the Arnolfini portrait.

Thoughts?

Alison

08:21, 22 January 2013


text:
# Group Normalization

This is a PyTorch implementation of the Group Normalization paper.

Batch Normalization works well for large enough batch sizes but not well for small batch sizes, because it normalizes over the batch. Training large models with large batch sizes is not possible due to the memory capacity of the devices.

This paper introduces Group Normalization, which normalizes a set of features together as a group. This is based on the observation that classical features such as SIFT and HOG are group-wise features. The paper proposes dividing feature channels into groups and then separately normalizing all channels within each group.

## Formulation

All normalization layers can be defined by the following computation.

where $x$ is the tensor representing the batch, and $i$ is the index of a single value. For instance, when it’s 2D images $i = (i_N, i_C, i_H, i_W)$ is a 4-d vector for indexing image within batch, feature channel, vertical coordinate and horizontal coordinate. $\mu_i$ and $\sigma_i$ are mean and standard deviation.

$\mathcal{S}_i$ is the set of indexes across which the mean and standard deviation are calculated for index $i$. $m$ is the size of the set $\mathcal{S}_i$ which is the same for all $i$.

The definition of $\mathcal{S}_i$ is different for Batch normalization, Layer normalization, and Instance normalization.

### Batch Normalization

The values that share the same feature channel are normalized together.

### Layer Normalization

The values from the same sample in the batch are normalized together.

### Instance Normalization

The values from the same sample and same feature channel are normalized together.

### Group Normalization

where $G$ is the number of groups and $C$ is the number of channels.

Group normalization normalizes values of the same sample and the same group of channels together.

Here’s a CIFAR 10 classification model that uses instance normalization.

86import torch
87from torch import nn
88
89from labml_helpers.module import Module

## Group Normalization Layer

92class GroupNorm(Module):
• groups is the number of groups the features are divided into
• channels is the number of features in the input
• eps is $\epsilon$, used in $\sqrt{Var[x^{(k)}] + \epsilon}$ for numerical stability
• affine is whether to scale and shift the normalized value
97    def __init__(self, groups: int, channels: int, *,
98                 eps: float = 1e-5, affine: bool = True):
105        super().__init__()
106
107        assert channels % groups == 0, "Number of channels should be evenly divisible by the number of groups"
108        self.groups = groups
109        self.channels = channels
110
111        self.eps = eps
112        self.affine = affine

Create parameters for $\gamma$ and $\beta$ for scale and shift

114        if self.affine:
115            self.scale = nn.Parameter(torch.ones(channels))
116            self.shift = nn.Parameter(torch.zeros(channels))

x is a tensor of shape [batch_size, channels, *]. * denotes any number of (possibly 0) dimensions. For example, in an image (2D) convolution this will be [batch_size, channels, height, width]

118    def forward(self, x: torch.Tensor):

Keep the original shape

126        x_shape = x.shape

Get the batch size

128        batch_size = x_shape[0]

Sanity check to make sure the number of features is the same

130        assert self.channels == x.shape[1]

Reshape into [batch_size, groups, n]

133        x = x.view(batch_size, self.groups, -1)

Calculate the mean across last dimension; i.e. the means for each sample and channel group $\mathbb{E}[x_{(i_N, i_G)}]$

137        mean = x.mean(dim=[-1], keepdim=True)

Calculate the squared mean across last dimension; i.e. the means for each sample and channel group $\mathbb{E}[x^2_{(i_N, i_G)}]$

140        mean_x2 = (x ** 2).mean(dim=[-1], keepdim=True)

Variance for each sample and feature group $Var[x_{(i_N, i_G)}] = \mathbb{E}[x^2_{(i_N, i_G)}] - \mathbb{E}[x_{(i_N, i_G)}]^2$

143        var = mean_x2 - mean ** 2

Normalize

148        x_norm = (x - mean) / torch.sqrt(var + self.eps)

Scale and shift channel-wise

152        if self.affine:
153            x_norm = x_norm.view(batch_size, self.channels, -1)
154            x_norm = self.scale.view(1, -1, 1) * x_norm + self.shift.view(1, -1, 1)

Reshape to original and return

157        return x_norm.view(x_shape)

Simple test

160def _test():
164    from labml.logger import inspect
165
166    x = torch.zeros([2, 6, 2, 4])
167    inspect(x.shape)
168    bn = GroupNorm(2, 6)
169
170    x = bn(x)
171    inspect(x.shape)
175if __name__ == '__main__':
176    _test()


text:
# Home

Score : $300$ points

### Problem Statement

Iroha is very particular about numbers. There are $K$ digits that she dislikes: $D_1, D_2, ..., D_K$.

She is shopping, and now paying at the cashier. Her total is $N$ yen (the currency of Japan), thus she has to hand at least $N$ yen to the cashier (and possibly receive the change).

However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.

Find the amount of money that she will hand to the cashier.

### Constraints

• $1 ≦ N < 10000$
• $1 ≦ K < 10$
• $0 ≦ D_1 < D_2 < … < D_K≦9$
• $\{D_1,D_2,...,D_K\} ≠ \{1,2,3,4,5,6,7,8,9\}$

### Input

The input is given from Standard Input in the following format:

$N$ $K$
$D_1$ $D_2$ … $D_K$

### Output

Print the amount of money that Iroha will hand to the cashier.

### Sample Input 1

1000 8
1 3 4 5 6 7 8 9

### Sample Output 1

2000

She dislikes all digits except $0$ and $2$.

The smallest integer equal to or greater than $N=1000$ whose decimal notation contains only $0$ and $2$, is $2000$.

### Sample Input 2

9999 1
0

### Sample Output 2

9999