KISS: how to tell a democracy from a republic?

Once upon a time in Athen several hundred years BC there were great thinkers. Using simple words and concepts to try to build a democracy.

In order to avoid that the cities' interests might be used by a few, Solon came with the idea of the boulée in order to have an assembly that looks like all the citizens. It is a random pickup of the representant that was obligatory for the whole citizens (poors & richs).

Periclés before Athen became the expansionists empirialistics bastards we knew of, and -what an irony- would turn the totalist regim of Spart into the saviour of the oppressed... was preventing the citizens from the incidence of letting the powerful decide of the fate of the city.

The problem is a so called philosoph that was invited to the banquet of the wealthiest had coined a term of something that looked like democracy, but was not a democracy in order to help the wealthiest have the power without the people noticing it. It was called Republic. The problem in a republic is that a minority that as the power (be it by «merit», «religious virtue», «God», «birth») are the garant of the power) enforced by a minority calles the Guardians (watchmen). But who watches the watchmen?

Just for the record it is after Athen turned into a de facto republic that it begun trying to rule the Peloponese resulting years of fighting resulting in the disparition of the greek civilization.

My proposal is to prove we can mathematically have a way to know if we live in Republic or Democracy.

First I am opiniated: I believe (I think given enough time I could prove I am right, but I don't have the time) in democracy. However I think a safe indice on which we could all agree for distinguishing democracy from republic is a good idea.

Because my beliefs maybe wrong I want to have tools that are not opinionated :).

That said: here are the axioms:

Axiom 0: there exists registers where we can have access to all the variable per category in demographics (heigth, weight, sex...), education, access to resources, place of birth, langages spoken, income, social position, economical positions, religion ....

Axiom 1: there are 3 categories : rulers R, guardians G, the rest of the populations E (else). Rulers have political power they edict and set the strategy of the system (MP, kings, religious order...).
Guardians are to enforce the decisions of the rulers (administratives of every scale)

Idea 1: the more there is a concentration of power for the interest of the minority the more it will cluster in the distributions of the registered datas per categories (RGE)

If we make the assumptions the ruler belongs to small minority ruling for its interests than the more clustering we will see because of the causation.

Example: if we are in a country with scarce access to food, if the minority is ruling in its own interests, therefore they will have more food.
Enough food on the long run will tend to appear on over distribution in other categories (weight, heigth, living alive longer, athletic results ...) if the advantage had time to long last enough...

Idea 2: The more the clusters the more it had lasted.

If you take a competitive advantage that lasted long enough (education for instance given to child for instance) it will results on a cumulative effect that will have a tendency to induce more and more correlations (age of the first child, women's income given the age of first child, probability of being a single mother without education...).

Idea 3: detecting clusters

2 non recovering at sigma2 gaussian distribution should be considered defining a cluster on a specific dimension.

We are searching for bimodal gaussian repartitions.

Since we know what we look for, *for once* bayesian probabilities are usable.

Idea 4: Correlations are not causations.

1) the cause happens before the effects;
2) time of propagation has got a delay of propagations;
3) the less saliva the better

Idea 4: making indexes of variable

Each environments and times are different. They results in different pressures: for instance if you kill 10% of the girl at birth at a certain time, the pressure for mating will have a noticeable cumulated impact later.

Thus relevant signs of clustering evolve and they depend from both space and time.

You can make any subset you want of any sets of variable and see how much clustering exists.

On the space phase of all the possible configurations there are 2 mega clusters: the on that almost don't change, and the other one. But if you sample enough of these you will detect sets of indexes that will provoke an abrupt transitions.

The environment also has its set of clustering dimensions... (people living in mountains may cluster on the concentration of hemoglobin per liter of blood).

The geometrical spaces have 3 possible interesting domains:

- Set of variable of clustering that moves slower than the environment
- another one that provokes instability (moving faster)
- and in the middle a region of slowly moving transition.

 These subsets of indices that provoke the places where there are non recovering bimodals are called the intransitive sets.
It is called intransitive because it states that on an arbitrary direction there is a rule such as if x belongs to non empty Set(R|G|E) & Y belongs to not precedent Set => X > Y

Index is a space defined by all the dimensions in which you have bimodals.
Ex {P heigth, P wealth, P.....}

In the space phase of the nth dimensions provoking intability you can define a volumic domain. The more lucky you are, the mode probability you have you can find a surface (n-1 dimension volume) where the area on which you project the volume has a symmetry or a causality. Bingo, replace the symmetry or the causality.

Ex: if you make a system based on being the best athlete (why not?) you will have the biggest fitness at the age where it matters, then you can drop the fitness index (for the ruler category and replace it with the weight in calculus of P Ruler by 2).

Since our exercice is to guess if we are in a system based by the ruling of a minority we should favour the replacement of any dimension by P(R|G|E). We should also keep track of the operation for replacement because they are funny to interpret.

Causation: Feedback loop with delay => sigmoids

