Python Program Example: Simple Population Simulation

eJournal: uffmm.org, ISSN 2567-6458, 30.Dec 2018
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

CONTEXT

In a preceding post I have described a simple way to install the python software as part of a integrated development environment. In this post I show a simple program to simulate the increase/ decrease of a population with nearly no parameters. It can be used as a starting point for further discussions and developments.

HOW TO MAKE IT

Of one has installed (in case of windows) the winpython software as described above and one has selected the ‘spyder.exe’ module from the folder of the winpython software) either directly (by double clicking) or one clicks the icon on the task bar (which one has placed there before), then one has the spyder working environment on the screen.

spyder software screen appearance
spyder software screen appearance

In the left subscreen one can now edit the program (by copy th source code below and paste it into the window) and then one can test the software by clicking on the green run button (alternatively: pressing F5).

Then the python console will be activated in the sub-window in the lower right corner. One has to enter the required values. After the input the console window will show the numbers as well as the graph.

THE PROGRAM SOURCE CODE

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
“””
Created on Wed Jan 2 19:34:43 2019

@author: gerd doeben-henisch
Email: gerd@doeben-henisch.de
“””

##################################
# pop1()
###################################
#
# IDEA
#
# Simple program to compute the increase/ decrease of a population with
# the parameters population number (p), birth-rate (br), death-rate (dr),
# mirgration Plus (migrPlus), and migration Minus (migrMinus)
#

#######################################
# Used modules

import matplotlib.pyplot as plt
import numpy as np

#########################################
# Defining a function pop1()

def pop1(p,br,dr,migrPlus,migrMinus):

p=p+(p*br)-(p*dr)+migrPlus-migrMinus

return p

###################################
# Asking for input values
#
# input() creates a strng which has to be converted into an int()

baseYear = int(input(‘Basisjahr als Zahl ? ‘))

p = int(input(‘Bevölkerung als Zahl ‘))

br = float(input(‘Geburtenrate in % ‘))

dr = float(input(‘Sterberate in % ‘))

migrPlus = int(input(‘Zuwanderung Zahl ‘))
migrMinus = int(input(‘Abwanderung Zahl ‘))

n = int(input(‘Wieviele Jahre voraus ? ‘))

############################################
# processing the data
#
# creating a range called ‘run’ for the years to compute

run = np.arange(1, n+1, 1)

####################################
# pop is a ‘list’ to collect the pop-values for every year

pop = []

########################################
# The first element of pop is the base year
pop.append(p)

######################################
# Compute the changing values for the population p and store these in pop
# Use for this computation the function pop1() defined before

for i in run:
p=pop1(p,br,dr,migrPlus,migrMinus)
pop.append(p)

##############################################
# Print the content of pop for the user to show
# the different years with their pop-values

for i in range(n+1):
print(‘Jahr %5d = Einw. %8d \n’ %(baseYear+i, pop[i]) )

##############################################
# Make the numbers visible as a graph

plt.figure(1)
plt.axis([0, len(run)+1, 1, max(pop)])

run2 = np.arange(0, n+1, 1)
plt.plot(run2, pop, ‘bo’)

plt.show()
plt.close()

EXAMPLE RUNS

EXAMPLE 1

Shows a population with a lower birth rate than death rate but a positive migration outcome. (Bevölkerung = population, Zahl = number, Gebrtenrate = biirth rate, Sterberate = death rate, Zuwanderung = migration plus, Abwanderung = migration minus, Wieviele Jahre voraus = how many years forcasting)

Bevölkerung als Zahl 1000

Geburtenrate in % 0.15

Sterberate in % 0.17

Zuwanderung Zahl 200

Abwanderung Zahl 100

Wieviele Jahre voraus ? 20

Jahr 2019 = Einw. 1000

Jahr 2020 = Einw. 1080

Jahr 2021 = Einw. 1158

Jahr 2022 = Einw. 1235

Jahr 2023 = Einw. 1310

Jahr 2024 = Einw. 1384

Jahr 2025 = Einw. 1456

Jahr 2026 = Einw. 1527

Jahr 2027 = Einw. 1596

Jahr 2028 = Einw. 1665

Jahr 2029 = Einw. 1731

Jahr 2030 = Einw. 1797

Jahr 2031 = Einw. 1861

Jahr 2032 = Einw. 1923

Jahr 2033 = Einw. 1985

Jahr 2034 = Einw. 2045

Jahr 2035 = Einw. 2104

Jahr 2036 = Einw. 2162

Jahr 2037 = Einw. 2219

Jahr 2038 = Einw. 2275

Jahr 2039 = Einw. 2329

example 1 - increasing population
example 1 – increasing population

EXAMPLE 2

Shows a population with a lower birth rate than death rate and a negative migration outcome. (Bevölkerung = population, Zahl = number, Gebrtenrate = biirth rate, Sterberate = death rate, Zuwanderung = migration plus, Abwanderung = migration minus, Wieviele Jahre voraus = how many years forcasting)

Basisjahr als Zahl ? 2019

Bevölkerung als Zahl 1000

Geburtenrate in % 0.15

Sterberate in % 0.17

Zuwanderung Zahl 100

Abwanderung Zahl 120

Wieviele Jahre voraus ? 30
Jahr 2019 = Einw. 1000

Jahr 2020 = Einw. 960

Jahr 2021 = Einw. 920

Jahr 2022 = Einw. 882

Jahr 2023 = Einw. 844

Jahr 2024 = Einw. 807

Jahr 2025 = Einw. 771

Jahr 2026 = Einw. 736

Jahr 2027 = Einw. 701

Jahr 2028 = Einw. 667

Jahr 2029 = Einw. 634

Jahr 2030 = Einw. 601

Jahr 2031 = Einw. 569

Jahr 2032 = Einw. 538

Jahr 2033 = Einw. 507

Jahr 2034 = Einw. 477

