<<

Social Science Studies and Experiments with Web Applications

Author Dawit Bezu Mengistu Supervisor Aris Alissandrakis Exam date 30 August 2018 Subject Social Media and Web Technologies Level Master Course code 5ME11E-VT18 Abstract

This thesis explores a web-based method to do studies in cultural . Cu- mulative (CCE) is defined as social learning that allows for the accumulation of changes over time where successful modifications are maintained un- til additional change is introduced. In the past few decades, many interdisciplinary studies were conducted on cultural evolution. However, until recently most of those studies were limited to lab experiments. This thesis aims to address the limitations of the experimental methods by replicating a lab-based experiment online. A web-based application was developed and used for replicating an experiment on by Solomon Asch[1951]. The developed application engages participants in an optical illusion test within different groups of social influence. The major finding of the study reveals that conformity increases on trials with higher social influence. In addition, it was also found that when the task becomes more difficult, the subject’s conformity increases. These findings were also reported in the original experiment. The results of the study showed that lab-based experiments in cultural evolution studies can be replicated over the web with quantitatively similar results.

Keywords— Cumulative Cultural Evolution, web-based experiment, optical illusion, real-time communication

1 Dedication

To Simon & Yohana

2 Acknowledgements

I want to thank the Swedish Institute (SI) for granting me a scholarship. I would like to express my great appreciation to my supervisor Dr. Aris Alissandrakis for his ongoing guidance and support; Romain Herault for helping me structure my work; Stefan Aleksikj and Hampus Juhlin for their friendship and support throughout the program. I would also like to thank my mom Almaz, my wife Enyat and my kids Simon and Yohana, my sister Mahlet, and my friend Nebyou for believing in me.

3 Contents

1 Introduction9

1.1 Motivation...... 11

2 Background 13

2.1 Overview of Cumulative Cultural Evolution...... 13

2.2 Methods of Studying Cumulative Cultural Evolution...... 14

2.2.1 Experimental Method...... 15

2.2.2 Conformity Experiment...... 19

2.2.3 Web-based Experiments...... 20

3 Methodology 23

3.1 Overview...... 23

3.2 Experiment Procedure...... 25

4 System Description 26

4.1 System Design...... 26

4.2 Front-end Development...... 27

4.3 Back-end Development...... 29

4 4.4 Survey Implementation...... 32

5 Result and Discussion 34

5.1 Results...... 34

5.1.1 First Experiment...... 34

5.1.2 Second Experiment...... 35

5.1.3 Post-experiment Interviews...... 36

5.2 Discussion...... 36

6 Conclusion 38

6.1 Future Work...... 39

Bibliography 39

A Pusher Implementation 44

B SurveyJS Implementation 48

C Images Used for the Experiment 51

5 List of Figures

2.1 Experimental design of a typical Transmission Chain study...... 16

2.2 Experimental design of a typical Replacement Method study...... 17

2.3 Experimental design of a typical Constant group method study...... 18

4.1 The three versions of the application...... 27

4.2 Application screenshot (iPhone mockup)...... 29

4.3 Activity Diagram of Pusher implementation...... 31

5.1 Conformity of groups in the first experiment...... 35

5.2 Conformity of groups in second experiment...... 36

B.1 Survey editor developed using survey.js library...... 49

C.1 Color Optical Illusion...... 51

C.2 M¨uller-Lyer illusion...... 52

C.3 Scintillating grid...... 52

C.4 Cafe wall illusion...... 53

C.5 Color dogs...... 53

C.6 Identical colors...... 54

6 C.7 Adelson’s Checkers Shadow...... 54

C.8 Rotating snakes...... 55

C.9 Ehrenstein illusion...... 55

C.10 Shepherd’s table...... 56

C.11 The Ebbinghaus illusion...... 56

C.12 Hering illusion...... 57

7 List of Tables

3.1 Comparison between Asch[1951] experiment and the experiment conducted for this thesis...... 24

8 Chapter 1

Introduction

In the field of cultural evolution studies, it is argued that cultural variation and cultural change are often lacking in empirical support and that experimental simulations of cultural change can provide one means of investigating such issues (Mesoudi[2007]). Even though experimental methods are evidenced to recreate and explore past events in a controlled and systemic manner, they have methodological limitations when it comes to efficiency, scalability and the extent to successfully recreate real-life cultural change. Web-based experiments, a growing yet not well researched trend in social science, are said to have the potential to address some of these limitations as well as translate to external validity.

New technologies have changed a lot of our ways and actions as a . With these advancements, the way to conduct studies and experiments have also evolved for the better. The internet offers a huge potential (and huge samples) for studying cultural transmission experimentally. Despite these engaging highlights, web-based experiments in social science fields still stay in their early stages. The primary goal of this thesis is to help fill this gap by conducting a replicated experiment online, in cultural evolution studies and compare the results with the original lab experiment.

In their seminal article on the study of collective social dynamics in cultural markets, J. Salganik and Watts[2009] argue that as opposed to natural scientists, social scientists have long-faced basic issues in testing and exploring new theories. In the same vein, Horton et al.[2011] underline the difficulty of coming up with procedures for online experiments that ensure their internal validity. They suggest a number of factors have been identified that have probably hindered researchers from conducting experiments online. Some of these include the difficult to monitor the identity of participants, that subjects may read the experimental instructions too carelessly and/or make decisions too quickly and/or get

9 significantly distracted during the course of the experiment, and that subjects may also drop out of the experiment for unknown reasons.

Earlier literature defines the term cumulative cultural evolution (CCE) as a process in which, “human accumulate changes over many generations, resulting in culturally transmitted behaviors that no single human individual could invent on their own” (Boyd and Richerson[1996]). Most methods used to study cultural evolution extensively rely upon experimental social , theoretical analysis, mathematical or computer models and to a much lesser extent, computer-based experiments. An overview of CCE, its benefits and some of the study methods used are highlighted in the Background section.

It is hoped that this thesis work will contribute to this literature by creating a proto- type application aimed to address some of the limitations of a lab experiment in addition to comparison with the proposed method. The main conclusion drawn from the study is that lab-based experiments in cultural evolution studies can be replicated over the web with quantitatively similar results. The results are important to the community of developer wishing to build up and scale the application as a medium for running social experiments over the Internet. They are also important for social scientists wishing to use social exper- iments to research the Internet as a method.

The purpose of this thesis work is to design and implement a real-time web-based application for conducting an online experiment. Using the application a well-known ex- periment by Asch[1951] on conformity was replicated. An earlier study by Sherif[1937] on social factors in perception is also used for reference as the two experiments have similar methods and execution. The thesis serves the purpose of identifying some of the technical components and methodological limitations of such experiments. Taking this into account, the following questions are to be investigated as research questions:

Research Questions

1. How can web-based experiments be used to address the limitations of experimental methods of conducting cumulative cultural evolution research?

2. Investigate the degree to which social pressure can affect a person to conform, using the web-based experiment method.

3. How well the factors affecting conformity in lab experiments translate to a web-based method?

10 1.1 Motivation

The general concept and approach of experimental for a better under- standing of cultural variation and cultural change have greatly inspired the study reported in this thesis. More specifically two experiments, by Sherif[1937] on social influences and Asch[1951] on conformity. Both experiments have faced some criticism based on the sample data they used, how the experiments were set up and that the actual reason for conformity may have actually been motivated to avoid conflict instead of an actual desire to conform. These two experiments are described below.

Sherif[1937] Experiment

• It used the auto-kinetic1 phenomenon as a perception stimuli to test social influence.