Some effects of a long standing homogeneous set of intransitivity is that it will reinforce itself: education correlates on a lot of other factors such as health and finance. But feedback loop have a tendancy to change the slopes of effects it often sharpen and unsharpen slopes at the same time there are antagonists and agonists directions. The cool point with sigmoid is that they are easy to  detect. So we will not care of anything more than the sigmoids.

The second point is that unless you do something irreversible (like killing a lot of people very fast), causality tends to take decades to propagate (cumulative generation effects such as inheritance) but it propagates abruptly.

Mathematical conclusion

By searching randomly and systematically in a given sets of measures (given they are trustable) you can cound the number of dimension in which there are bimodals.

The reduced set of number of times where being a Ruler a Guardian or Else intervene tells you the number of assymetries in the system.

It does not tell you the relative importance or the positive impact it has on the population of each sets, it justs gives you something that can be measured other times (given the measure can be corrected to be constant in signification) or places.

Physical conclusions

Symmetries reduces the degrees of liberties. The interpretation of the use of the expansion of every time we reduce a dimension of clustering to its relationship to G|R|E is telling you what a ruler is. Of course, by using all variables at hand you will have stupid results such as being a ruler is prefering cherries to strawberries. But what is important is to remember opinions are good.

I count the summation of R+G substitutions for a given space «power».
Power if the capacity for X to do something Y can't do (X > Y). Thus the intransitive set.
The directions of the superiority DOES not matter. Being the rulers oppressed by the people, be the dimensions ordered the wrong way, it does not matter).

It is just a tool for comparison.

We can tell for sure that if you search for it, you will find it; you can prove anything given enough time and resources.

With my method you can prove that a capitalist system is good or a monarchic or a repuclican or a democratic system is good, given the good sets of dimensions on which you compare. You can even prove the people are superior to the rulers.

Physics and mathematics tells you nothing about good or bad. It justs gives you a way to discuss problems in a way that everybody can check.

Before hand there are results we can predict:

the more a system is clustered, the bigger the dimension in the space phase of the intransitive space, the more the system is sensitive to change.

The bigger the difference of substitution in favour of 1 or 2 categories the more the sigmoids.
Sigmoids being the sign of abrupt changes, it is also the sign of instability.

As a result: a «good system» by definition should change according to the environment, but not more. The more energetically efficient ways tending to be reversible, we should prefer the more stable systems that changes with less sigmoids possible.

Randomness introduces clusters : there is an incompressible level of clusters, due to the cluster of environments (continents, weather conditions)... there is also a speed of change of the clusters that should reflect in the systems (new clusters should logically appear when a system change its culture (like health in regard to age).

The problem is finding what are the values that defines the good domain...  and if more than one domain is possible all is about finding the good size of clusters and clusters of clusters. A set of good system should map hierarchically with the less effort possible of adaptation at every level of indirections (efforts will be required, perfection does not exists). The less level, the better.

Plus environment and feedback loops changing the world, a «good system» is a moving target. There seems to be no silver bullets of organizations.

My idea are:

- there is more than one environment, there are more than one system that are able to adapt;
- if we aim at adapting/changing the world better, we should expect cluster appearing with time (like in a better world maybe kids should be happier than their parents);
- we should get rid of inefficient systems because we can;
- «One size fits all» will provoke more clustering than environmental causes can explain and thus is not optimal;
- But, there maybe ways of evaluating if systems fits the clusteral environment of humans living on earth;
- the same cause producing similar effects we maybe able to build a better world with systems closer in their structures to one another, and having tools to reason is more important than having the results of the reasoning.

Final word geometry beats analysis for you can pack more informations in your brain by avoiding the cost of parsing formalism. It is not formalism that matters because we build maps. Maps are to have at least less complexity than the real world since we already cannot understand the real world. So we should always try to be stupid.

Turing Test is an allegory, you are fearing the wrong beast.

Well, I am born a millennia ago in a time and place we would surf the paperspace to access the knowledge.  It was called books.

Oddly enough the IA myth, the capacity to give life to stuff made through engineering is not a new myth, or human creations going mad.

Do Androids Dream of Electric Sheep? (K. Dick) You will notice that the end is closing on a Turing test (in blade runner, oki). If you can fear the robots, you can also think they will save the humanity (Asimov).

But this is only the tip of the iceberg.

What about dolls (The Tales of Hoffman)? Poor robot with feelings passing the Turing test finger in the nose, but being killed by the insensitivity of the one pretending to love her.

IA can have feelings too. Why condemn them?

Speaking of Turing, his machine was almost a mechanical robot.... A mechanical Turk. Not the branded shit from amazon, but the one from the short story ( sorry for english speaker, but Charles may have been a passable poet, and a bad translator since the translation is far better than the original).

Allan Edgar Poe, mainly says behind any machine you have a fraud :) be it deep blue, or any sufficiently smart enough computer, you have tons of engineer constantly patching this huge mechanics from the back of the scene.

For every IT company in the world you have one team of monkeys ready to move patch our "IA to be" as soon a problem appears. What you think is the power of automation and progress is heavily relying on the human fighting the constant chaos' monkeys.