Jahr 2035 = Einw. 447

Jahr 2036 = Einw. 418

Jahr 2037 = Einw. 390

Jahr 2038 = Einw. 362

Jahr 2039 = Einw. 335

Jahr 2040 = Einw. 308

Jahr 2041 = Einw. 282

Jahr 2042 = Einw. 256

Jahr 2043 = Einw. 231

Jahr 2044 = Einw. 206

Jahr 2045 = Einw. 182

Jahr 2046 = Einw. 159

Jahr 2047 = Einw. 135

Jahr 2048 = Einw. 113

Jahr 2049 = Einw. 90

example 2 - decreasing population
example 2 – decreasing population

QUANTUM THEORY (QT). Basic elements

eJournal: uffmm.org, ISSN 2567-6458, 2.January 2019
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email:
gerd@doeben-henisch.de

CONTEXT

This is a continuation from the post WHY QT FOR AAI? explaining the motivation why to look to quantum theory (QT) in the case of the AAI paradigm. After approaching QT from a philosophy of science perspective (see the post QUANTUM THEORY (QT). BASIC PROPERTIES) giving a ‘birds view’ of the relationship between a QT and the presupposed ‘real world’ and digging a bit into the first person view inside an observer we are here interested in the formal machinery of QT. For this we follow Grifftiths in his chapter 1.

QT BASIC ELEMENTS

MEASUREMENT

  1. The starting point of a quantum theory QT are ‘phenomena‘, which “lack any description in classical physics”, a kind of things “which human beings cannot observe directly”. To measure such phenomena one needs highly sophisticated machines, which poses the problem, that the interpretation of possible ‘measurement data’ in terms of a quantum theory depends highly on the understanding of the working of the used measurement apparatus. (cf. p.8)
  2. This problem is well known in philosophy of science: (i) one wants to built a new theory T. (ii) For this theory one needs appropriate measurement data MD. (iii) The measurement as such needs a well defined procedure including different kinds of pre-defined objects and artifacts. The description of the procedure including the artifacts (which can be machines) is a theory of its own called measurement theory T*. (iv) Thus one needs a theory T* to enable a new theory T.
  3. In the case of QT one has the special case that QT itself has to be part of the measurement theory T*, i.e. QT subset T*. But, as Griffiths points out, the measurement problem in QT is even deeper; it is not only the conceptual dependency of QT from its measurement theory T*, but in the case of QT does the measurement apparatus directly interact with the target objects of QT because the measurement apparatus is itself part of the atomic and sub-atomic world which is the target. (cf. p.8) This has led to include the measurement as ‘stochastic time development’ explicitly into the QT. (cf. p.8) In his book Griffiths follows the strategy to deal with the ‘collapse of the wave function’ within the theoretical level, because it does not take place “in the experimental physicist’s laboratory”. (cf. p.9)
  4. As a consequence of these considerations Griffiths develops the fundamental principles in the chapters 2-16 without making any reference to measurement.

PRE-KNOWLEDGE

  1. Besides the special problem of measurement in quantum mechanics there is the general problem of measurement for every kind of empirical discipline which requires a perception of the real world guided by a scientific bias called ‘scientific knowledge’! Without a theoretical pre-knowledge there is no scientific observation possible. A scientific observation needs already a pre-theory T* defining the measurement procedure as well as the pre-defined standard object as well as – eventually — an ‘appropriate’ measurement device. Furthermore, to be able to talk about some measurement data as ‘data related to an object of QT’ one needs additionally a sufficient ‘pre-knowledge’ of such an object which enables the observer to decide whether the measured data are to be classified as ‘related to the object of QT. The most convenient way to enable this is to have already a proposal for a QT as the ‘knowledge guide’ how one ‘should look’ to the measured data.

QT STATES

  1. Related to the phenomena of quantum mechanics the phenomena are in QT according to Griffiths understood as ‘particles‘ whose ‘state‘ is given by a ‘complex-valued wave function ψ(x)‘, and the collection of all possible wave functions is assumed to be a ‘complex linear vector space‘ with an ‘inner product’, known as a ‘Hilbert space‘. “Two wave functions φ(x) and ψ(x) represent ‘distinct physical states’ … if and only if they are ‘orthogonal’ in the sense that their ‘inner product is zero’. Otherwise φ(x) and ψ(x) represent incompatible states of the quantum system …” .(p.2)
  2. “A quantum property … corresponds to a subspace of the quantum Hilbert space or the projector onto this subspace.” (p.2)
  3. A sample space of mutually-exclusive possibilities is a decomposition of the identity as a sum of mutually commuting projectors. One and only one of these projectors can be a correct description of a quantum system at a given time.cf. p.3)
  4. Quantum sample spaces can be mutually incompatible. (cf. p.3)
  5. “In … quantum mechanics [a physical variable] is represented by a Hermitian operator.… a real-valued function defined on a particular sample space, or decomposition of the identity … a quantum system can be said to have a value … of a physical variable represented by the operator F if and only if the quantum wave function is in an eigenstate of F … . Two physical variables whose operators do not commute correspond to incompatible sample spaces… “.(cf. p.3)
  6. “Both classical and quantum mechanics have dynamical laws which enable one to say something about the future (or past) state of a physical system if its state is known at a particular time. … the quantum … dynamical law … is the (time-dependent) Schrödinger equation. Given some wave function ψ_0 at a time t_0 , integration of this equation leads to a unique wave function ψ_t at any other time t. At two times t and t’ these uniquely defined wave functions are related by a … time development operator T(t’ , t) on the Hilbert space. Consequently we say that integrating the Schrödinger equation leads to unitary time development.” (p.3)
  7. “Quantum mechanics also allows for a stochastic or probabilistic time development … . In order to describe this in a systematic way, one needs the concept of a quantum history … a sequence of quantum events (wave functions or sub-spaces of the Hilbert space) at successive times. A collection of mutually … exclusive histories forms a sample space or family of histories, where each history is associated with a projector on a history Hilbert space. The successive events of a history are, in general, not related to one another through the Schrödinger equation. However, the Schrödinger equation, or … the time development operators T(t’ , t), can be used to assign probabilities to the different histories belonging to a particular family.” (p.3f)

