On the Origin of Human Behavior

Numerous behavioral and decision-making theories have been proposed within various branches of physiology, psychology, and social sciences. However, few authors have studied the origin of behavior. It has been suggested that human behavior can be described as an algorithm, defining an action-execution process through a sequence of steps and feedback mechanisms. Given this premise, origins of human behavior are comparatively assessed to other forms of nature; to facilitate this comparison, algorithms were developed to sequence the functionality of inanimate matter (i.e. motionless or inoperative matter) and animate life (i.e. living organisms). Subsequently, the three developed algorithms – for matter, life, and mind – allowed to identify both their common and unique features, as well as to follow the evolutionary flow between the physical, biological, and psychological dimensions of nature. We postulate that algorithms of behavior of physical objects, biological organisms, and human beings are not standalone constructs but phases of the evolutionary process. Furthermore, in this evolutionary process, algorithms are continuously adjusted and enhanced through the addition of new steps and feedback mechanisms. The underlying commonality for these changes in behavior is rising prominence of future-orientation of actions, e.g., when an organism increasingly caters for its future well-being, rather than solely enhancing its transient state. This transformation takes place through shifts from immediate and predetermined reactions, to longer-term orientated and variable responses. Throughout this process, functional algorithms of higher complexity do not invalidate predecessors, but on the contrary, incorporate and build on them. The presented theory offers an explanation on how, and to what extent, operational algorithms are shared between various forms of nature. It also considers possible future directions for evolutionary development.

Some of the most advanced models of human behavior were based on the theory of cognition. Certain perspectives have become particularly influential (Bryant, 2004), i.e. Goal-Directed Cognition, Constructivist Understanding, Mental Modelling, and Critical Thinking. Proponents of the Goal-Directed Cognition theory emphasize that solving complex problems depends on clearly identifying goals and sub-goals, and effectively planning the means to achieve them. One of the pioneers of Goal-Directed Cognition was Allen Newell, a researcher who started his career studying U.S. Air Force operations, and later moved into the fields of cognitive psychology and artificial intelligence. Within the framework of these concepts, human cognition is modelled as a system consisting of memory, decision-making, and goal blocks, which receive input from the perceptual (sensory) subsystem and provides output to the motor (execution) subsystem [e.g., Newell & Simon, 1972;Newell, 1990;Jansson, 1999).
The key premise of the Constructivist perspective (Bryant, 2004) is that human experience and understanding of the world is not an absolute truth; instead, it is our best attempt to explain the data our senses have gathered and to provide a mental model that can be used to plan actions (e.g., Rock, 1993). Individuals may not be aware of the hypothetical nature of perceptual experience, but that is only because cognitive systems are an evolutionary legacy highly tuned to our natural environment.
Mental models take their structure from the structure of the system modelled (Bryant, 2004), which can be as simple as, for example, a visual image of a tree, or as complex as a model of a tree's biological functioning. Consequently, mental models of different systems exhibit different characteristics depending on the complexity of the system and the demands of the individual's task (Moray, 1999). Mental models continuously adjust to represent the current state of the system or situation (e.g., Hatano & Inagaki, 2000). This situational representation can be used to evaluate the current state in relation to desired goal states and serve as a working model for simulating effects of potential actions.
Critical Thinking (e.g., Brehmer, 1986) is similar to hypothesis testing in science (Bryant, 2004). Critical thinking performs the role of hypothesis testing by calling into question elements of the mental model and motivates one to look for evidence that may potentially contradict one's initial beliefs. This leads to potentially disconfirming evidence and necessitates some revision or re-thinking of a problem or one's strategy for solving it. The critical thinking perspective correlates with the concept of the "scientific method", defined as a process beginning with the formulation of a question and subsequent development of hypotheses, predictions, and testing (e.g., Kuhn & Hacking, 2012).
Control Theory in psychology is another branch that deals with human behavior and provides an explanation of how "control" works, both in non-living and living systems. The theory was developed in parallel with the development of the cognition models. According to Mansell and Marken (2015) initially two main approaches emerged within the framework of control theory in psychology, i.e. the "grand theory" and the "man machine systems" approaches.
The grand theory views control theory as a general model of all behavior (e.g., Wiener, 1948), much like the S-R model of the behaviorists or the information-processing model of the cognitive theories. The man-machine systems approach, on the other hand, views control theory as a tool for analyzing human performance in "closed-loop" tasks, much like information theory is used as a tool for analyzing the results of perceptual experiments (e.g., Attneave, 1954). Alternative views are held by the proponents of the self-regulation models, particularly, the Perceptual Control Theory (PCT), formulated by William T. Powers (1973). Powers defines behavior as control of perception, and his theory explains how goal orientated behavior (control) works. It places the specification for the goal state of a behavioral result inside the organism itself, which is a unique feature of the PCT approach.
The referenced concepts of behavior were all developed for diverse applications in various branches of science, based on different theoretical paradigms and using different terminology. Nevertheless, generically they all incorporate crucial common features. With a very few exceptions, most models of human behavior explicitly address the role of goals. The author would argue that even models that do not explicitly reference goals (e.g., OODA, S-R) still imply that actions are executed for the sake of achieving a predefined benefit. In all concepts, behavior is conceptualized as a sequence of actions, where each action has a start and end point. The starting point is always a stimulus, which triggers the response and initiates information processing. The closure of an action entails the existence of achievement criteria defining its success. Some models (e.g., PCT) include a feedback loop linking the action result back to the stimulus. With the exclusion of early S-R theories, all models postulate an active role of the organism or individual in relation to the definition of desired states, signal assessment, and planning of activities.