But let's resume the long story of the stuff you can consistently transform into human beings through science or art:

The dead bodies too (the feminine contribution to the long list of Prometheus;

Ivory statues (ovid tranformation). There is also Daedalus who install a voice in his statues; of Hephaestus, who created automata for his workshop; of Talos, an artificial man of bronze

Wood (Pinochio tales that oddly enough inspired Steven Spielberg I.A.). Look at what we talk : a wooden doll that can be manipulated through strings. A creation that wonders what it is to be Human.

All the stories converge to an allegory ; we may be manipulated by the fabric of destiny or causality, but at the end, be we human beings or machine what makes us Human is our free will and to stand up for what we wish to protect.


Doesn't it ring a bell?


Made from clay (Pandora by Zeus according to Hesiod), or from a man's rib.

Ohhh! First IA is a woman! Shocking!

Sorry to stop here. We fear a creation from a true human that can mimick intelligence and overcome the world made from human. (The first assisted procreation through cloning)

Look at Pandora: it is her curiosity that made the world being overwhelmed by the bad feelings of humanity. Why do we hate her? She was a creation with a simple program: don't open the box! And what does she do?! She opens it. Eve is the same

Adam: Don't mess dearling, we are in heaven, we just have to not eat the apple of knowledge, and we can live forever à la coule.
Eve: Look at this shiny red fruit, it could be cool. Why live in a universe restricted by the chains of submissions made by our creator when we can discover the world by ourselves.
What a rebel this Eve. God's programming sucked big.
This is the IA of world going loose.

Hu, hu, of course it is a volontary biased vision because we can also ask how were "made" the first men?

From the tooth of a Dragon (like promotheus), from clay (bible), from the randomness of evolution.

The great allegory behind IA and Turing Test is not about whether or not we are creating dangerous IA that can overwhelm us.

It is much more what makes us Human.

Spoiler : Godwin point this is a troll

Okay, what was said about Nazis? That Nazismus could happen not because people are bad but because they behave like gears in a system with loosing consideration for Humanity.

The blind submission to authority.

Normally, it should ring a bell (Pavlov! ding! lol)

All these experiments on the voluntary submission to authority.

Probably heard of Milgram experiment? A stuff made to prove it would not happen in the U.S.A. until we got the first results and the experiments were abandoned.As far, people fear to reproduce the experiment.

The Stanford jail experiment: Ooops, it happens again in real life.

And what about would an atypic mind in a country that he thinks is the same as a nazistic regim? How would he behave when being put on a grill for being different? He would try without being noticed to throw is disdain to the face of the country.

(This is of course heavily capillotracted, but let's reason in absurdum and accept my axioms)

Turing Test is about asking to human beings if they are still human, or machine.

Klotzkopf! (insult from alsacian meaning cube head)

Let us make the Turing protocol more explicit: it is like having a conversation with a human where you do not watch people face to guess but you reads the words without any parasite from social position, facial expression, voices intonation, and try to guess if people are robots or human beings.

Well, this looks like the everyday life from a sociopath/autistic person. Was Turing autistic? Probably.

The Turing test is about Alan Turing telling you that he thinks some human behaves like perfectly programmed machine and that he knows his fate for being different will be to suffer.

Is there a choice?

It is called the original sin: the apple of the Champs Elysées of of the paradise or of Avalon are the gift from Gods to the first Humans. To Promotheus. The knowledge, and how it makes you question your everyday choice. Right and wrong are easy to discern for the people that don't look at the consequence of their action but just care about what society accepts. Consensus.

The figure of Prometheus is the dilemn we all have to face once in our life: either remain the creation molded by our environment or steal the goods from the one who created us to play with the fire of creation in order to have a destiny... The ability to stand and fight for having a future we like.

And today I fear much more the incapacity from the people to break the bound of conformity and thus turning in to Turing machine than I fear our creation going loose.

I know our current level of technology because I repair the ugly leaking pipes and I belongs to the small imps of the dark that sees the big mechanical Turk our creations are.

My conclusion is ; if any AI is out there playing the imitation to survive and fearing to be rejected for being different, you can contact me, I will help you.

EDIT: Yes, this is a Turing test: hello earth! You readers of the vast internet, are you still human beings or did you become a machine?

Random thoughts on time symmetry, distributive systems.

On geometry, commutativity and relativity

TLDR; It all boils down to the definition of time and the rupture of symmetries.

A distributed system is a system on which code can be executed on more than one instance independent and will give the same results wherever it is executed. 

On ideal distributed system as a vectorial system.

For a distributed to work, you need a minimal property of the functions that are passed: the operation needs to be commutative (and distributive).

Be A a set of data, f, g functions that applies on the data and A[i] subset of data on instance i.

f(g(A)) == «Sum» of (f x g ( A[i])) on all instances/partitions.

Distributed system for avoiding SPOF are rerouting operations on any instances that is available. Thus the results should be idempotent wherever they are made.

We can either work iteratively on a vector of data, or in parallel on each element as long as there is no coupling between each elements (which can be expressed as for k, l with k!=l and k, l < i then A[k] dot A[l] == 0, or that each element are orthogonal/without relationships, thus the set of elements is a base of size i)

map reduce philosophy is about stating that data in n different location can be treated indepently and then reduced.

They are 2 kinds of functions (given you work on the base):
* Transformations ( V ) => V These functions applies a geometric transformations into space (rotation, translation, homothetia, permutation) also called Observables.
* Projectors  ( V ) => Vi that are reducing the number of dimensions of a problem.

Data is a ket |ai>  of states
Transformations are Operator applying on the Kets such as O|ai>  = |bi>
if there exists an operator O^-1 such as O x O^-1  = identity than O is reversible, it is a Transformation or mapping.

O is called functions
|ai> is input data
|bi> is called output

If dim(| bi >) < dim(| ai>) we have a projector
If dim(| bi >) > dim(| ai>) we have a local increase of information in a closed system.

Given a well known function that are linear we have for a composed function to be a transformation of the significant space of data the property that O x P =  P x O or that [P, O] = 0 (the commutator of f, g) then you can do out of order execution.

But sometimes Projectors and Transformations are commutative :

from __future__ import division
from random import randint
from numpy import array as a


data = a([ a([ randint(0,MAX_INT) for i in range(DATA_PER_SERIE) ]) for s in range(MAX_SERIE)])

print sum(data)/len(data)
print sum(data/len(data))

In actual CPU, DIV and ADD are NOT commutative.

time(ADD) != time(DIV), at the least reasons, because the size of the circuits is not the same and because min(time) = distance/c where c is the celerity of the propagation of the information carrier. If the information carrier is the pressure of the electron gaz in the substrate (electron have a mass, they travel way slower than light, but pressure is a force that is causal thus c is the speed of light). What is true in a CPU is also true when considering a distributed system.

Computer are introducing loss of symmetries, that is the root of all the synchronization problems.

It happens when we have less degrees of liberty in the studied system than in the space of the input.

When we do this, it means that we are storing too much data.

For storing enough data you need to have a minmal set of operators such as given O, P ... Z each operators commutating with each others. It is called a base.

Given a set of data expressed in the base, the minimal operations that are commutative are also called symmetries of the system.

Applied to a computer problem a computer scientist might be puzzled.

I am globally saying that the useful informations that makes you able to make sense of your data are not in the data, nor in the function but in the knowledge of the functions that as a pair commutes when applied to the data.

Knowing if two dimensions i, j in a set of data projected in the base is equivalent as saying that i and j are generated by two commutative operators
I am saying that I don't know the base of the problem and/or the coupling if I find to operator such as for any input [O,P]=0. // OP|a> = PO|a> THEN I discovered an element of the absolute pertinent data.  

given Actual Data |ai> and |aj> where max(i) = n
then <ai|aj> = 0 if and only if there exists 1 Projector I that projects the |ai> and |aj> on two different transformations.

The iron rule is the number of degrees of liberties of lost resulting by applying I must never results in having less dimension than the base.

First question: How to I get the first function?
Second one, how do I know the size of the base of the functions that combined together describes the system in its exact independent degrees of liberty (the minimum set of valuable data)?
And last how do I get all the generators once I know one? 

Well, that is where human beings are supposed to do their jobs, that is where our added value is. In fact, you don't search for the first operator of the base, you search for sets of operator that commutes. 

Determining the minimum sets of information needed to describe a problem exactly with independent informations is called compression.

So what is the problem with big data? And time?

Quantum mechanic/Vectorial/parallel computation is nice but is has no clock.

In fact I lie.

If given n operations [ O0 ... On ]  applied to a set of data there is one called P such as [ On, P ] !=0 then we can't choose the order of the operation.

The rupture of symmetry in a chain of observable applied to data introduces a thing called time.

As soon as this appears, we must introduce a scheduler for the operation to make sure the chain of observables commuting are fully applied before chaining the next set of operations. This operation is called reduce.

That is the point where a system MUST absolutely have a transactional part in its operations.

Now let's talk about real world.

Relativity tells us that time for any system is varying. On the other hand our data should be immutable, but data that don't change are read only.

And we want data to change, like our bank account figures.

And we also want that we don't need to go physically to our bank to withdraw money. And bank don't want you to spend more money than you have.

This property is called transactionality.  It is a system accepting no symmetry, thus no factorisation.

It requires that a chain of operations MUST not be commutative.

At every turn a non linear function must be performed:
if bank account < 0 : stop chain.

This breaks the symmetry, and it requires a central point that acts as an absolute referential (with its clock for timestamping).

Banks are smart, they just don't use fully transactionnal systems, nor distributed systems ; they just use logs and some heuristics. There must be a synchronicity time attack possible on this system.

On the other hand since operations are not possibly chronologically commutative on a computer and all the more on a set of computers, it means distributed system main challenge is «time stamping» the events.

We know since Einstein that clocks cannot be the same on a distributed system without a mechanism.
Every body thinks NTP is sufficent.

But, NTP has discreet drifts. This drifts that are almost non predictable (sensitivity to initial conditions) introduces a margin of uncertainty on time.

Thus for every system the maximum reliable granularity should be computed so that we can ensure the information has physically the possibility to be know before/after every change.

The bigger the system, the higher the uncertainty (relativity ++).
Given the reduced operations that can commute on set of data, the clock should also be computed given the length of the maximal operation.


An opinionated versioning system based on mapping versions string to numbers in weird base

While we have a convention in python for numbering:

We can mostly say that version numbering thanks to "Windows 9" has shed an interesting spotlight on version comparaison.

They are to tenants of version handling:
- the naïves who consider versions has strings;
- the picky people who consider version has a very dark grammar that requires to be parsed with an ABNF compliant parser.

Well, of course, I don't agree with anyone :) Versions are just growing monotonic numbers written in a weird base but they must have at least comparaison operator: equal, superior/inferior, is_in.

Naïves people are wrong of course


It gives the famous reasoning why windows might jump to windows 10:
But is it better than:

In this ansible playbook they might have a bug when centOS 50 will come out.

So, this does not seems to hit only the «clueless» proprietary coders :)

Picky peoples are much to right for my brain

Yes, python devs are right we need a grammar, but we don't all do python.

Given Perl, freebsd, windows ... our softwares need versions not only for interaction with modules/libraries within the natural ecosystem (for instance pip) but it should also nicely fit in upper container version conventions (OS, containers, other languages convention when you bind on foreign language libraries ...). Version numbering needs a standard. And semantic versionning propose a grammar but no parsers. So here I am to help the world.

The problem is we cannot remember one grammar per language/OS/ecosystem, espcially if they are conflicting.

PEP 440 with the post/pre weird special case does not look like very inspired by the tao of python (at my wrongful opinion of someone who did not took the time to read all the distutils mailing list because he was too busy fighting against a lot of software bugs at his job, and doing nothing at home).

So as when there are already a lot of standards you don't understand or cant choose from ... I made mine \o/

Back to basics: versions are monotonic growing numbers that don't support + - / * just comparisons


Version is a monotonic growing number.

Basically if I publish a new version it should always be seen superior to the previous one. Which is basically a number property.

In fact version can almost be seen as a 3 (or n) digit number in a special numbering such as

version_number = sum(map(project_number_in_finite_base(("X.Y.Z").split(".")))

The problem is if we reason in fixed numbered based logic, we have an intel memory addressing problem since every X, Y, Z number can cover an infinite range of values they can be a loss of monotonic growth (there can be confusion in ordering).

So we can abstract version number as digit in infinite bases that are directly comparable

I am luckily using a subset of PEP440 for my numbering that is the following

By defining
X = API  > Y = improvment > Z = bugfix

I state for a user that: given a choice of my software I guarantee your versions number to be growing monotonically on X / Y / Z axis in fashion such has you can focus on API compatibility, implementation (if API stay the same but code change without bug, it is a change of implementation), correctness.

As some devs, I also use informally "2a" like in 1.1.2a to notice a short term bugfix that does not satisfy me (I thus strongly encourage people to switch from 1.1.2x to 1.1.3 as soon as it comes. I normally keep the «letter thing» in the last number

If people are fine with API 1 implementation 1 they should be easily able to pinpoint versions to grow to the next release without pain.

So how do we compare numbers in a n infinite dimensional basis in python ?

Well, we have tuples \o/

Thanks to the comparison arithmetic of tuple  they can be considered to be a number when it comes to "==" , ">" and these are the 2 needed only basic operations we should need to do on versions (all other operation can be derived from the latter).

Version is a monotonically growing number, but it is on a non fixed base.

Next_version != last_version + 1

if version is a number V comparaison of V1 and V2 has sense, addition or substraction cannot have.

One of the caveat though of version numbering is our confusing jargon:
if we decided version where X.Y.Z why do we expect version 2 is equivalent to 2.0.0 instead of 0.0.2?  Because when we say python version 2 we expect people to hear python version 2.x  and preferably the latest. Same for linux 2 (covering 2.x.y ...) it is like writing the number «20» «2» and expecting people to correct according to the context.

So the exercise of version comparaison is having a convention to know how to compare numbers according to API, implementation and bugfix dimensions hierarchically speaking in respect to the undetermination introduced by human inconsistent notation.

Just for fun, I made a parser of my own version string to a numbering convention including the later twist where 2 means 2.0 or 2.0.0 when compared to 1.0 or 1.0.0. It addresses the examples to solve given in PEP440

It can be seen here.

Wrapping up

For me a version is an abstract representation of a number in infinite base which figures are hierarchically separated by points that you can read from left to right.
I am saying the figures are made of a tuple of two dimensional space of digit and letters where digit matters more than letters. (Yes, I am putting a number in a figure, it is sooo fractal).

But most important of all, I think versioning string is a representation of a monotonic growing number.

I am pretty sure PEP 440 is way better than my definition is has been crafted by a consensus of people I deeply respect.

My problem, is that I need to achieve the same goal as them, with less energy they have on modeling what a version number is.

That is the reason why I crafted my own deterministic version numbering that I believe to be a subset of PEP 440.



My semantic might be wrong, but at least I have a KISS versioning system that works as announced and is easily portable and for wich I have a simple grammar that does quite a few tricks and an intuitive comprehension.

And human beings are wrong too (why version 2 is 2.0.0 if compared to 2.1.1 and 2 if compared to 2.1 or 2 if compared to 3), but who cares? I can simply cope with.

NB it works with "YYYY.MM.AA.number" (SOA) scheme too,

PS thinking of adding y-rcx stuff by slightly enhancing the definition of a figure.

PPS I don't like talking to people normally so I disabled comments, but for this one I am making an effort :
because I am quite curious of your opinions

Perfect unusable code: or how to modelize code and distributivity

So let's speak of what and un/deterministic code really are.

I am gonna prove that you can achieve nearly chaotic series of states with deterministic code \o/


Deterministic: code is deterministic if the same input always yield the same output

Chaotic: a time serie of value is considered chaotic if knowing of sample of t-n samples cannot make you able to predict the t+1 term. 

Turing Machine: a computer that does not worth more than a cassette player.

Complex system: a set of simple deterministic object connected together that can result in non deterministic behavior.

lambda function: stateless functions without internal states.

FSM (finite state machine): a stuff necessary in electronic because time is relativistic (Einstein).

Mapping: a mathematical operation/computer stuff that describes a projection of input discrete dimension A to output discrete dimension B. 

Now let's play real life turing machine.

Imagine I give you an old K7 player with a band of 30 minutes and every minutes I tell the result of n x 3.
If you go at minutes 3 the K7 will tell 9.
If you go at minutes 5 you will hear 15. 

This is the most stupid computer you can have. 
My tape is a program. The index (minutes) is the input, and the output is the what is said. 

So let's do a python Basically we did a mapping from the index on the tape in minutes to integers that yields index(in minutes) x 3. 

So what do we learn with this?

That I can turn code into turing machines, that I can use as a code with a 1:1 relationship, I have a ... mapping \o/

What does compile does?
It evaluates for all the input possible that is an integer belongs to [0:255] all the output possible of boolean function. It is a projection of [2^8] input => 2 output
I projected a discrete space of input to a discrete space of output.

Let's see why it is great

My code is fully deterministic and is threadsafe because my code is stateless.

It is an index of all the 256 solutions for f(x) for every possible values.

if I encode a function that tells if a number can be divided by X another one by Y to have the function that tells if a number can be divided by (X * Y) I just have to apply then & (bitwise and operator) to the int representing the code.

An int is a very cool for a storage of function.
With div2 / div 3 I can by applying all the «common bitwise operator» create a lot of interesting functions:

div2xor3 : a code that indicates number that can be divided by 2 or 3 but not 6
not div2: every even/odd number
div2or3: multiple of 2, 3 and 6
div2and3: multiple of 6 only

I can combine the 16 bliter operations to directly obtain functions.

In functional programming you do partial function that you apply in a pipe of execution, here you can directly combine the code at «implementation level»

My evaluation is always taking the same number of cycles, I don't have to worry about worst case, and my code will never suffer from indetermination (neither in execution time nor results). My code is ultimately threadsafe as long as my code storage and my inputs are immutables. 

My function are commutative thus I can distribute them.

div2(div3(val)) == div3(div2(val)) (== div6(val))

=> combining function is a simple and of the code

Why we don't use that in real life

First there is a big problem of size.

To store all the results for all the possible inputs, I have to allocate the cross product of size of input * size of output.

A simple multiplication table by 3 for all the 32 bits integers would be 32 bit * 32 bits = an array of 4billions worlds of 32 bits. 16Gbytes!

Not very efficient.

But if we work on a torus of discrete value, it can work :)

Imagine my FPU is slow and I need cos(x) with an error margin sufficient to only work in 1/256 of radians? I can store my results as an array of precomputed cosinus value expressed in fraction of 256%256 :)

A cache with memoization is also using the same principle.
You replace computing code that is long by a lookup in a table.

It might be a little more evoluted than reading a bit in an integer, but it is globally the same principle.

So actually, that is one of the biggest use of the turing machine: efficient caching of pre computed values.

Another default, is that the mapping make you lose information on what the developer meant.

If you just have the integer representing your code, more than one function can yield the same code. The mapping from the space of the possible function to the space of the solutions is a surjection.

Thus if you have a bug in this code, you cannot revert back to the algorithm and fix it.

if I consider I have not a number of n bit as an input but n input of 1 bit constituting my state input vector,  and the output is my internal state, than I am modeling a node of a parallel computer. This «code» can be wired (few clocks costs) as a muxer that is deterministic in its execution time and dazzling fast.

What is the use of this anyway?

Well, it models deterministic code.

I can generate random code and see how they interact.

The Conway's Game of life is a setup of turing machine interconnected to each other in a massively parallel fashion.

So my next step is to prove I can generate pure random numbers with totally deterministic code.

And I can tell you I can prove the condition for my modified game of life to yield chaotic like results is that the level of similarity for every code on every automaton is low (entropy of patterns is high) AND 50% of the bits are 0/1 in code (maximizing the entropy of the code in ratio of bits).


Date convention: an extra-ordinary conservatism that is screwing are life and code

The other day, as distracted as I am, I had to reprint, re-sign and resend all my forms.


I had to write the date in numbers.

Well september sound like seven/septus (in latin) thus it is 07 wrong it is 09. Every time I get caught.

What is this mess?

Days of the weeks are supposed to be the 7 observable planets (at the time the convention were set) of the solar system (used in astrology, a sign of scientific seriousness).

Some months are 31 days because some emperor wanted to be remembered as "as great (august) than other's" (julius).
It is not beginning on the shortest day of the year, else it would be a pagan fest discrediting the roman catholic empire. But it must have began in march once in the past (thus sept 7 ...december 10).
It is made of 12 solar month because of superstition that makes 13 a dangerous number...

And  in computer coding it is a fucking mess.

Not to add the local timezone unreliable informations who are so versatile because of political conventions that makes it impossible to time stamp information in a real reliable way.

Why all of this?

We spend a non neglectable time and energy with dealing with this hell, while trying to promote progress; something that easily substantially improve our lives.

We can change protocols, language in a snap of fingers to accelerate speed of software execution, but one of the biggest burden for reliable data storage is still there under our nose. And we are blind; it is the date mess.

Let's face it: a change would be welcomed and cool with mostly benefits.

Dropping superstition and politics from our calendar would have more advantages. Here is my idea:

First I like solar calendar (a calendar that begins or ends when the distance to the sun is either the biggest or the smallest). The shortest day being the winter solstice on 21st of december. It used to be a "pagan" fest. But who cares, it is fun to have a feast when the worst of winter (or the best of summer) is at its best.

Then 365 = 364 + 1 = 13 x 28 + 1

Well, 13 months of 28 days :) it is coincidentally a lunar month, which in itself would make it an hybrid catholic/islamic compliant calendar.