HILBERT SPACE: FINITE AND INFINITE

  1. “The wave functions for even such a simple system as a quantum particle in one dimension form an infinite-dimensional Hilbert space … [but] one does not have to learn functional analysis in order to understand the basic principles of quantum theory. The majority of the illustrations used in Chs. 2–16 are toy models with a finite-dimensional Hilbert space to which the usual rules of linear algebra apply without any qualification, and for these models there are no mathematical subtleties to add to the conceptual difficulties of quantum theory … Nevertheless, they provide many useful insights into general quantum principles.”. (p.4f)

CALCULUS AND PROBABILITY

  1. Griffiths (2003) makes considerable use of toy models with a simple discretized time dependence … To obtain … unitary time development, one only needs to solve a simple difference equation, and this can be done in closed form on the back of an envelope. (cf. p.5f)
  2. Probability theory plays an important role in discussions of the time development of quantum systems. … when using toy models the simplest version of probability theory, based on a finite discrete sample space, is perfectly adequate.” (p.6)
  3. “The basic concepts of probability theory are the same in quantum mechanics as in other branches of physics; one does not need a new “quantum probability”. What distinguishes quantum from classical physics is the issue of choosing a suitable sample space with its associated event algebra. … in any single quantum sample space the ordinary rules for probabilistic reasoning are valid. ” (p.6)

QUANTUM REASONING

  1. The important difference compared to classical mechanics is the fact that “an initial quantum state does not single out a particular framework, or sample space of stochastic histories, much less determine which history in the framework will actually occur.” (p.7) There are multiple incompatible frameworks possible and to use the ordinary rules of propositional logic presupposes to apply these to a single framework. Therefore it is important to understand how to choose an appropriate framework.(cf. p.7)

NEXT

These are the basic ingredients which Griffiths mentions in chapter 1 of his book 2013. In the following these ingredients have to be understood so far, that is becomes clear how to relate the idea of a possible history of states (cf. chapters 8ff) where the future of a successor state in a sequence of timely separated states is described by some probability.

REFERENCES

  • R.B. Griffiths. Consistent Quantum Theory. Cambridge University Press, New York, 2003

 

WHY QT FOR AAI?

eJournal: uffmm.org, ISSN 2567-6458, 2.January 2019
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email:
gerd@doeben-henisch.de

CONTEXT

This is a continuation from the post QUANTUM THEORY (QT). BASIC PROPERTIES, where basic properties of quantum theory (QT) according to ch.27 of Griffiths (2003) have been reported. Before we dig deeper into the QT matter here a remark why we should do this at all because the main topic of the uffmm.org blog is the Actor-Actor Interaction (AAI) paradigm dealing with actors including a subset of actors which have the complexity of biological systems at least as complex as exemplars of the kind of human sapiens.

WHY QT IN THE CASE OF AAI

As Griffiths (2003) points out in his chapter 1 and chapter 27 quantum theory deals with objects which are not perceivable by the normal human sensory apparatus. It needs special measurement procedures and instrumentation to measure events related to quantum objects. Therefore the level of analysis in quantum theory is quite ‘low’ compared to the complexity hierarchies of biological systems.

Baars and Edelman (2012) address the question of the relationship of QT and biological phenomena, especially those connected to the phenomenon of human consciousness, explicitly. Their conclusion is very clear: “Current quantum-level proposals do not explain the prominent empirical features of consciousness”. (Baars and Edelman (2012):p.286)

Behind this short statement we have to accept the deep insights of modern (evolutionary and micro) biology that a main characteristics of biological systems has to be seen in their ability to overcome the fluctuating and unstable quantum properties by a more and more complex machinery which posses its own logic and its own specific dynamics.

Therefore the level of analysis for the behavior of biological systems is usually ‘far above’ the level of quantum theory.

Why then at all bother with QT in the case of the AAI paradigm?

If one looks to the AAI paradigm then one detects the concept of the actor story (AS) which assumes that reality can be conceived — and then be described – as a ‘process’ which can be analyzed as a ‘sequence of states’ characterized by decidable ‘facts’ which can ‘change in time’. A ‘change’ can occur either by some changing time measured by ‘time points’ generated by a ‘time machine’ called ‘clock’ or by some ‘inherent change’ observable as a change in some ‘facts’.

Restricting the description of the transitions of such a sequence of states to properties of classical probability theory, one detects severe limits of the descriptive power of a CPT description compared to what has to be done in an AAI analysis. (see for this the post BACKGROUND INFORMATION 27.Dec.2018: The AAI-paradigm and Quantum Logic. The Limits of Classic Probability). The limits result from the fact that actors within the AAI paradigm are in many cases ‘not static’ and ‘not deterministic’ systems which can change their structures and behavior functions in a way that the basic assumptions of CPT are no longer valid.

It remains the question whether a probability theory PT which is based on quantum theory QT is in some sense ‘better adapted’ to the AAI paradigm than Classical PT.

This question is the main perspective guiding the further encounter with QT.

See next.

 

 

 

 

 

 

 

 

 

 

 

 

 

QUELLEN

  • Bernard J. Baars and David B. Edelman. Consciousness, biology, and quantum hypotheses. Physics of Life Review, 9(3):285 – 294, 2012. D O I: 10.1016/j.plrev.2012.07.001. Epub. URL http://www.ncbi.nlm.nih.gov/pubmed/22925839
  • R.B. Griffiths. Consistent Quantum Theory. Cambridge University Press, New York, 2003

 

QUANTUM THEORY (QT). BASIC PROPERTIES