Overview of the Modified Algorithm
Thorough assessment of human behavior requires an understanding of the general mechanisms behind initiating, controlling, and gratifying human actions. We present an algorithm of human behavior which was developed within the premise of the new concept of "subjective well-being" (Kopsov, 2019a). Since initially presenting the algorithm, we have further modified it to refine interrelations between some of its components. The diagram shown in Figure 1 represents the modified version of the algorithm, which we subsequently summarize. In all situations and in all moments, individuals experience a range of intrinsic and extrinsic body signals. Upon detection, each signal is immediately subjected to an assessment to determine whether it is relevant to the satisfaction of any dominant need. If the relevance of the signal is confirmed, the following step is to plan an adequate action. Subsequently, an initial plan is developed, and risk analysis is performed for possible action scenarios. Planning and risk analyses are carried out based on life experiences, which also include attitudes, norms, and perceived behavioral control (Fishbein & Ajzen, 2010). The individual rates the likelihood of potential gains and losses of an action against the criticality of a given need. In most instances, a decision is subsequently driven by the outcome of the evaluation of the estimated energy expenditure versus expected utility gain. The analysis also addresses potential consequences of the outcome of worst-case scenarios. If a goal can be achieved in various ways, multiple iterations between the risk analysis and the planning steps may be required prior to determining a forward path. If potential gains are assessed as substantial, possible failures manageable, and estimated energy expenditure acceptable, the individual proceeds to action-execution based on the predetermined plan. Otherwise, if risk criteria are not met the potential action is abandoned.
New signals are received and evaluated as the action progresses, and behavior is subsequently readjusted accordingly with new information obtained. Human life is a continuous chain of actions executed in accordance with the described standard algorithm. However, it is important to emphasize that actions are ascribed not in a behavioristic way but within a broader context, where actions act as responses to an entire range of physiological, psychological and social needs, including needs of eudaimonic dimensions.
Besides the execution sequence "signal detectionappraisalplanrisk analysisaction", the behavioral algorithm includes regulating blocks controlling the appraisal, plan, and risk analysis steps, i.e. a catalogue of dominant needs and an experiences database.

Future-Orientation of the Algorithm of Human Behavior
Many of actions are undertaken in the interest of attaining future gains. However, this is not the only way future-orientation manifests itself through the algorithm of human behavior. Its future perspective goes beyond the domain of actions and covers human aspirations.

ORIGIN OF HUMAN BEHAVIOR 8
A study of the experiences of individuals performing daily chores showed that almost half the time people are not fully concentrated on their activities (Killingsworth & Gilbert, 2010).
Nevertheless, even when individuals are not fully engaged in the implementation of their actions, they continue to be aware of their dominant needs. The key difference is that many of these needs are projected needs that may require action in the future. It is plausible that the sequence of algorithmic steps in response to projected future needs is the same as for momentary needs except for the implementation stage, which is left out. Therefore, risk assessment is the concluding step of the behavioral algorithm for projected future needs. Regarding future actions, planning can only be done to a limited extent. Unlike planning, risk analysis represents a decision-making gate implying application of different and, at times, contradicting criteria. In the case of projected needs, the algorithm of human behavior manifests itself not through the outcome of actions, but through future-orientated aspirations, intentions, and self-assessments enabled by analysis of risks. This is one of the primary reasons why risk analysis is defined as a standalone step within the behavioral algorithm, as it allows to capture a wholly comprehensive psychological state of an individual without limiting it solely to action bound deeds. Otherwise, risk assessment and planning steps could have been combined into a single step as is done by many authors (e.g., Galperin, 1976). By addressing the case of projected needs the algorithm in Figure 1 allows to capture a multitude of future-orientated perspectives of human personality, such as deeds in anticipation of potential benefits (e.g., bringing umbrellas in chance of rain), as well as mental aspirations and hopes.