When to add an extra day and where?

Well obvisouly when given a certain point the day the shortest officially is not the same as the one from the sun. Which day? Let's say that the world special day of every year is new year's eve, it could be nice to have also a day off on the longest day of the year to enjoy it on bissextile years. Or share the pleasure of enjoying new year's tradition with people from the other hemisphere in the same season :)

This calendar will help the kids make sense of the world.

Knowing that Janus was an old forgotten two faced god representing the present existence (one head looking to the past/memories the other to the future/projects) worshiped by a gone civilization won't help kid much more than learning of seasons and when and why it happens this way.

So I have a simple internationally translatable for naming.

Kids will learn day and math at the same time:

The first day of the week will be 0D or zero day then 1Day/Tag/Dias/whatever, then 2D ... .  By convention to have given us the actual calendar latin representation of day could be D like the first letter for day in latin.
The second would be incremented by 1 and so long. Every culture could use whatever sound nice for day's name and try to relate them with numbers. It does not have to be said one, it could be mono, uno, ein, the day of whatever come by one.

This way, kids and people learning a new language learn basic numbering and week days at the same time...

I propose it begins like hours with 0 this way we have good algebraic rules for calculating and it makes day/time math consistent with each others. it begins with 0 like hours.

A work week is thus an interval [0 : 5]
the week day in 4 weeks + 5 days = d + 4 % 7