eJournal: uffmm.org, ISSN 2567-6458, 31.Dec. 2018
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

CONTEXT

This is a continuation from the post BACKGROUND INFORMATION 27.Dec.2018: The AAI-paradigm and Quantum Logic. The Limits of Classic Probability. The general topic here is the analysis of properties of human behavior, actually narrowed down to the statistical properties. From the different possible theories applicable to statistical properties of behavior one is called CPT (classical probability theory), see the before mentioned post, and the other QLPT (quantum logic probability theory), which will be discussed now.

SUMMARY

First description of what Quantum Theory QT) is which is implying  quantum logic.

QT AND REALITY

To approach the topic of QLTP we will start from a philosophy of science point of view beginning with the general question of the relation between ‘quantum theory (QT)’ and ‘reality’ (here we follow Griffiths (2003) in his final reflections about QT in chapter 27 of his book).

  1. Griffiths makes the clear distinction between QT as a theory (T) and something we call real world (W) or physical reality which is clearly distinct from the theory.
  2. A theory is realized as a set of symbolic expressions which are assumed to have a relation to the presupposed real world. The symbolic matter as such is not the theory but those structures in the mind of the scientists which are comprehended. In our mind – something ‘inside’ our body; usually located in the brain – we can in an abstract way distinguish elements and relations between these elements. Furthermore we can think about these elements and relations on a meta level and define concepts like ‘is coherent’, ‘is logical’, ‘is beautiful’.
  3. Besides the definitions ‘inside the mind’ about ‘elements already in the mind’ (like ‘consistency’ …) there exists the question of the confirmation of theoretical constructs compared to the real world as it is. As we know there exist one primary mode of relationship and some secondary mode to interact with the presupposed ‘real world’:
    1. The primary mode is the sensory perception, which generates typical internal events in the brain, and
    2. the secondary mode is a sensory perception in cooperation with defined measurement procedures. Thus the measurement results are as such not different to other sensory perceptions but the measurement results are generated by a certain procedure which can be repeated from everybody who wants to look to the measurement results again, and this procedure is using a before agreed measurement standard object to give a point of reference for everybody.
  4. The possible confirmation of theoretical constructs t of some theory T by measurements requires the availability of appropriate measurements communicated to the mind through the sensory perception and some mapping between the sensory data and the theoretical constructs. Usually the sensory data are by themselves not raw data but are symbolic expressions ‘representing the data in a symbolic format’. Thus the mapping in the mind has to connect the perceptions of the symbolic measurement with parts of the theory.
  5. Because it is assumed that the theory is also encoded in symbolic expressions for communication one has to assume that one has to distinguish between the symbolic representation of the theory and their domain of application consisting of elements and relations generated in the mind. In modern formal theories the relationship between measurement expressions and theoretical expressions is defined in an appropriate logic describing possible inferences which deliver within a logical proof either a formal confirmation or not.
  6. As Griffiths remarks the different confirmations of individual measurements do not guarantee the truth of the theory saying that the assumed theory is an adequate description of the presupposed real world. This results from the fact that every experimental confirmation can only give very partial confirmations compared to the nearly infinite space of possible statements which are entailed by a modern theory. Therefore it is finally a question of faith whether some proposed empirical theory is gaining acceptance and is used ‘as if it is true’. This means the theory can be refuted at any time point in the future.
  7. For the QT Griffiths claims that nearly everybody today accepts QT as the best available theory about the real world.(cf. p.361)
  8. Within QT the dynamical laws are inherently stochastic/ probabilistic, this means that the future behavior of a quantum system cannot be predicted with certainty. (cf. Griffiths (2003):p.362)
  9. The reason for this unpredictability is that the elementary objects of the QT, the ‘quantum particles‘, have no precise position or momentum. A precise description of these particles is limited by the Heisenberg uncertainty principle. (cf. Griffiths (2003):p.361)
  10. This inherent property of QT of having objects with no clear position and momentum allows the further fact that there can be different formalism logically incompatible with each other but nevertheless describing a certain aspect of the QT domain in a ‘sound’ manner. (cf. Griffiths (2003):pp.262-265)
  11. While the interaction of a quantum system can be described, the ‘decoherence‘ of a macroscopic quantum superposition (MQS) state can directly not be measured. To enable a theoretic description for this properties requires concepts and a language which deviates from everyday experiences, concepts, and languages. (cf. Griffiths (2003):pp.265-268)
  12. Summing up one gets the following list of important properties looking to an presupposed ‘independent real world’ (cf. Griffiths (2003):p.268f):
    1. Physical objects never possess a completely precise position or momentum.
    2. The fundamental dynamical laws of physics are stochastic and not deterministic.
    3. There is not a unique exhaustive description of a physical system or a physical process.
    4. Quantum measurements can be understood as revealing properties of a measured system before the measurement took place, in a manner which was taken for granted in classical physics.
    5. Quantum mechanics is a local theory in the sense that the world can be understood without supposing that there are mysterious influences which propagate over long distances more rapidly than the speed of light.
    6. Quantum mechanics is consistent with the notion of an independent reality, a real world whose properties and fundamental laws do not depend upon what human beings happen to believe, desire, or think.

Taking these assumptions for granted one has to analyze now what this implies for the description and computation of the behavior of states of properties generated by biological systems.

See a continuation here.

REFERENCES

  • R.B. Griffiths. Consistent Quantum Theory. Cambridge University Press, New York, 2003

 

SIMPLE PROGRAMMING ENVIRONMENT WITH PYTHON-SPYDER

eJournal: uffmm.org, ISSN 2567-6458, 30.Dec 2018
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

CONTEXT

This post is part of the online book project for the AAI-paradigm. As mentioned in the text of the book the AAI paradigm will need for its practical usage appropriate software. Some preliminary (experimentally) programming is already underway. The programming language used for this programming is python. Here some bits of information how one can install a simple python environment to share these activities.