• Individuals were asked to estimate how far the point of light moved.

• When asked as a group, subjects’ answers converged toward an average distance.

• Group norms were established through an interaction of individuals and the leveling- of extreme opinions.

Asch[1951] Experiment

• The effects of group pressure upon the modification and distortion of judgment were studied.

• It measured the extent to which social pressure from a majority group could affect a person to conform.

• The experiment used a line judgment task where participants had to identify which of the lines on the right matched the line on the left. All of the participants except one were confederates of Asch, who have secretly been instructed to give the wrong answer on twelve out of eighteen sets of cards.

• With the social pressure of the confederates applied, conformity shot-up to around 37%, with 74% of subjects conforming to the majority at least once.

1Auto-kinetic is a phenomenon where a stationary spot of light projected in a dark room appears to be moving.

11 Detailed examination of methods of study in cultural evolution by Mesoudi and Whiten [2008] showed that the aforementioned experiments, like many other lab-based experiments, have limitations as they tend to require large number of participants, a large amount of time and a high degree of organization.

There is a relatively small body of literature that is concerned with employing a web- based experiment as a method to study CCE. With this thesis, it is hoped to contribute to the study by testing a fresh approach of experimenting method. Hence, this project intends to emulate the aforementioned experiments online and explore ways to address some of the methodological issues of lab experiments. In the process, it is also hoped to learn more about conducting social science experiments online in terms of designing the prototype itself and identifying factors affecting the process.

The thesis has been organized in the following way. Chapter2 gives a brief overview of the current literature of methods used in cumulative cultural evolution studies and then review earlier works on the benefits and limitations of web-based experiments in social science. Chapter3 reports the methodologies used in designing the application and conducting the experiment. Chapter4 deals with the description of the developed application including front-end and back-end technologies utilized. Chapter5 presents the results of the experiment and discusses the findings of the study. Chapter6 concludes the thesis and the last section highlights potential future work on the study.

12 Chapter 2

Background

This chapter reviews some literature on the topic of cumulative cultural evolution (CCE) beginning from its definition and briefly goes through the different methods used by re- searches in order to study cumulative cultural evolution. Some of the research conducted using these methods is also discussed. Previous attempts of computer-based studies are explored and some benefits of using a web-based method are highlighted. In the end, a web-based study method is assessed along with the experiment to be emulated using the method and the motivation for conducting this study is highlighted.

2.1 Overview of Cumulative Cultural Evolution

The concept of CCE was first introduced by Tomasello[1990] to refer to the accumulation of invented and then adopted practices or artifacts for many generations with increas- ingly effective modifications. To describe the concept further, he used the “ratchet effect” metaphor. A ratchet is a device consisting of angled teeth that allow a bar or cog to move in one direction only. Here, it is a metaphor for the accumulation of improvements without reverting back to prior, less effective states. A recent seminal article by Mesoudi and Thornton[2018] expands upon Tomasello[1990] description of the concept. Their definition takes into account four main criteria:

(i) A change in behavior (or product of behavior, such as an artifact), typically due to asocial learning, followed by (ii) the transfer via social learning of that novel or modified behavior to other individuals

13 or groups, where

(iii) the learned behavior causes an improvement in performance, which is a proxy of genetic and/or cultural fitness, with

(iv) the previous three steps repeated in a manner that generates sequential improvement over time.

Caldwell and Millen[2008] adapted this description and summarize the concept as, “a situation in which social transmission allows for successive improvements to perfor- mance over generations of learners, generated by the accumulation of modifications to the transmitted behaviors”. Therefore, CCE is an interesting behavioral phenomenon and an important topic of study as it is said to be a leading front-runner for the key to human success (Mesoudi and Whiten[2008]). Accordingly, each generation builds on the knowl- edge, inventions and achievements of the previous one and our current technologies exist only as a result of our ability to understand and make use of the conveyed knowledge and artifacts of others.

2.2 Methods of Studying Cumulative Cultural Evo- lution

In their seminal study on the distinction between and cultural evolution, Boyd and Richerson[1996] introduced the term cumulative cultural evolution to denote a concept in behavior where no individual could invent on their own. A similar concept by (Tomasello [1990]; Tomasello et al.[1993]), was proposed using a “ratchet” metaphor to explain cul- tural evolution as “modification and improvement staying in population readily with the minimum loss until additional change is introduced”. They gave emphasis on the impor- tance of innovation and its faithful transmission making sure newly invented artifacts and practices preserved until the next improvement comes along.

In their study on methods of studying CCE, Caldwell and Millen[2008] have put forward three main methods of studying – Field Study, Theoretical, and Experimental.

Studying in the field is a method that relies upon the availability of large samples of ethnographic, historical and/or archaeological data, to show when and where cultural variation first arose and how it changed over time (Mesoudi[2007]). One study by Ambrose [2001] that used this method reported that “we can infer from the presence or absence of archaeological data that any tools used by hominids up until two million years ago were

14 probably comparable with those used by other great apes, such as chimpanzees”. Another study by Mace et al.[1994] also used this method to identify specific environmental factors that correlate with a particular cultural variant, to show that camel herding in East Africa was adopted (either culturally acquired or independently invented) only in dry climates. This method faced some criticism from researches like Mesoudi[2007], who argued that only data at the population level is mostly available and data at the individual level (like who copy what from who) is often inferred. He further pointed out Historians and archaeologists cannot ‘re-run’ history multiple times to explore the effects of contingency on cultural change hence cannot “manipulate variables in different runs to explore the effects of those variables”.

Theoretical Method is another method they looked into in their study. They claimed this method is more flexible than Field Study Methodology as it allows researchers to manipulate multiple variables as they see fit. Study on the rarity of CCE in non-humans by Boyd and Richerson[1996] and theoretical study on cognitive abilities necessary for CCE (Enquist and Ghirlanda[2007]) are some of the studies conducted using a theoretical method. They further point out a limitation of this method might as constraints being imposed on models that are selected by their creator and conclusions are drawn from assumptions that may or may not be accurate.

The third method Caldwell and Millen[2008] discussed and themselves used in their study is Experimental Method, which is discussed further in the next section.

2.2.1 Experimental Method

This method is characterized by a high level of control in order to test hypotheses about necessary precursors (Mesoudi[2007]). Here, we can set out to study the outcomes of cumulative cultural evolution in multiple replicated populations under a controlled setting. Numerous studies were conducted using this method (for example, Kirby et al.[2008]; Mesoudi and Whiten[2008]).

In lab experiments, cultural phenomena are simulated on as small-scale, permitting researchers to study how behaviors evolve due to repeated learning and transmission be- tween individuals (Caldwell and Millen[2008]). In a seminal article on using the methods of social psychology to study cultural evolution, Mesoudi[2007] reviewed three of these experimental methods; transition chain methods, replacement methods, and the constant- group method. The main characteristics of these methods along with research works using the methods are discussed below.

15 Figure 2.1: Experimental design of a typical Transmission Chain study (Figure orig- inally from Mesoudi[2007]).

Transmission Chain Method

This method involves passing material along chains of participants much like the game “broken telephone” (Mesoudi[2007]). The method was originally used by Bartlett[1932]. In a study involving 6 or 7 participants, a narrative was transmitted from one person to another in a one-way chain, and the distortions that appeared in the retelling were analyzed. Changes inaccuracy, quantity or content of the material can be assessed in each generation, to test for specific biases in cultural transmission. A typical transmission chain design is depicted in Figure 2.1.