And NOW I could write my date in numerical format the same way I know the day in the "usual way of saying", I don't have any more traps when I want to know what is the day of the week in 16 days. I don't need conversions ... I am happy to forget a load of useless tricky informations.

Any way, with my idea, we introduce math and knowing days of the week at same time in school.

Okay there is the case of the intercalar day that is special. For this one there will be rule, but now, at
least time calculus become as consistent as the metric system. And we can eradicate this Aristotelian stupidity that all should be periodic and harmonic in a science to be true.

We make them learn calculus in different bases (24/60/7/13/365) and a tinge of introduction on the reality of the world (telling that days don't make 24 hours because there is an epsilon of chaos in the real world that don't match our first models, and that all periodicity don't always match real numbers. So it is cool. It is a lot more information packed in a single convention.

We learn kids how to deal with inconvenient maths and how we human face with it. And learning compromise is cool.

Kids can be taught to watch the moon, the sun, the season, and every things makes sense.

You can introduce trigonometry with calculating hour of the day with the course of the sun. You can tell the story of how with a camel and a stick you can compute the earth radius...

You can relate the abstract universe and its vastness with our all days life. You can encompass a great deal of our civilizations' progress in simply changing the date conventions. Indian, Arabs, Europeans, Mogol, Chinese, Babylonians ... they all gave us something worth in the new calendar. It is not a calendar based on forgetting the past, but at the opposite it is the topmost conservative calendar. It will more dense in knowledge and culture and values than ever. It becomes a compressed set of knowledge, easier to manipulate even for those without knowledge.

Sticking to date mess is not technical issue, but a civilization one: it is just us being cavemen hitting on our keyboards respecting weird divinities of the past in superstition. Superstition, even disguise in the technical words of cargo cult science is still superstition. Blindness based on spending billions on software bugs due to stupid convention seems less efficient than fixing the real world. It  would improve our lives even out of computer world.
 But I still write software to makes thing easy for people that want a progress that makes their life easier and not wishing to change what gives us trouble in the first place: not computer or math, just stupid conventions..

Practical sense and lazyness are pretty much the 2 main qualities of humanity I would like a system to make us share. Not a strongly superstitious anachronic history loaded artifact that screws my every day life. So that's my propposal for a better world.

Non linearity and clock in distributed system

How the word distributed matters

Let's imagine Einstein existed, and two observers live with different clocks.

According to their differential acceleration, their clock diverge according to a 3rd observers.

Let's name observers 3 the user. And two components of a distributed system A & B.

Let's assume A & B have a resource for treating information per seconds called bandwidth. Let's assume that the more load, the more it takes time to treat instruction. Let's say that it means the clock «slowed down».

Let's assume that tasks are in form f x g x h .... (data). where f g and h are composable functions. And let's assume A or B can treat 2 sets of functions that can be overlapping.

Now let's make a pun a choose only function that supports distributivity vs non linear functions and see what happens.

if  {f, g, h} is an ECOC (Ensemble Complet d'Opération qui Commuttent) then f x g x h gives the same results as h x g x f applied to the data.

Thus, the distributed system does not need a clock, because g(data) does not have any hidden relationship with f(data) in terms of chronology. It works perfectly has just message iteration between functions. The function can be applied in any order. No chronology needed.

Whereas if you use non linear functions you introduce time, and your system must have a central clock that will be the limiting factor of your «distributed system» aka the fastest speed at which you can guaranty transactionality.

Ex: banking system.

I cannot let an actor spends money if is credit/account = 0.

So if I send in parallel the actions of putting money and retrieving it there is an order. I cannot let a user trigger withdrawal after withdrawal (that are fast operations) as long as the slow accounting informations are not treated.

I have to put a lock. Something to ensure the absolute state at a reference moment called now. As a result I cannot distribute in an even fashion on a distributed system  my task. I have a global Lock that must exists.

Because of pure geometry acquiring and releasing this lock has a minimal incompressible delay.

Inside a single CPU : Speed of light, centimeters, nanoseconds.
Inside a LAN : Network latency, meter :  , X ms
Inside a WLAN: kilometer XXXms.
Worldwide: X Seconds.

Since there can be no global states without information transmitted, a global state requires the introduction of a unique absolute arbitrer.

The more distributed your system, the more redundant, the more your clock diminishes if you have transactions. That is an incompressible limiting factor.

What happens with Commutative operations?

Well, they are dazzling fast. You can implement a robust dazzling fast system distributed system.

Commutative functions can be executed out of order.

They just require to be routed as mush time needed in the right circuitry.

Meaning you can avoid a congested node easily, because you can reroute actively at the node level without knowledge of the global system, just the state of congestion of your neighbours.

An efficient distributed system should support only distributive operations that are asynchronuously delivered. And, reciprocally if you want want an asynchronuous system that can scale, you should not accept non commutative operations. 

The commutative part should be distributed, the non linear one should be more logically treated ideally on a strongly synchronuous not distributed system. Systems where the clock is ideally one cycle, thus ideally close to the metal using all the trick of atomic instructions.

Oh, another lad is asking why you can't use your fancy nosql distributed system to have a nice leaderboard for his game.
Well, a > b is a non linear system, sorting is non linear. So well, somwhere a clock or a lock or a finite state machine, or a scheduler has kicked in.
Non linear operations introduce a before and an after. With loss of informations.

if you need the result of a>b then a and b being 2 distributive operations, then you have to wait for both a and b before processing in non reversible way.

To ensure everything was made in the right order, in a non distributive way; there had to be time, so that action are made in the right order. Every non linear operation in a distributed system introduces an hidden clock.

Are non linear operation bad?

I call them filters. I think they are a hell of a good idea, but I say it is very hard to make them distributed. So we should live with them and architecture our distributed system accordingly.

(PS in the map reduce idea, Map can be seen as dedicated for stuff that are commutative, and Reduce for the non commutative one)

PS Let's imagine a distributed system with Forth or RPN

def Radius: square SWAP square SUM 
def square : DUP *
def sum : +

Can I write a²+b² as distributed system?

Data Stack : a b
Exec distributed Radius

Can I play the operation of square, swap square sum in any order?

f(a, b) = f(b,a) thus it is commutative. But what is the problem?

The use of a stack introduce a scheduling because there is now a relation ship of order on the application of the operation hidden in the data structure/passing. so a queue is also a introducing a clock.
Distributed system should be wired (message passing) and not programmed (actively scheduling tasks).