Levels of Complexity and Categories of Nature
Since Aristotelian times people have distinguished between specific categories of nature.
Seeing the world as consisting of different levels of complexity is fundamental to many branches of science. For instance, Sellars (1926) identified these levels as: inanimate matter, animate nature, mind, and society/persons/civilization. Such views were echoed by Henriques (2003) The algorithm presented in Figure 1 attends to human and animal behavior. We hypothesize that it has a more profound nature and relates to the functionality of other forms of life and matter. In this section we examine similarities and differences between the algorithm of human behavior and the process of functionality of physical objects and biological organisms.

Algorithm of Functionality of Physical Objects
Interactions of objects of an inanimate nature are governed by the S-R principle; an action onto an object causes a reaction. Accordingly, Figure 2 demonstrates an algorithm of functionality of inanimate matter, which contains "signal" and "act" steps. However, not all signals trigger a reaction. To account for these, the algorithm includes a "detect" step. The "detect" step acts as a filter for various signals for which inanimate substances are exposed to, so that only specific signals cause a response, as for example, iron is affected by magnetic fields, whilst aluminum is not. In other instances, the "detect" step represents a threshold barrier for signal strength, as some interactions require a certain energy barrier to be exceeded in order to enable a response. The detection step of the algorithm manifests itself through the properties of materials. The algorithm also includes a feedback link defining the effect of the action on the source of the stimulus and the outside environment.
We hypothesize that the proposed algorithm sequence of "signal-detect-act" exemplifies a comprehensive order of inanimate matter functionality and embroils multiple laws of physics, chemistry, and mechanics. Typical examples of such laws are the "third law of motion", which states that for every action (force) in nature there is an equal and opposite reaction, "Coulomb's law" of electromagnetism, which quantifies the amount of force between two electrically charged particles, and the "law of definite proportions" in chemistry, which states that a given chemical compound always contains its component elements in a fixed ratio.

Algorithm of Functionality of Biological Organisms
The functionality of animate species, for example plants, goes beyond simple detection of signals or determination of their strength, which is typical for inanimate matter. Biological

Evolutionary Development of Algorithms
The algorithm of human behavior (Figure 1)  The evolutionary trend towards future-orientation of the algorithm of behavior occurs alongside enhancement of capabilities in information processing and storage. In a familiar pattern, information processing at lower levels becomes integrated into more advanced and complex systems (Henriques, 2011). Information handling emerges in the material matteras the atomic arrangement by itself represents a record of information. Biological organisms, whilst absorbing inanimate nature properties, acquire a more advanced genetic information handling capability.
Animals and humans capitalize on the genetic system and develop psyches and minds enabled by neuronal information processing.
It can be argued that each domain of complexity is enabled through the emergence of specific modules of the algorithm. The "detect" module in the algorithm of physical objects is associated with the arrangement of subatomic particles and represents key material properties.
The emergence of the "appraise" function within the algorithm correlates with the formation of biological organisms. Planning and risk assessment modules enable psyche and mind.
Earlier, we showed that the evolutionary process may be assessed through analysis of the evolvement of human needs (Kopsov, 2019b), which play a magnitude of important roles within functionality algorithms, and can be characterized as the "engines" of the algorithm, triggering our activities. Needs also provide criteria for defining the success of our actions. An action is proven successful if through the action a need is met. However, needs continuously adjust to enable adaptation to changes in life circumstances. Needs are not uniquely attributed to animals and humans. From the behavioral perspective, humans' need for water is not different from that of a plant. The assessment of needs within the evolutionary process can offer a common basis for description of different life forms, which otherwise may appear to be completely unrelated.
It is most plausible that evolution is an ongoing process and that humankind and nature in general continue to evolve. Thus far, identifying common trends in the evolvement of algorithms has allowed us to hypothesize the evolutionary developmental flow between the dimensions of reality (i.e. matter, life, and cognitive mind). This common trend should also provide a view on potential directions of future evolution, going beyond the dimension of the cognitive mind. Through forwards extrapolation of defined common traits, it may be proposed that the algorithm of behavior will continue to evolve, and its complexity will increase though the following alterations: • Addition of new steps, • Addition of new feedback mechanisms, • Increasing future-orientation.
These changesadditional steps and feedback mechanismsmay result in the emergence of new levels of complexity. In such a scenario, existing systems will remain in their current form and as integral parts of future functionality algorithms.
The defined trends of algorithmic development can also be applied retrospectively. The most basic amongst the discussed cases is the algorithm of physical bodies (Figure 2). However, even that algorithm is characterized by a degree of complexity, i.e. signal detection and information recording (through the atomic arrangement). Such features reflect variations in material substances and their properties. It may be argued that there exists an even more basic version of the algorithm, which represents a state with limited or no variation in a material's nature, which would indicate a fully homogeneous state of the matter within highly unified field of stimuli. This could be a truly S-R algorithm containing only "signal" and "action" steps.