Bartlett reported that the original material rapidly became greatly shorter in length and lost much of its detail, with only the overall gist being preserved. He also found out that subjects tended to modify the material to make it plausible and fit with their own pre-existing notion of the material. Similar research by Northway[1936] and Allport and Postman[1947], supported Bartlet’s findings. A more recent study by Mesoudi and Whiten[2004], to test Script Theory 1, used the transmission chain method and asserted that “the method holds a simple yet effective means of testing hypotheses concerning cul- tural transmission under controlled experimental conditions”. They claimed transmission chain method can be adapted to the standards of experimental psychology, using multiple parallel chains, quantitative and statistical analyses, under standardized and controlled methodology.

1Script Theory is a model of human knowledge and cognition that has been successful in explain- ing memory organization and human behavior, and that has subsequently found many practical applications in the field of education.

16 Figure 2.2: Experimental design of a typical Replacement Method study (Figure originally from Mesoudi[2007]).

Replacement Method

This method involves establishing a norm or bias in a group of participants, and one by one replacing the participants with new, untrained participants (Mesoudi[2007]). It was originally proposed by Gerard et al.[1956]. Several types of research have been conducted using this method. For instance, C. Jacobs and T. Campbell[1961] used this method in their work to study the persistence due to a conformity of an exaggerated perceptual judgment of Autokinetic effect2. A typical design of this method is shown in Figure 2.2.

Similar methods, involving the removal and replacement of participants within groups, have since been adopted by Pruitt and Insko[1980] and also more recently by Baum et al. [2004]. Caldwell and Millen[2008] used replacement method to simulate a miniaturized society, in which one generation would have the opportunity to interact with and observe individuals from the previous two generations, but not with those further back.

Constant Group Method

This method is very similar to replacement method but here group members remain con- stant. Individuals within a group perform some task or play a game, and are given the option of copying one or more other group members (Mesoudi[2007]). A typical design of this method is shown in Figure 2.3.

2Autokinetic effect is a phenomenon where a small spot of light (projected onto a screen) in a dark room will appear to move, even though it is still.

17 Figure 2.3: Experimental design of a typical Constant group method study (Figure originally from Mesoudi[2007]).

The constant-group method can be used to verify, under controlled conditions, social and individual learning and other theoretically predicted cultural dynamics in groups of actual people. Hence, help explore the conditions under which these different learning rules – copying from other at random, coping the majority(conformity) and coping successful individuals – apply. A considerable amount of research done using constant group methods (Bentley et al.[2004]; Boyd and Richerson[1985]) affirms the benefits of the method.

Advantages and Limitations of Experimental Method

Together, these studies indicate the potential benefits of experimental methods in simu- lating cultural evolution in the lab. However. it is important to note their limitations as well. Mesoudi[2007] notes that “the utility of the experimental methods crucially depends on their ability to successfully recreate aspects of real-life cultural change”. Some of the limitation and advantages of experimental methods are listed below.

Advantages

1. Ability to manipulation of variables freely.

2. The random assignment of participants into experimental and control groups.

3. The generation of complete data-sets.

4. Experiments offer a unique means of recreating and exploring past events in a con- trolled and systematic manner

18 Limitations

1. Ability to successfully recreate aspects of real-life cultural change is limited by the many differences between the cultural change we seek to simulate and the typical psychology experiment. 2. Real-life cultural change typically occurs over long periods of time, in diverse social and ecological environments, and in multiple generations and large populations of diverse groups of people, experiments are typically performed over a few hours at most, in a university laboratory setting, and use small groups of participants. 3. Differences may reduce the validity of experimental simulations of cultural phenom- ena. And even if the demographics of the participants perfectly matched those of the cultural progenitors, there is still the problem that every laboratory setting is artificial to some degree. 4. Participants may bring to the experiments a specific set of social norms and expecta- tions regarding science, psychology, experiments, and the roles of experimenters and participants, which may cause their behavior to diverge from that under “natural” conditions.

When it comes to addressing the limitations of each of the aforementioned methods, Mesoudi suggests treating the methods as complementary rather than in competition with one another, and claims that experiments “can potentially be used, alongside historical, archaeological and ethnographic methods, mathematical models and computer simulations, to more fully explain the cultural variation observed by cultural psychologists and cultural anthropologists”.

2.2.2 Conformity Experiment

A great deal of previous research adopts a variety of methods in order to study culture under laboratory conditions. The main focus behind these approaches is to simulate cul- tural phenomena on a small scale. This would essentially allow researchers to study how behaviors evolve over time due to repeated social learning and transmission (Caldwell and Millen[2008]). While experimental approaches eventually have limitations of their own as discussed in the previous section, it is essential to take into account the power of such methods in terms of manipulating variables and collecting the data that are required.

In this regard, publications that employ experimental approaches, more frequently adopt physiological social experiments. A seminal study by C. Jacobs and T. Campbell

19 [1961] is a relevant example that signifies the use of such method. Their investigation included simulating generational progression through the repeated removal and substitution of subjects within small groups. They aimed to determine if participants’ inclination to conform to majority could result in long-lasting traditions of implausible beliefs. Groups were constructed by experimental confederates, instructed to respond with a significant exaggeration of their true perception of the strength of a visual movement illusion.

Going along with Mesoudi and Thornton[2018] concepts on core criteria of CCE and various studying methods discussed in this thesis, it can thus reasonably argued that C. Ja- cobs and T. Campbell[1961] experiment can be taken as a good example of cumulative cultural evolution for replication and study. A study by Boyd and Richerson[1985] affirms the importance of conformity experiments to cultural studies in terms of understanding social and individual learning. The study argue that conformity which is coping from the group majority, can lead to cultural . Accordingly, such experiments help understand the implications of social and individual learning with respect to culturally transmitted information. For this reason, the current study uses this and other similar conformity experiments (Sherif[1937] and Asch[1951]) as a base for emulating a lab-based approach online. In addition, replicating this type of experiment that employs a method prominently used to study CCE, would allow addressing its limitations in a conducive set- ting. The chosen conformity experiment for replication along with conditions and findings of the initial experiment is discussed in the next chapter.

2.2.3 Web-based Experiments

Increase in computing power over the past few decades, and the almost limitless pool of participants now available via the Internet has made it possible to design and conduct laboratory-style experiments involving thousands, or even millions, of participants. The internet offers huge potential (and huge samples) for studying cultural transmission exper- imentally.

The replacement method and constant-group method are becoming more and more feasible given the advent of large computer networks, allowing large numbers of participants to engage in relatively sophisticated computer games. This is evidenced by addressing the large amounts of time and a high degree of organization requirements of these methods. (such as Mesoudi and O’Brien[2008]). They suggest, “re-framing experiments as computer games and implementing them on the internet rather than in psychology labs might also partially reduce the aforementioned artificiality of psychology experiments and the impact of preexisting experiment-associated social norms”.

In regards to studying Cumulative Cultural evolution, the current literature indicates

20 that the vast majority of experiments have been conducted either using the replacement method or constant group method. There is not much research done using a computer or web-based approach. One recent study by Derex and Boyd[2015] used a computer-based experiment where participants had to build virtual “totem ” by discovering increas- ingly complex innovations. The experiment also included learning bots and is reported to be the first demonstration of cumulative cultural evolution within the lab (Derex and Boyd[2015]). The researchers found that human reasoning plays a part in innovations, but they also found that participants with access to social information were able to create more complex artifacts than individuals. A similar study by McElreath et al.[2005] on 6-10 participants aimed to investigate social learning and individual learning also used a computer-based task in which participants had to choose between two types of crops to plant where one crop gave a higher yield. Some studies (for instance, Joinson et al.[2012]) have been conducted to test the internal validity of web-based experiments, comparing across experimental conditions (online and offline) and successfully replicating findings. A recent comparative study between lab-based experiments and web-based experiments by Finley and Penningroth[2015] point out the advantages and drawbacks of web-based approach. Some of these are listed below:

Benefits of Web-based Experiment

• Online testing can be extremely fast and efficient than lab-based testing. • The internet permits observation and generally experimentation in an exceedingly massive scale. • Allow cross-cultural social experiments in real time.

Concerns when running a web-based experiment

• Difficulty verifying the identity of subjects participating in the experiment. • The internet permits observation and generally experimentation in an exceedingly massive scale. • Experimental instructions ignored or read too carelessly, leading to lower quality data. • Data collected online might include more noise, making it easier to miss existing effects • Variance in the data due to network connection speed and reliability, browser and computer types, screen size and resolution, etc

21 • Lack of control over the general experimental environment.

The existing literature reveals that much of the research done in cultural evolution studies, use a lab-based method in contrast to web-based. Even though lab experiments are great in scaling down the bigger world, they do so only to a certain extent. The web- based experiment looks a promising approach in order to look back at these experiments with a better method as well as design new once.

22 Chapter 3

Methodology

3.1 Overview

Current research on methods of creating web-based experiments in social science points out two main approaches, either through programming or use of survey applications. In this study, both of this approaches are going to be designed and tested.

The study reported here mainly focuses on building and testing the application itself in contrast to using survey application. However, a survey application is also integrated and tested for functionality. The main reason for giving emphasis on an application as opposed to using a survey application is the limited literature in cultural evolution studies that make use of a web-based application. However, designing and integrating a survey approach is also appealing in terms of customization to social studies. The detail description of the design and integration of a survey app is put under AppendixB as a second approach of conducting experiments online.

In order to test the proposed method, a web-based application was created and used for running an optical illusion experiment. The method involves the use of internet with the combination of Constant Group Method. Accordingly, the application will be designed with the aim to replicate earlier studies of social pressure and conformity online.

An optical illusion task was inspired by earlier works of Sherif[1937] (the psychology of social norms) and a similar experiment by Asch[1951] (to study the persistence due to a conformity of an artificially exaggerated perceptual judgment). Asch’s experiment involved a line matching task between two pictures, while Sherif used auto-kinetic effect

23 Asch[1951] Experiment The proposed experiment

Aim Investigate the extent to which social pressure from a majority group could affect a person to conform. Method Lab experiment Web-based method Task Matching line segment visual test Optical illusion tests Procedure Participants state aloud which Participants answer questions re- comparison line (A, B or C) was garding several different optical most like the target line. illusion images. Asch put a naive participant Other participants answers are in a room with seven confed- either shown right next to each erates. The confederates had multiple choice, or they can be agreed in advance what their re- seen if participants wish to (by sponses would be when presented clicking a button). The data with the line task. The par- shown to participants is exagger- ticipant did not know this, and ated creating a pressure to con- was led to believe that the other form. seven participants were also real participants like themselves.

Table 3.1: Comparison between Asch[1951] experiment and the experiment con- ducted for this thesis. where a stationary source of light appears to be moving in a dark room.

In this thesis work, an optical illusion test will be used as a task, that is a middle ground between these two experiments. The advantage of using this type of task is to get participants attention with a task that is neither trivial nor strenuous. Comparison with Asch’s methodology is shown in Table 3.1.

Designing of the web application requires a closer look at to the original study and involved a rigorous task of going back and forth between the experiment, its conditions and finding a solution that better address its limitations. Furthermore, other similar related researches and general factors related to web-based experiments are looked into.

The application is going to be implemented using Pusher1, and a NodeJs application

1 Pusher is a platform that provides real-time communication between servers, apps, and devices.

24 with MongoDB database back-end. The Node.js application will be built on top of the Express framework, and use the handlebars engine for templates, and MongoDB for storing data. The app will allow individuals to answer optical illusion questions based on a given set of images. The application should be modified to allow to run three types of conditions where; the choice was made either: (i) with no social pressure, (ii) with the opportunity to view the previous choice of participants (partial pressure to conform), or (iii) with all previous choices of participants being displayed (allowing conformity).

Going along with Asch[1951] experiment terms, questions in this study are referred as trials and those questions with added social influence (populated with exaggerated re- sponses to test conformity) are called critical trials. And false data used to test conformity in this study resembles Asch’s confederates (actors working with Asch and gave an incor- rect response on purpose). Here, false data (Confederate) are used in the case of a group with existing pressure to conform.

3.2 Experiment Procedure

(i) Two experiments with 50 participants were run using the prototype.

(ii) Prior to each experiment, a different version of the application was shared to partic- ipants.

(iii) The participants were told they were participating in a visual perception quiz, they were given brief instructions, and were then directed to the questions.

(iv) The responses were saved to mLab, a database-as-a-service for MongoDB, and then are exported for analysis.

(v) Semi-structured interviews were conducted with five participants.

(vi) Group and Subjects score is used to test conformity based on the conditions.

Pusher Channels is used for notifications, chat, gaming, web-page updates, IoT, and many other systems requiring real-time communication.

25 Chapter 4

System Description

The design of the application along with front and back-end technologies used for the implementation as well as development choices are highlighted in the following sections.

4.1 System Design

The application is designed with the aim to test a web-based method of studying Cumu- lative Cultural Evolution.

The application is built using Pusher and a NodeJs application with MongoDB database back-end. The Node.js application is built on top of the Express framework, and use the handlebars engine for templates, and MongoDB for storing data. There is no client-side JavaScript in this app - everything is run on the server. The app allows individuals to answer optical illusion questions based on a given set of images. The application is also modified to allow to run three types of conditions; the choice was either

• no social learning,

• having the opportunity to view the previous choice of participants, or

• having all previous choices of participants being displayed (allowing conformity).

Thus in the first version, no information regarding other participants responses is dis- played for participants (see Figure 4.1, left). In the second version of the application, other

26 Figure 4.1: The three versions of the application. Left to Right: no social learning, all other answers shown, and some other answers shown. participants answers are shown in real time (see Figure 4.1, center), therefore participants can see which answer most people chose. In the last version, information about other par- ticipants can be seen if a participant chooses to see, by clicking on an eye icon next to the options (see Figure 4.1, right).

4.2 Front-end Development

In this section the principal technologies used in realizing the front-end design, including technology used for rendering and responsive design, are presented.

Template engine- Handlebars

When working with Nodejs application one can render views using a template engine, HTML or using a front-end framework like React, Angular and use the back-end to return JSON through a full-stack application. The approach used in this project is a template engine particularly express-handlebars. Handlebars1, a semantic template language written

1Handlebars.js is a popular template engine that is powerful, simple to use and has a large community. It is based on the Mustache template language but improves it in several important ways.

27 entirely in JavaScript. It’s an expressive language with a tag syntax reminiscent of HTML, except expressions (oftentimes referred to as “mustaches”) are wrapped in double-curly braces. The setup and use of handlebars as a template engine included the following steps.

• Installation using node package manager (npm).

• Creating a new express app with view engine set to Handlebars (hbs).

• HTML structures, style, and JavaScript links are set in the layout directory on the file main.handlebars.

• Partial directory in views is set to hold the extension of the code from main.handlebars, for instance, the navigation bar is put in navbar.handlebars. This proves to be good for reusability of code in different pages.