WINPYTHON OR ANACONDA WITH SPYDER
(Windows as well as Linux (ubuntu))

To work with the python programming language — here python 3 —  one needs some tools interacting with each other. For this different integrated development packages have been prepared.  In this uffmm-software project I am using the spyder development environment either as part of the winpython distribution or as part of the anaconda distribution.

WINPYTHON DISTRIBUTION

The winpython package can be found here. See also the picture below.

Website of winpython distribution
Website of winpython distribution

If one has downloaded the winpython distribution in some local folder then you will see the following files and folders (see picture below):

winpython distribution folder after installation
winpython distribution folder after installation

SPYDER INTEGRATED ENVIRONMENT

To use the integrated spyder environment one can also look to the spyder website directly (see picture below).

spyder working environment for python - website
spyder working environment for python – website

The spyder team recomments to download the spyder software as part of the bigger anaconda distribution with lots of additional options (see picture below).

spyder working environment embedded in the anaconda distribution
spyder working environment embedded in the anaconda distribution

Downloading the anaconda distribution needs much more time then the winpython distribution. But one gets a lot of stuff and the software is fairly good integrated into the windows 10 operating system. I personally recomment for the beginners not to beginn with the complex anaconda environment but to stay with the spyder integrated environment only. This can be done by activating with the windows-button the list of apps, looking to the anaconda icon, and there one can find the spyder icon (an idealized spyder web). One can click with the right mouse button on this icon and then select to ‘add to the task bar’. After this operation you can observe the spyder icon as attached to the task bar like in the picture below.

part of the task bar in windows with icons for spyder and a python environment
Part of the task bar in windows with icons for spyder (right border)  and a python environment (left from spyder)

If one activates the spyder icon a window opens showing some standard configuration of the integrated spyder development environment (see picture below).

spyder working environment with editor, console, and additional object informations
spyder working environment with editor, console, and additional object informations

The most important sub-windows are the window left from the editor and the window right-below from the console.  One can use the console to make small experiments with python commands and the editor to write larger source code.  In the header bar are many helpful icons for editing, running of programs, testing, and more.

LINUX (UBUNTU)

If one is working with linux (what I am usually are doing; I use the distribution ubuntu 18.04.1 LTS) then python is part of the system in version 2 as well in version 3 and spyder can be used too.

BACKGROUND INFORMATION 27.Dec.2018: The AAI-paradigm and Quantum Logic. The Limits of Classic Probability

eJournal: uffmm.org, ISSN 2567-6458
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

Last Corrections: 30.Dec.2018

CONTEXT

This is a continuation from the post about QL Basics Concepts Part 1. The general topic here is the analysis of properties of human behavior, actually narrowed down to the statistical properties. From the different possible theories applicable to statistical properties of behavior here the one called CPT (classical probability theory) is selected for a short examination.

SUMMARY

An analysis of the classical probability theory shows that the empirical application of this theory is limited to static sets of events and probabilities. In the case of biological systems which are adaptive with regard to structure and cognition this does not work. This yields the question whether a quantum probability theory approach does work or not.