Correlations with Other Theories
The proposed sequence of algorithmic evolvement has a universal character as it unites material, living, and mental perspectives of reality. In that regard it relates to the concept of the unified theory of knowledge, which has been contemplated by physicists, biologists, psychologists, and philosophers; and which attempts to unite the sciences and, possibly, humanities in one system of knowledge. In Consilience: The Unity of Knowledge, Wilson (1999) theorizes a synthesis of natural sciences, social sciences, and humanities. At the core of his concept is the idea of sociobiology, of which physical sciences act as the foundation, and subsequently, evolutionary biology acts as a discipline which paves way for understanding human and animalistic social behavior. Hawking (1988) stated that ultimate ambition of science is "a complete understanding of the events around us, and of our own existence". Humankind "know the basic laws that underlie all of chemistry and biology. Yet we … had little success in predicting human behavior from mathematical equations!" In the apparent reference to similarities between material and living forms, Hawkins defines laws of nature as the "laws of the behavior" of matter. However, use of mathematical methods for psychological application was only declared as a goal, and not detailed further.
The idea of a universal nature of the phenomenon of behavior is echoed by Henriques (2011), who argued that behavior is not a unique feature of animals and humans. He ascertained that in a same way as psychologists study human behavior, "chemists study the behavior of molecular objects; biologists study the behavior of living objects", and the "most general definition of behavior is change in an object-field relationship". From such a perspective any S-evolution of complexity "corresponds to a new dimension of algorithmic information sparked by a complexity building feedback loop." He stops short of defining either the algorithms or direction of the feedback mechanisms.
The main obstacle on the path to validating the unified theory of knowledge is methodological disparity between different branches of knowledge. The proposed concept of behavioral unification is generated within a common premise of process modelling and eliminates the need for mitigation between various paradigms. Methodology of process modelling itself is in very advanced stages of development and is used in many applications, not least, in computer simulations, digitalization and artificial intelligence. This paves way for computer modelling of the evolvement of matter and life.
The proposed theory radically reduces the number of variables that need to be considered in the model of the evolvement process. Cosmogenesis has resulted in an immense variety of material substances and life forms, characterized by a vast range of properties. In comparison, the number of elements forming behavioral algorithms is negligible. The posited algorithms of behavior (Figures 1,2, and 3) represent a high-level summary. For more detailed analysis, they must be split into a network of components and subcomponents, as is discussed in more detail in section 5. Nevertheless, even an expanded matrix of algorithmic elements will remain compact, making it well-suitable for the modelling of cosmic evolution.
Another feature of the proposed theory is the ability to address the issue of integration between dimensions of complexity. The ToK system defines links between dimensions of complexity as joint points. The joint points "matter-life" and "life-mind" are characterised by conflicting attributes. At one hand they signify continuity of evolutionary development, on the other they constitute discontinuity of paradigms. In Henriques' words "everything that is psychological is biological" and "everything that is biological is also physical" (Henriques, 2003).
Nevertheless, the laws of physics have limited application in biology and the laws of biology are hardly used in psychology. To account for this contradiction the theory carries a notion of twofold integration of dimensions of complexity, which can be referred to as appropriation and incorporation mechanisms. The first type of integration occurs through appropriation of lower domains of complexity by higher ones. It manifests itself through a revolutionary change in cosmic evolution and introduction of new laws of behavior, reflecting the emergence of new components in behavioral algorithm. The second type of integration occurs through the incorporation of lower domains of complexity into higher ones. It manifests itself through coherent, progressive evolvement of behavioral patterns. In this way, the algorithmic tree of psychological processes includes components of the algorithms' logic of biological processes and, underlying this again, of physical processes.
The twofold model of integration of domains of complexity sheds light on the validity of cross referencing between the laws of different domains of science. Perhaps the most frequent occurrences of such cross-references are related to the "second law of thermodynamics", which has been used when to explain human behavior (e.g., Boyd, 1976;Hawking, 1998) and social processes (e.g., Gumilev, 2002). In most instances these parallels are offered without any further justification. The proposed notion that the algorithm of human behavior (Figure 1) incorporates the algorithm of behavior of inanimate matter (Figure 2), allows for a way of linking laws of physics and psychology. However, application of the "second law of thermodynamics" to cases in social sciences still remains a supposition and would require more careful evaluation.
In summary, the proposed theory of the evolvement of the algorithm of behavior further develops upon existing ideas of approaching behavior as a universal feature of matter and life. It details behavioral processes based on ideas of using mathematical and algorithmic modelling (Hawking, 1988;Henriques, 2011), and caters for methodological unity in the description of different phases of cosmic evolution. In doing so, it limits the number of variables involved and provides a consolidated view on the origin of various domains of nature.