The benefit of this approach is that the separation of concerns resulting in better test- ability. In handlebars, only simple conditionals and loops are kept in the .hbs files and others are contained in the application’s JavaScript files. In addition, when working with conditionals (a case with the prototype for the experiment), handlebars file is compiled once and then generates a JavaScript function that can be executed multiple times. The view is rendered as a form and this form is executed repeatedly for every vote in the database by using handlebars #each helper. Votes are incremented in real time as participants answer the questions.

Bootstrap is an open source toolkit for developing with HTML, CSS, and JS, that is used on top of handlebars. It is used to customize data entry forms when designing the prototype (both for the survey and experiment subparts). This was helpful for creating a responsive design. The design of surveys and experiments are tested for responsiveness using browser tools (Chrome) and also Responsinator (a device testing tool). Figure 4.2 shows a screenshot taken from Responsinator showing the applications look on iPhone with width 375px.

As discussed in the methodology section of this thesis, three versions were created based on the experimental conditions. One with no information displayed about other participants’ votes; another with an option to view others’ votes and the last one with votes for each option shown plainly for subjects. To implement this at the front-end level a simple style display property is used. The application used twelve optical illusion images chosen from various source. A brief description of the images and their sources is listed in AppendixC.

28 Figure 4.2: Application screenshot (iPhone mockup).

4.3 Back-end Development

NodeJS, Express, MongoDB database, Passport authentication along with Route protect- ing and access control, were used at the back-end. Pusher, a real-time communication platform based on Web-sockets was utilized. In the coming section implementation of this technologies and libraries along with the rationale for using with respect to the design is discussed briefly. First, the technologies used are highlighted then Pusher implementations are discussed.

29 Technologies used for back-end Implementation

NodeJS: Node is used to build very fast and scalable real-time applications. Node allows JavaScript to run as a standalone process on our machine. In this project, it is used primarily as a web server, for APIs and back-end interface and build the server side app with a rendered view.

Express: Along with Node, Express web framework is utilized to build powerful ap- plications. Express middle-ware, functions that have access to req, res objects.

MongoDB : MongoDB database is used in the development phase of this project to keep records subjects response. MongoDB is an open source, no-SQL, document-based database. In the main directory of the project models for user and experiment were created. Mongoose is used to map models (JavaScript objects) to MongoDB documents. During development, a localhost MongoDB URL was used and for the production phase, mLab which is a database as a service for MongoDB was used.

For implementing the experimental conditions where participants are allowed to see other participants response, the incorrect answers were artificially made popular by popu- lating the database with false responses.

Heroku: a cloud platform based on a managed container system, with integrated data services and a powerful ecosystem for deploying and running modern apps, is used for deploy the application.

Pusher Implementation

Pusher Channels provides real-time communication between servers, apps, and devices using Web-Sockets and HTTP. It is thus used to build a real-time application such as chat rooms and data analytic and many other systems requiring real-time communication. One of the main advantages of using Pusher is its support for many front-end and back-end technologies. When something happens in a system, Pusher can update web-pages, apps, and devices accordingly. For instance, when an event happens on an app, the app can notify all other apps and the system. Pusher real-time technologies provide a powerful means of transforming an app into a social activity. Pusher Channels has a publish/subscribe model.

In order to use Pusher, it is required to create an account. Afterward, the initial configuration of Pusher prompts to create an app with an option of various front-end and back-end technologies. For this project, NodeJS is chosen for the back end and no particular front-end framework is used.

30 After creating the app, a dashboard with a very basic implementation example on the back-end and front-end is given. This includes installing the pusher module, initializing it with the generated user key and secret ids and triggering when sending a response. Pusher implementation in the prototype involved opening a connection to pusher channels, subscribing, listening and triggering to a channel. The following snippet of code shows briefly the publish/subscribe model.

//at the back-end pusher.trigger('my-channel', 'my-event',{ "message": "hello world" }); //at the front-end var channel= pusher.subscribe('my-channel'); channel.bind('my-event', function(data) { alert('Received my-event with message: '+ data.message); })

In Figure 4.3 the activity diagram demonstrates the process once a choice is selected.

Figure 4.3: Activity Diagram of Pusher implementation.

When a choice is selected for a certain question, and the answer button is clicked, the containing form gets submitted. Then on-submit handler retrieves the choice selected

31 and the vote ID from the form and makes an AJAX call to the vote endpoint. The handler also updates the user interface to reflect the increased number of votes. The vote endpoint finds the vote with the specified ID in the database and increments the number of votes corresponding to the selected choice by one. A detailed implementation of Pusher is presented in AppendixA.

4.4 Survey Implementation

Publications on the ways of creating a web-based experiment suggest two approaches, creating an application based on the lab-based experiment and using a survey application. Until this point, the system description of the first method was discussed. Here, the second alternative approach and its implementation will be discussed. This study considered multiple existing survey solutions for addressing the problem. After a mini research on currently available survey applications, SurveyJS which is a JSON based survey library was chosen as a primary tool for creating the survey application as opposed to using a readily available application. With this approach, in contrast to the first approach, the emphasis was merely on creating the survey application. This is partly due to the intent to primarily test a web-based method for lab-based experiments and in part due to the limited scope of the study. Hence, further work on the survey application in terms of emulating an existing lab-based experiment is left out. In this section, the main processes used in implementing the survey application is discussed in brief.

Integrating SurveyJS into a website

SurveyJS2 encompass three independent elements: run-time SurveyJS library, SurveyJS Builder and SurveyJS Service for storing and analyzing results. In this thesis, the SurveyJS Builder is used being integrated into a website. The builder allows to design survey using drag and drop toolbox with a wide variety of question types. These ranges from a simple text entry and check-boxes to a more complicated dynamic matrices and conditionals with multiple input types. The survey model, that is the question types, the order, the skipping logic, the answer variants – everything is stored in human-readable JSON and results are also in JSON and can be feed to SurveyJS library. The steps taken to integrate the editor are as follows:

• Get SurveyJS library, https://github.com/surveyjs/editor

2https://surveyjs.io

32 • Create a project in a text editor including an index.html (for linking the source library and a div to hold the survey element) and a script.js file (for the survey logic).

◦ The survey logic includes calling Survey object from the library to determine the look of the site; editorOptions object for setting up different properties of the survey including the question types; editor object for saving and previewing surveys. A more detail integration logic of SurveyJS into a website is presented in AppendixB.

33 Chapter 5

Result and Discussion

5.1 Results

The present study was designed to use a web-based experimental method in order to repli- cate a lab-based experiment (Asch[1951]) and determine the extent to which the results of the original experiment could be replicated. The experiment was run twice and the number of times each participant conformed to the majority view was measured. Some participants failed to complete the experiment and those responses were not included in the analysis. Even though it was tested for responsiveness on mobile devices, a bug that pre- vented rendering of some images was detected when the site is run on other browsers other than Chrome. The findings of the experiment along with their significance are discussed here.

5.1.1 First Experiment

The first experiment was carried out with 30 participants that were divided into three groups based on the experimental conditions. It included seven trials out of which five were critical. The non critical trials were placed at the beginning in order to avoid any suspicions participants may have. The current study found that on average, over two-thirds (72%) of the participants who were placed in the group with higher pressure went along with the incorrect majority in the critical trials. Over the five critical trials, all participants answered incorrectly at least half the time (all confirmed at least three times). In the group with partial pressure to conform, more than half (52%) of the participants conformed to the