THE CPT IDEA

  1. Before we are looking  to the case of quantum probability theory (QLPT) let us examine the case of a classical probability theory (CPT) a little bit more.
  2. Generally one has to distinguish the symbolic formal representation of a theory T and some domain of application D distinct from the symbolic representation.
  3. In principle the domain of application D can be nearly anything, very often again another symbolic representation. But in the case of empirical applications we assume usually some subset of ’empirical events’ E of the ’empirical (real) world’ W.
  4. For the following let us assume (for a while) that this is the case, that D is a subset of the empirical world W.
  5. Talking about ‘events in an empirical real world’ presupposes that there there exists a ‘procedure of measurement‘ using a ‘previously defined standard object‘ and a ‘symbolic representation of the measurement results‘.
  6. Furthermore one has to assume a community of ‘observers‘ which have minimal capabilities to ‘observe’, which implies ‘distinctions between different results’, some ‘ordering of successions (before – after)’, to ‘attach symbols according to some rules’ to measurement results, to ‘translate measurement results’ into more abstract concepts and relations.
  7. Thus to speak about empirical results assumes a set of symbolic representations of those events as a finite set of symbolic representations which represent a ‘state in the real world’ which can have a ‘predecessor state before’ and – possibly — a ‘successor state after’ the ‘actual’ state. The ‘quality’ of these measurement representations depends from the quality of the measurement procedure as well as from the quality of the cognitive capabilities of the participating observers.
  8. In the classical probability theory T_cpt as described by Kolmogorov (1932) it is assumed that there is a set E of ‘elementary events’. The set E is assumed to be ‘complete’ with regard to all possible events. The probability P is coming into play with a mapping from E into the set of positive real numbers R+ written as P: E —> R+ or P(E) = 1 with the assumption that all the individual elements e_i of E have an individual probability P(e_i) which obey the rule P(e_1) + P(e_2) + … + P(e_n) = 1.
  9. In the formal theory T_cpt it is not explained ‘how’ the probabilities are realized in the concrete case. In the ‘real world’ we have to identify some ‘generators of events’ G, otherwise we do not know whether an event e belongs to a ‘set of probability events’.
  10. Kolmogorov (1932) speaks about a necessary generator as a ‘set of conditions’ which ‘allows of any number of repetitions’, and ‘a set of events can take place as a result of the establishment of the condition’. (cf. p.3) And he mentions explicitly the case that different variants of the a priori assumed possible events can take place as a set A. And then he speaks of this set A also of an event which has taken place! (cf. p.4)
  11. If one looks to the case of the ‘set A’ then one has to clarify that this ‘set A’ is not an ordinary set of set theory, because in a set every member occurs only once. Instead ‘A’ represents a ‘sequence of events out of the basic set E’. A sequence is in set theory an ‘ordered set’, where some set (e.g. E) is mapped into an initial segment  of the natural numbers Nat and in this case  the set A contains ‘pairs from E x Nat|\n’  with a restriction of the set Nat to some n. The ‘range’ of the set A has then ‘distinguished elements’ whereby the ‘domain’ can have ‘same elements’. Kolmogorov addresses this problem with the remark, that the set A can be ‘defined in any way’. (cf. p.4) Thus to assume the set A as a set of pairs from the Cartesian product E x Nat|\n with the natural numbers taken from the initial segment of the natural numbers is compatible with the remark of Kolmogorov and the empirical situation.
  12. For a possible observer it follows that he must be able to distinguish different states <s1, s2, …, sm> following each other in the real world, and in every state there is an event e_i from the set of a priori possible events E. The observer can ‘count’ the occurrences of a certain event e_i and thus will get after n repetitions for every event e_i a number of occurrences m_i with m_i/n giving the measured empirical probability of the event e_i.
  13. Example 1: Tossing a coin with ‘head (H)’ or ‘tail (T)’ we have theoretically the probabilities ‘1/2’ for each event. A possible outcome could be (with ‘H’ := 0, ‘T’ := 1): <((0,1), (0,2), (0,3), (1,4), (0,5)> . Thus we have m_H = 4, m_T = 1, giving us m_H/n = 4/5 and m_T/n = 1/5. The sum yields m_H/n + m_T/n = 1, but as one can see the individual empirical probabilities are not in accordance with the theory requiring 1/2 for each. Kolmogorov remarks in his text  that if the number of repetitions n is large enough then will the values of the empirically measured probability approach the theoretically defined values. In a simple experiment with a random number generator simulating the tossing of the coin I got the numbers m_Head = 4978, m_Tail = 5022, which gives the empirical probabilities m_Head/1000 = 0.4977 and m_Teil/ 1000 = 0.5021.
  14. This example demonstrates while the theoretical term ‘probability’ is a simple number, the empirical counterpart of the theoretical term is either a simple occurrence of a certain event without any meaning as such or an empirically observed sequence of events which can reveal by counting and division a property which can be used as empirical probability of this event generated by a ‘set of conditions’ which allow the observed number of repetitions. Thus we have (i) a ‘generator‘ enabling the events out of E, we have (ii) a ‘measurement‘ giving us a measurement result as part of an observation, (iii) the symbolic encoding of the measurement result, (iv) the ‘counting‘ of the symbolic encoding as ‘occurrence‘ and (v) the counting of the overall repetitions, and (vi) a ‘mathematical division operation‘ to get the empirical probability.
  15. Example 1 demonstrates the case of having one generator (‘tossing a coin’). We know from other examples where people using two or more coins ‘at the same time’! In this case the set of a priori possible events E is occurring ‘n-times in parallel’: E x … x E = E^n. While for every coin only one of the many possible basic events can occur in one state, there can be n-many such events in parallel, giving an assembly of n-many events each out of E. If we keeping the values of E = {‘H’, ‘T’} then we have four different basic configurations each with probability 1/4. If we define more ‘abstract’ events like ‘both the same’ (like ‘0,0’, ‘1,1’) or ‘both different’ (like ‘0,1’. ‘1,0’), then we have new types of complex events with different probabilities, each 1/2. Thus the case of n-many generators in parallel allows new types of complex events.
  16. Following this line of thinking one could consider cases like (E^n)^n or even with repeated applications of the Cartesian product operation. Thus, in the case of (E^n)^n, one can think of different gamblers each having n-many dices in a cup and tossing these n-many dices simultaneously.
  17. Thus we have something like the following structure for an empirical theory of classical probability: CPT(T) iff T=<G,E,X,n,S,P*>, with ‘G’ as the set of generators producing out of E events according to the layout of the set X in a static (deterministic) manner. Here the  set E is the set of basic events. The set X is a ‘typified set’ constructed out of the set E with t-many applications of the Cartesian operation starting with E, then E^n1, then (E^n1)^n2, …. . ‘n’ denotes the number of repetitions, which determines the length of a sequence ‘S’. ‘P*’ represents the ’empirical probability’ which approaches the theoretical probability P while n is becoming ‘big’. P* is realized as a tuple of tuples according to the layout of the set X  where each element in the range of a tuple  represents the ‘number of occurrences’ of a certain event out of X.
  18. Example: If there is a set E = {0,1} with the layout X=(E^2)^2 then we have two groups with two generators each: <<G1, G2>,<G3,G4>>. Every generator G_i produces events out of E. In one state i this could look like  <<0, 0>,<1,0>>. As part of a sequence S this would look like S = <….,(<<0, 0>,<1,0>>,i), … > telling that in the i-th state of S there is an occurrence of events like shown. The empirical probability function P* has a corresponding layout P* = <<m1, m2>,<m3,m4>> with the m_j as ‘counter’ which are counting the occurrences of the different types of events as m_j =<c_e1, …, c_er>. In the example there are two different types of events occurring {0,1} which requires two counters c_0 and c_1, thus we would have m_j =<c_0, c_1>, which would induce for this example the global counter structure:  P* = <<<c_0, c_1>, <c_0, c_1>>,<<c_0,  c_1>,<c_0, c_1>>>. If the generators are all the same then the set of basic events E is the same and in theory   the theoretical probability function P: E —> R+ would induce the same global values for all generators. But in the empirical case, if the theoretical probability function P is not known, then one has to count and below the ‘magic big n’ the values of the counter of the empirical probability function can be different.
  19. This format of the empirical classical  probability theory CPT can handle the case of ‘different generators‘ which produce events out of the same basic set E but with different probabilities, which can be counted by the empirical probability function P*. A prominent case of different probabilities with the same set of events is the case of manipulations of generators (a coin, a dice, a roulette wheel, …) to deceive other people.
  20. In the examples mentioned so far the probabilities of the basic events as well as the complex events can be different in different generators, but are nevertheless  ‘static’, not changing. Looking to generators like ‘tossing a coin’, ‘tossing a dice’ this seams to be sound. But what if we look to other types of generators like ‘biological systems’ which have to ‘decide’ which possible options of acting they ‘choose’? If the set of possible actions A is static, then the probability of selecting one action a out of A will usually depend from some ‘inner states’ IS of the biological system. These inner states IS need at least the following two components:(i) an internal ‘representation of the possible actions’ IS_A as well (ii) a finite set of ‘preferences’ IS_Pref. Depending from the preferences the biological system will select an action IS_a out of IS_A and then it can generate an action a out of A.
  21. If biological systems as generators have a ‘static’ (‘deterministic’) set of preferences IS_Pref, then they will act like fixed generators for ‘tossing a coin’, ‘tossing a dice’. In this case nothing will change.  But, as we know from the empirical world, biological systems are in general ‘adaptive’ systems which enables two kinds of adaptation: (i) ‘structural‘ adaptation like in biological evolution and (ii) ‘cognitive‘ adaptation as with higher organisms having a neural system with a brain. In these systems (example: homo sapiens) the set of preferences IS_Pref can change in time as well as the internal ‘representation of the possible actions’ IS_A. These changes cause a shift in the probabilities of the events manifested in the realized actions!
  22. If we allow possible changes in the terms ‘G’ and ‘E’ to ‘G+’ and ‘E+’ then we have no longer a ‘classical’ probability theory CPT. This new type of probability theory we can call ‘non-classic’ probability theory NCPT. A short notation could be: NCPT(T) iff T=<G+,E+,X,n,S,P*> where ‘G+’ represents an adaptive biological system with changing representations for possible Actions A* as well as changing preferences IS_Pref+. The interesting question is, whether a quantum logic approach QLPT is a possible realization of such a non-classical probability theory. While it is known that the QLPT works for physical matters, it is an open question whether it works for biological systems too.
  23. REMARK: switching from static generators to adaptive generators induces the need for the inclusion of the environment of the adaptive generators. ‘Adaptation’ is generally a capacity to deal better with non-static environments.

See continuation here.

BACKGROUND INFORMATION 27.Dec.2018: The AAI-paradigm and Quantum Logic. Basic Concepts. Part 1

eJournal: uffmm.org, ISSN 2567-6458
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

Some corrections: 28.Dec.2018

As mentioned in a preceding post the AAI paradigm has to be reconsidered in the light of the quantum logic (QL) paradigm. Here some first concepts which have to be considered (see for the following text chapter two of the book: Jerome R. Busemeyer and Peter D. Bruza, Quantum Models of Cognition and Decision, Cambridge University Press, Cambridge (UK), 2012).

The paradigms of ‘quantum logic’ as well as ‘quantum probability theory’ arose in the field of physics, but as it became clear later these formalisms can be applied to other domains than physics too.

The basic application domain is a appears as a paradigm – real or virtual – in which one can distinguish ‘events‘ which can ‘occur‘ along a time-line as part of a bigger state. The ‘frequency‘ of the occurrences of the different events can be ‘counted’ as a function of the presupposed time-line. The frequency can be represented by a ‘number‘. The frequency can be a ‘total frequency’ for the ‘whole time-line’ or a ‘relative frequency’ with regard to some part of a ‘partition of the time-line’. Having relative frequencies these can possibly ‘change‘ from part to part.

The basic application domain can be mapped into a formalism which ‘explains’ the ‘probability’ of the occurrences of the events in the application domain. Such a formalism is an ‘abstraction’ or an ‘idealization‘ of a certain type of an application domain.

The two main types of formalisms dealt with in the mentioned book of Busemeyer and Bruza (2012) are called ‘classical probability theory’ and ‘quantum probability theory’.

The classical theory of probability (CTP)has been formalized as a theory in the book by A.N. Kolmogorov, Foundations of the Theory of Probability. Chelsea Publ. Company, New York, 2nd edition, 1956 (originally published in German 1933). The quantum logic version of the theory of probability (QLTP) has been formalized as a theory in the book John von Neumann, Mathematische Grundlagen der Quantenmechanik, published by Julius Springer, Berlin, 1932 (a later English version has been published 1956).

In the CTP the possible elementary events are members of a set E which is mapped into the set of positive real numbers R+. The probability of an event A is written as P(A)=r (with r in R*). The probability of the whole set E is assumed as P(E) = 1. The relationship between the formal theory CTP and the application domain is given by a mapping of the abstract concept of probability P(A) to the relation between the number of repetitions of some mechanism of event-generation n and the number of occurrences m of a certain event A written as n/m. If the number of repetitions is ‘big enough’, then – according to Kolmogorov — the relation ‘n/m’ will differ only slightly from the theoretical probability P(A) (cf. Kolmogorov (1956):p.4)

The expression ‘mechanism of event-generation‘ is very specific; in general we have a sequence of states along a time-line and some specific event A can occur in one of these states or not. If event A occurs then the number m of occurrences m is incremented while the number of repetitions n corresponds to the number of time points which are associated with a state of a possible occurrence counted since a time point declared as a ‘starting point‘ for the observation. Because time points in an application domain are related to machines called ‘clocks‘ the ‘duration‘ of a state is related to the ‘partition’ of a time unit like ‘second [s]’ realized by the used clock. Thus depending from the used clock can the number of repetitions become very large. Compared to the human perception can this clock-based number of repetitions be ‘misleading’ because a human observer has seen perhaps only two occurrences of the event A while the clock measured some number n* far beyond two. This short remark reveals that the relationship between an abstract term of ‘probability’ and an application domain is far from trivial. Basically it is completely unclear what theoretical probability means in the empirical world without an elaborated description of the relationship between the formal theory and the sequences of events in the real world.

See next.

 

 

 

 

BACKGROUND INFORMATION 24.Dec.2018: The AAI-pParadigm and Quantum Logic

eJournal: uffmm.org, ISSN 2567-6458
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

Extending the main page another important idea has to be noticed: quantum logic, originally created in the realm of modern physics, has brought forward a formalism  dealing with superposition states (states of substantial uncertainty for the observer). This formalism has meanwhile entered other disciplines, especially disciplines dealing with cognition and decision processes (see as an excellent example the book: Jerome R. Busemeyer and Peter D. Bruza, Quantum Models of Cognition and Decision, Cambridge University Press, Cambridge (UK), 2012).

As it turns out there is a bad and a good message for the AAI paradigm: the ‘bad’ message is, that the AAI formalism so far is written in a non-quantum logic style. Thus it seems as if the AAI paradigm is stuck with the classical pre-quantum view of the world. The ‘good’ message is, that this ‘pre-quantum’ style is only at the ‘surface’ of the AAI paradigm. If one considers the ‘actor models’ – which are a substantial component of the AAI paradigm – as ‘truly quantum-like systems‘ (what they are in the ‘normal case’), then one can think of the ‘actors’ as systems having three components at least: (i) a biological basis (or some equivalent matter) consisting of highly entangled quantum systems, which are organized as ‘biological bodies‘ with a brain; (ii) a ‘consciousness‘ interacting with (iii) an ‘unconsciousness‘. The consciousness is heavily depending from the behavior of the unconsciousness in a way which resembles a superposition state! By ‘learning‘ the system can store some ‘procedures’ for later activation in the unconsciousness, but the stored procedures (a) can not override the superposition state completely and (b) the stored procedures are not immune against changes in time. Thus from the point of ‘decisions’ and of ‘thinking’ an actor is always an inherently in-deterministic system which can better be described with a quantum-logic similar formalism than with a non-quantum-logic formalism.

In general one should abandon the term ‘quantum’ from the formalism because the domain of reference are not some physical ‘quanta’ below the atoms but complete learning systems with a stochastic unconsciousness as basis for learning.

To implement these quantum logic perspective into the AAI paradigm does not change the paradigm as a whole but primarily the descriptions of the participating actors.

As a consequence of this change the simulation process has to be seen in a new way:  because every participating actor is a truly indeterministic  system, the whole state at some time point t is a superposition state. Therefore  every concrete simulation is a ‘selection’ of ‘one path out of many possible ones’. Thus a concrete  simulation  can only show one fragment of an unknown bigger space of possible other runs. And their is another point: because all actors are ‘learning’ actors in the unrestricted sense (known artificial intelligence systems today are strongly restricted learners!) the actors in the process are ‘changing’. Thus an actor at time point t+x is not the same as the actor with the same ‘name’ at an earlier time point t! To draw conclusions about possible ‘repetitions in the future’ is therefore dangerous. The future in a quantum-like world will never repeat the past.

See next.

BACKGROUND INFORMATION 19.Dec.2018: The e-Politics Project

eJournal: uffmm.org, ISSN 2567-6458
Email: info@uffmm.org
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

If You are wondering why no new updates appear on the main page the reason why is, that some heavy work is going on in the background using the AAI paradigm published here so far within a German course  called Mensch-Maschine Interaktion (MMI) in the Frankfurt University of Applied Sciences (FRA-UAS) as well in a growing interdisciplinary project where the AAI paradigm is applied to the topic of ‘communal planning using e-gaming’. Because both activities are in German there is time lacking to continue writing in English :-). In the context of the ‘communal planning with e-gaming’  project  we are planning to do some more field-experiments in the upcoming months with ‘normal citizens’ using these methods as a ‘bottom-up strategy’ for getting shared models of their cities which can be simulated. It is highly probable that a small booklet in German will appear to support these experiments before this English version will be expanded.