Limitations and Future Research
The proposed theory of the origin of human behavior represents a theoretical construct and requires validation through further research and testing. This can be achieved, for example, by verification of the stated predictions. In section 3.4 we suggest that the proposed concept can be used to develop models for both retrospective and forward-looking phases of cosmic evolution.
Retrospective analyses may be focused towards existing knowledge and theories, by investigating if algorithms derived through backwards extrapolation correlate to properties exhibited by the matter as it existed during earlier phases of universe formation. If the proposed principles of transformation of the algorithm of behavior are applied in reverse, then modules of the algorithm must be removed from the "signal-detect-act" functionality schematics of physical objects ( Figure   2). As referenced earlier, the expected result would be a behavioral process without the "detect" step and without information recording features. That would imply the existence of highly homogeneous matter, in which state all S-R interactions are indistinguishable. The question would remain if this algorithm would be truly descriptive of the functionality of subatomic particles and primordial gases which made up the universe prior to the origin of known materials. Further extensions of this extrapolation may prove that the emergence of the generic S-R mechanism corresponds to the moment of the birth of the universe.
The presented study is based on the analysis of behavioral phenomena for matter, life, and mind. The subject of modelling social processes is outside the scope of the paper. However, it would be interesting to evaluate if the proposed concept can be applied in deriving an algorithm for social processes. Modelling of social processes would represent a forward extrapolation of defined development traits. If this proposed theory is truly universal, then it must be able to address the case of group behavior.
The proposed algorithms represent a high-level summary of behavioral processes and contain a degree of generalization. It is evident that all modules of derived algorithms consist of components and subcomponents. In section 3.3 we discuss how, for example, the "detect" module through its evolvement acquires biological and then psychological features. The same happens to other components of behavioral schematics of life and mind (Figures 2, 3). For instance, the experience database module in Figure 3 incorporates both biological genetic encoding and mental brain memory. The latter includes long-term memory, short-term memory, and sensory memory (Camina & Güell, 2017). These are further split into second and third tier subcomponents.
Clarification of the compounded arrangement of modules would be required for specific applications of algorithms. This can be especially essential when physiological and biological processes are conjoined.
The applied taxonomy of categories of nature (physical, biological, psychological, social) is not the only one in existence; alternative hierarchical classifications consists of subatomic particles, atoms, molecules, cells, organ structures, multi-celled organisms, consciousness, and society. The advantage of using the selected classification is that it closely correlates with classes of science. Nevertheless, adaptation of the proposed sequence of the origin of behavior may be required to account for alternative rankings of categories of nature.

Conclusion
We present a new concept of the origin of human behavior. The phenomenon of behavior is approached not as a unique feature of animals and humans, but as a general attribute of material substances and life. Algorithms of functionality of physical objects and living organisms are derived in accordance with the method previously applied for the description of human behavior.
The outcome of this is a series of algorithms representing various dimensions of complexity of reality (matter, life, and mind). Comparative analysis of the algorithms allows to establish a set of generic traits for the transition of matter to life, and from life to mind. We demonstrate that these transitions are characterized by certain common features: (a) preservation of components of the algorithm of lower complexity and enhancement of their functionality; (b) introduction of new algorithmic components and new feedback mechanisms; (c) emergence of new information processing methods, and; (d) increasing future-orientation of actions. We theorise that these algorithms are not standalone constructs, but stages in sequential evolvement of the phenomenon of behavior. In this regard, human behavior originates through transformation of functionality of biological organisms and, ultimately, of material bodies.
The proposed concept offers a new perspective on the unified theory of knowledge.
Notably, it eliminates methodological disparity between different classes of science by applying a single paradigm of process modelling. In doing so, it radically reduces the number of variables that need to be considered in the assessment of cosmogenesis. Furthermore, the new concept defines a twofold mechanism of evolvement, which occurs through both appropriation and incorporation of lower domains of complexity into higher ones. Establishing common rules for evolvement allows for the development of models for both retrospective and forward-looking stages of cosmic evolution. The theory can be further validated if successfully applied to modelling of social processes.