34 Figure 5.1: Conformity of groups in the first experiment. majority in the critical trials. This finding suggests that, when the pressure of conformity is reduced, subjects conformity declined. In the group with no existing pressure, only 44.2% of participants answered incorrectly for all trials and 50% for the critical trials. An examination of all critical trials in the experimental group revealed that two-thirds of all responses were incorrect. Similar to Asch’s findings, these incorrect responses often matched the incorrect response of the majority group. Figure 5.1 shows conformity over the seven trials.

5.1.2 Second Experiment

In this run, each experimental group is reduced to one participant by removing the “partial pressure” condition. In addition, the options were made more decisive to the subject by eliminating the “not sure” option. These changes were made after running the first experiment where the option (not sure) were found to be insignificant. This experiment was carried out with 20 participants divided into two groups based on the experimental conditions. This included ten trials out of which seven were critical. Over the ten trials, the group with no pressure to conform gave incorrect answer 10% less than the other informed group. 60% of the participants in the group experimental seemed to go along with the incorrect majority. Conformity, measured using the number of incorrect answers, is shown in Figure 5.2.

35 Figure 5.2: Conformity of groups in second experiment.

5.1.3 Post-experiment Interviews

Five participants from the experimental group were asked if they were influenced by others responses, one respondent said that he was familiar with this type of optical questions and knew how to solve such illusions. He also mentioned he did not notice them on the first trial. Two participants found the presence of others’ answers was a bit pressuring and distracting, they replied that they felt the need to verify before answering. One person admitted to being influenced by others.

5.2 Discussion

Group size influenced whether subjects conformed; the bigger the majority group (no of confederates), the more people conformed. This result agrees with Asch[1951] in his later studies. It was interesting to note that only a few individuals were able to answer some trials correctly, (for instance C.10 and C.7). It can be noted that, as the task becomes more difficult, the conformity increases. This finding is similar to Asch’s later result where, as the task of matching the lines becomes more difficult, it was harder to judge the correct answer and the conformity increased.

36 In contrast to Asch[1951] assumption that conformity would decrease when experi- ments are run in private, the current study showed a higher conformity. A possible expla- nation for this might be due to the difficulty of tasks.

With respect to the second question, the study found that overall participants gave more incorrect answers in the experimental groups (group with partial and higher pressure to conform).

The findings suggest that a generally comparable result was found while addressing the limitations of lab experiments. When participants in the experimental group were asked if they were influenced before answering, only one admitted to checking others responses. This study was able to address some of the limitations mentioned in earlier sections, through the use of real-time web-based method. Even though the developed application is not limited in terms of supporting large samples, the study included only fifty subjects. For this reason, the results reported here need to be seen with caution and further running of the experiment for a longer period would give a better picture.

37 Chapter 6

Conclusion

This thesis explored a web-based method to do studies in cultural evolution. Other study approaches such as experimental methods are found to be much common in contrast to web-based experiments. This study aimed to address three main problems: the limitations of the experimental method, investigate the extent to which social pressure could affect a person to conform and how well the factors affecting conformity in lab experiments translate to a web-based method. Both methods of creating web-based experiments were investigated and developed. With the survey application, it was able to integrate a survey editor into a website that supports most features of survey management systems. A web- based application was also developed and used for replicating an experiment with the proposed method. With regard to addressing the limitations of a lab-based experiment, the developed application was able to support a large number of participants and allow to run experiments more efficiently.

The major finding of the study revealed that when information about other participant was displayed, participants tended to rely on it. In addition, it was also found that confor- mity increases as the task of the experiment become more difficult. The results reported here, however, need to viewed with caution as the particular task used in the experiment might not be a good representative of conformity in other real-life situation and a small number of participants. Notwithstanding these limitations, similarities between online and laboratory results suggest further research on web-based experiments in the field.

38 6.1 Future Work

There are some challenging factors when running experiments online that might influ- ence the results. These may include the physical and physiological state of participants, hardware related issues, the reliability of the internet connection, and privacy concerns. Addressing these issues is not a simple task and beyond the scope of this thesis, it re- quires a combined study from developers and social scientists. It is thus suggested that further research should be undertaken to investigate better ways of handling dropouts and minimize the noise of data. Addition work on the current study could investigate social learning and individual learning using different stimuli and modification of the system. In addition, extended work on the developed survey application can establish the viability of the approach.

39 References

Edward H Adelson. Perceptual organization and the judgment of brightness. Science, 262 (5142):2042–2044, 1993.

Gordon W Allport and Leo Postman. The psychology of rumor. Henry Holt, 1947.

Stanley H Ambrose. Paleolithic technology and . Science, 291(5509): 1748–1753, 2001.

Solomon E Asch. Effects of group pressure upon the modification and distortion of judg- ments. In Harold Guetzkow, editor, Groups, leadership, and men; research in human relations, pages 177–190. Carnegie Press, Oxford, , 1951.

Frederic Charles Bartlett. Remembering: A study in experimental and social psychology. Cambridge University Press, 1932.

William M. Baum, Peter J. Richerson, Charles M. Efferson, and Brian M. Paciotti. Cul- tural evolution in laboratory microsocieties including traditions of rule giving and rule following. Evolution and Human Behavior, 25(5):305–326, 2004. ISSN 1090-5138. doi: 10.1016/j.evolhumbehav.2004.05.003.

R. Alexander Bentley, Matthew W. Hahn, and S.J. Shennan. Random drift and culture change. Proceedings of the Royal Society B: Biological Sciences, 271(1547):1443–1450, 7 2004. ISSN 0962-8452. doi: 10.1098/rspb.2004.2746.

R Boyd and . Why culture is common, but cultural evolution is rare. Proceedings of the British Academy, 88:77–93, 01 1996.

R. Boyd and P.J. Richerson. Culture and the Evolutionary Process. University of Press, 1985. ISBN 9780226069319. URL https://books.google.se/books?id=wHd_Q gAACAAJ.

40 Robert C. Jacobs and Donald T. Campbell. The perpetuation of an arbitrary tradition through several generations of a laboratory microculture. Journal of abnormal and social psychology, 62:649–58, 06 1961.

Christine A Caldwell and Ailsa E Millen. Studying cumulative cultural evolution in the laboratory. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 363(1509):3529–3539, 2008. ISSN 0962-8436. doi: 10.1098/rstb.2008.0133. URL http://rstb.royalsocietypublishing.org/content/363/1509/3529.

Maxime Derex and Robert Boyd. The foundations of the human cultural niche. Nature Communications, 6, 9 2015. ISSN 2041-1723. doi: 10.1038/ncomms9398.

Magnus Enquist and Stefano Ghirlanda. Evolution of social learning does not explain the origin of human cumulative culture. Journal of Theoretical Biology, 246(1):129 – 135, 2007. ISSN 0022-5193. doi: https://doi.org/10.1016/j.jtbi.2006.12.022. URL http://www.sciencedirect.com/science/article/pii/S0022519306005911.

Anna Finley and Suzanna Penningroth. Online versus in-lab: Pros and cons of an online prospective memory experiment. Advances in Psychology Research, 113:135–161, 01 2015.

R. W. Gerard, Clyde Kluckhohn, and Anatol Rapoport. Biological and cultural evolution some analogies and explorations. Behavioral Science, 1(1):6–34, 1956. doi: 10.1002/bs .3830010103.

John J Horton, David G Rand, and Richard J Zeckhauser. The online laboratory: Con- ducting experiments in a real labor market. Experimental economics, 14(3):399–425, 2011.