During  the time since Nov-4, 2018  the theory of the AAI paradigm could be improved in many points (documented in the German texts) and meanwhile I have started to program a first version of a software (in python) by myself. Doing this the experience is always the same: You think You ‘know’ the subject matter’ because You have written some texts with formulas, but if You are starting programming, You are challenged in a much more concrete way. Without theory the programming wouldn’t know what to do,  but without programming you will never understand in a sufficient concrete way what You are thinking

 

THE BETTER WORLD PROJECT IDEA

eJournal: uffmm.org, ISSN 2567-6458
Email: info@uffmm.org

Last changes: 9.Oct.2018 (Engineering part)

Author: Gerd Doeben-Henisch

Enhanced version of the 'Better World Project' Idea by making explicit the engineering part touching all other aspects
Enhanced version of the ‘Better World Project’ Idea by making explicit the engineering part touching all other aspects

 

The online-book project published on the uffmm.org website has to be seen within a bigger idea which can be named ‘The better world project’.

As outlined in the figure above you can see that the AAIwSE theory is the nucleus of a project which intends to enable a global learning space which connects individual persons as well as schools, universities, cities as well as companies, and even more if wanted.

There are other ideas around using the concept ‘better world’, butt these other concepts are targeting other subjects. In this view here the engineering perspective is laying the ground to build new more effective systems to enhance all aspects of life.

As you already can detect in the AAAIwSE theory published so far there exists a new and enlarged vision of the acting persons, the engineers as the great artists of the real world. Taking this view seriously there will be a need for a new kind of spirituality too which is enabling the acting persons to do all this with a vital interest in the future of life in the universe.

Actually the following websites are directly involved in the ‘Better World Project Idea’: this site ‘uffmm.org’ (in English)  and (in German)  ‘cognitiveagent.org‘ and ‘Kommunalpolitik & eGaming‘. The last link points to an official project of the Frankfurt University of Applied Sciences (FRA-UAS) which will apply the AAI-Methods to all communities in Germany (about 11.000).