Matthew J. Salganik and Duncan Watts. Web-based experiments for the study of collective social dynamics in cultural markets. Topics in Cognitive Science, 1:439 – 468, 07 2009.

Adam N. Joinson, Katelyn Y. A. McKenna, Tom Postmes, Ulf-Dietrich Reips, and Ulf-Dietrich Reips. The methodology of internet-based experiments, 09 2012. URL http://www.oxfordhandbooks.com/view/10.1093/oxfordhb/9780199561803. 001.0001/oxfordhb-9780199561803-e-024.

Simon Kirby, Hannah Cornish, and Kenny Smith. Cumulative cultural evolution in the laboratory: An experimental approach to the origins of structure in human language. Proceedings of the National Academy of Sciences, 105(31):10681–10686, 2008. ISSN 0027-8424. doi: 10.1073/pnas.0707835105. URL http://www.pnas.org/content/105/ 31/10681.

41 , Mark Pagel, John R. Bowen, Biman Kumar Das Gupta, Keith F. Otterbein, Mark Ridley, Thomas Schweizer, and Eckart Voland. The comparative method in an- thropology [and comments and reply]. Current , 35(5):549–564, 1994. ISSN 00113204, 15375382. URL http://www.jstor.org/stable/2744082.

Richard McElreath, Mark Lubell, Peter J. Richerson, Timothy M. Waring, William Baum, Edward Edsten, Charles Efferson, and Brian Paciotti. Applying evolutionary models to the laboratory study of social learning. Evolution and Human Behavior, 26(6):483 – 508, 2005. ISSN 1090-5138. doi: https://doi.org/10.1016/j.evolhumbehav.2005.04.003. URL http://www.sciencedirect.com/science/article/pii/S1090513805000231.

Alex Mesoudi. Using the methods of experimental social psychology to study cultural evolution. Journal of Social, Evolutionary, and Cultural Psychology, 1(2):35–58, 2007. doi: 10.1037/h0099359.

Alex Mesoudi and Michael J. O’Brien. The learning and transmission of hierarchi- cal cultural recipes. Biological Theory, 3(1):63–72, 2008. ISSN 1555-5550. doi: 10.1162/biot.2008.3.1.63. URL https://doi.org/10.1162/biot.2008.3.1.63.

Alex Mesoudi and Alex Thornton. What is cumulative cultural evolution? Proceedings of the Royal Society of London B: Biological Sciences, 285(1880), 2018. ISSN 0962-8452. doi: 10.1098/rspb.2018.0712. URL http://rspb.royalsocietypublishing.org/cont ent/285/1880/20180712.

Alex Mesoudi and . The hierarchical transformation of event knowledge in human cultural transmission. Journal of Cognition and Culture, 4:1–24, 03 2004.

Alex Mesoudi and Andrew Whiten. The multiple roles of cultural transmission experiments in understanding human cultural evolution. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 363(1509):3489–3501, 2008. ISSN 0962-8436. doi: 10.1098/rstb.2008.0129. URL http://rstb.royalsocietypublishing.org/cont ent/363/1509/3489.

Bernd Lingelbach Micheal Schruf and Eugene R Wist. The scintillating grid illusion. Vision Research, 37(8):1033 – 1038, 1997. ISSN 0042-6989. doi: https://doi.org/10. 1016/S0042-6989(96)00255-6. URL http://www.sciencedirect.com/science/articl e/pii/S0042698996002556.

Mary L. Northway. The influence of age and social group in children’s remembering. British Journal of Psychology. General Section, 27(1):11–29, 1936. doi: 10.1111/j.2044- 8295.1936.tb00813.x.

42 D.J. Pruitt and C.A. Insko. Extension of the kelley attribution model: The role of comparison-object consensus, target-object consensus, distinctiveness, and consistency. Journal of Personality and Social Psychology, 39:39–58, 07 1980.

Muzafer Sherif. An experimental approach to the study of attitudes. Sociometry, 1(1/2): 90–98, 1937. ISSN 00380431. URL http://www.jstor.org/stable/2785261.

Michael Tomasello. Cultural transmission in the tool use and communicatory signaling of chimpanzees? In Sue Taylor Parker and Kathleen RitaEditors Gibson, editors, ‘Lan- guage’ and Intelligence in Monkeys and Apes: Comparative Developmental Perspectives, page 274–311. Cambridge University Press, 1990. doi: 10.1017/CBO9780511665486.012.

Michael Tomasello, Ann Cale Kruger, and Hilary Horn Ratner. Cultural learning. Behav- ioral and Brain Sciences, 16(3):495–511, 1993. doi: 10.1017/S0140525X0003123X.

43 Appendix A

Pusher Implementation

Implement the answer (voting) logic

When a choice is selected on a certain poll and the answer button is clicked, the containing form gets registered. Then the on-submit handler retrieves the choice selected and then a unique ID from the form and makes an AJAX call to the vote endpoint. For this AJAX call, Axios1 is used. The handler also updates the user interface to reflect the increased number of votes. The vote endpoint finds the poll with the specified ID in the database and increments the number of votes corresponding to the selected choice by one.

Defining the event handler

Pull in Axios for API calls

const vote= function (event) { event.preventDefault(); var pollId= event.target.id; var choice= event.target.optionsRadios.value; axios.post('/'+ pollId+ '/vote', {choice: choice});

1Axios is a promise-based HTTP client for the browser and node.js (https://github.com/axi os/axios)

44 disable the button, so a user can’t vote twice

document.querySelector('#vote-btn-'+ pollId).disabled= true; var voteCount= document.querySelector('#vote-count-'+ pollId+ '-'+ choice); voteCount.textContent++;

For the vote endpoint, add this route in the directory routes/index.js:

router.post('/:pollId/vote', (req, res, next) => { const choice= req.body.choice; const identifier= `choices.${choice}.votes`; Poll.update({_id: req.params.pollId}, {$inc: {[identifier]:1}}, {}, (err, numberAffected) => { res.send(''); });

In this code snippet, we find the poll with the specified ID then increments the number of votes associated with the specified choice using MongoDB’s $inc operator. When the application is run, running npm start, and a choice is selected and the answer button is clicked, the number of votes displayed for that choice increases.

Messaging with Pusher

To implement messaging with Pusher, the vote endpoint needs to be modified so it sends out a broadcast over Pusher and increments the number of votes. We’ll also need to modify our front-end so that it listens for these broadcasts and updates the user interface accordingly.

To implement this, an account in Pusher is created first and then an app with app credentials are generated. These credentials are saved into file named .env in the root directory of the project with the following content:

PUSHER_APP_ID="" PUSHER_APP_KEY="" PUSHER_APP_SECRET="" PUSHER_APP_CLUSTER=""

45 A package callled dotenv is used to pull environment variables from the .env file: then the routes/index.js is modified so the vote endpoint looks like this: router.post('/:pollId/vote', (req, res, next) => { const choice= req.body.choice; const identifier= `choices.${choice}.votes`; Poll.update({_id: req.params.pollId}, {$inc: {[identifier]:1}}, {}, (err, numberAffected) => { let Pusher= require('pusher'); let pusher= new Pusher({ appId: process.env.PUSHER_APP_ID, key: process.env.PUSHER_APP_KEY, secret: process.env.PUSHER_APP_SECRET, cluster: process.env.PUSHER_APP_CLUSTER });

let payload= { pollId: req.params.pollId, choice: choice }; pusher.trigger('poll-events', 'vote', payload, req.body.socketId); res.send(''); }); });

It can be noticed here that, a fourth parameter is included in the call to pusher.trigger. This is the socket ID, a unique identifier that Pusher assigns to each client connection. This means that every browser window where the application open will have its own socket ID. By passing the socket ID to pusher.trigger, it is ensured that the client with that ID will not get notified. This is on purpose since that client already updated its view after the Vote button was clicked and Add our listener to index.hbs.

Add the socket ID to the POST request:

var vote= function (event) { event.preventDefault(); var pollId= event.target.id; var choice= event.target.optionsRadios.value; axios.post('/'+ pollId+ '/vote', {choice: choice, socketId: socketId}); document.querySelector('#vote-btn-'+ pollId).disabled= true; var voteCount= document.querySelector('#vote-count-'+ pollId+ '-'+ choice);

46 voteCount.textContent++; voteCount.style.color= 'blue'; };

After starting the database and the app, and running the localhost in two browser windows, we can see that as answer button is clinked on one window, the change shows up in the other too.

47 Appendix B

SurveyJS Implementation

One common method in quantitative social research is through a survey. There are plenty of survey platforms available, and internet survey tools such as survey monkey and Google Forms has reduced the time and cost of data collection. Most provide free survey creation platform with some limitation in a number of questions created, respondents, customization and data export features on their free version plans.

In this thesis, another approach of creating online experiments for cultural evolution studies is tested. Hence, in addition to the web-based application, a survey application was developed as a second method of creating a web-based experiment and its functionalities were tested. The survey part allows users to create, test and preview surveys. Here, it is aimed to incorporate prominent features of existing survey applications as well as address some concerns for an online experiment. Some of the defining features observed include multipage multimedia surveys, question branching, a wide variety of question types, responsive surveys, Support for language and drag-and-drop editor.

In order to build the Survey application, a JSON based JavaScript library called Sur- veyJS was used. SurveyJS is an open-source JavaScript Survey library. It provides an option to modify the main object with additional functionality such as send and receive data to a server at any moment. The developed survey app is shown in Figure B.1.

Front-end and back-end technologies used for integrating survey.js

Front-end: Similar technologies used for building the web-based experiment application, discussed in system description of this thesis, were also used for creating the front-end.

48 Figure B.1: Survey editor developed using survey.js library.

Therefore, handlebars and Bootstrap4 were used.

Back-end: Integration of survey.js library into a site can be achieved in three ways. The first one involves completely using the library from the cloud and requires no integration effort. The second method uses survey.js API for integration, allowing more control in terms of making diff rent API requests. In addition, this method allows customization. The last integration method allows storing of data onto our server and provides more control on all aspects of the survey life cycle. The second method is implemented with an additional feature from the third method (integrating the visual builder).

Main features of survey.js library, integrated into the application

• It has 15 elements (questions and panels) from simple inputs like text and drop-down to Panel containers and dynamic matrix (table), that allows to build you complex forms.

• Multi-pages support.

• It is localized in many languages and supporting multilingual surveys/forms (one survey for several languages).

• Control survey flow by setting visibility expression for pages, panels, questions and even individual items in check-boxes, radio groups and drop-downs.

• Fill data for check-boxes, radio groups and drop-downs from web services.

49 • Validate user inputs with several built-in validates.

• Show results in a read-only survey.

• Many pre-built solutions include free subscriptions but, as expected, these tiers come with all sorts of limitations, from the number of responses that are supported to the use of the actual surveys (personal or business).

• It is compatible with many different libraries and technologies. You can combine SurveyJS with the ever-popular jQuery or go with Angular2, Knockout, React, or Vue options.

50 Appendix C

Images Used for the Experiment

Color Optical Illusion

The orange bar on the right appears to be darker than the one on the left. In fact, they are the same color, but the po- sitioning of the orange bar on the green and white stripes make it look otherwise.

Source: https://www.pinterest.ph/pin /380483868511222469/

Figure C.1: Color Optical Illusion

51 M¨uller-Lyer illusion

Straight line segments of equal length comprise the ”shafts” of the arrows, while shorter line segments (called the fins) protrude from the ends of the shaft. The fins can point inwards to form an arrow ”head” or outwards to form an ar- row ”tail”. The line segment forming the shaft of the arrow with two tails is per- ceived to be longer than that forming the shaft of the arrow with two heads. The il- lusion was devised by Franz Carl M¨uller- Figure C.2: M¨uller-Lyer illusion Lyer.

Source: https://www.illusionsindex.org /ir/mueller-lyer

Scintillating grid

Black dots appear to form and vanish at the intersections of the gray horizontal and vertical lines. When focusing atten- tion on a single white dot, some gray dots nearby and some black dots a little fur- ther away also seem to appear. More black dots seem to appear as the eye is scanned across the image (as opposed to focusing on a single point). The illusion is known as the scintillating grid and was discovered by Micheal Schruf and Wist [1997]. Figure C.3: Scintillating grid Source: http://mathworld.wolfram.com/ ScintillatingGridIllusion.html

52 Cafe wall illusion

In this cafe wall illusion the parallel straight horizontal lines appear to be bent. Important is that each ”brick” is surrounded by the grey line, so a color in between the dark and light color of the ”bricks”.

Source: http://brainden.com/line-illu sions.htm

Figure C.4: Cafe wall illusion

Color dogs

Yellow Dog vs Blue Dog - both of them have the same color. The only differ- ence is the background. What our brain is doing is compensating for the bright- ness, colors, etc., of the background and adding/subtracting information to liter- ally create the “correct” color. The wave- lengths of light hitting your eye might be objective, but color perception certainly is not. Figure C.5: Color dogs Source: http://brainden.com/line- illusions.htm

53 Identical colors

Surface color of both A and B parts is identical.

Source: http://brainden.com/line-illu sions.htm

Figure C.6: Identical colors

Adelson’s Checkers Shadow

Developed by Adelson[1993], Professor of Vision Science at MIT. This illusion highlights the importance of colors too, but more so how the brain adjusts colors when shadows are present. Squares A and B are the same color.

Source: http://brainden.com/line-illu sions.htm

Figure C.7: Adelson’s Checkers Shadow

54 Rotating snakes

Circular snakes appear to rotate “spon- taneously”. It was designed by Akiyoshi KITAOKA.

Source: http://brainden.com/eye-illus ions.htm

Figure C.8: Rotating snakes

Ehrenstein illusion

The Ehrenstein illusion is an optical illu- sion studied by the German psychologist Walter Ehrenstein in which the sides of a square placed inside a pattern of con- centric circles take an apparent curved shape.

Source: http://blog.visme.co/best-opt ical-illusions/

Figure C.9: Ehrenstein illusion

55 Shepherd’s table

Roger Shepard a cognitive scientist cre- ated this drawing. On the first look of the drawing, the first table looks thin and long while the second look short and squat. However, with a closer look proved that the tables are actually equal in size and shape.

Source: http://brainden.com/line-illu sions.htm Figure C.10: Shepherd’s table

The Ebbinghaus illusion

The Ebbinghaus illusion or Titchener cir- cles is an optical illusion of relative size perception. Named for its discoverer, the German psychologist Hermann Ebbing- haus.

Source: https://www.illusionsindex.o rg/ir/ebbinghaus-illusion

Figure C.11: The Ebbinghaus illusion

56 Hering illusion

This image suggests that the horizontal lines are bent, however, the distortion is caused by the background that simulates perspective and thus false depth percep- tion is created. This illusion was discov- ered by Ewald Hering.

Figure C.12: Hering illusion

57