Those a’s and b’s to put inside (a + b) when doing (a + b) power (p+q)

My editorial

I am finishing compiling notes for that article on the role of monetary systems in the transition towards renewable energies, at least I hope I am. This is a bit of a strange frame of mind when I hope I am. Could I be hoping I am not? Interesting question. Anyway, one of the ways I make sure I understand what I am writing about is to take a classic, whom I previously kind of attached to this particular piece of science I am trying to make, and I kind of filter my own thoughts and findings through that particular classic’s thoughts and findings. This time, Thomas Bayes is my classic. Didn’t have much to do with renewable energies, you would say? Weeeell, he was a philosopher and a mathematician, but he lived (and died) in the 18th century, when Europe was being powered by wind and water, thus, as a matter of fact, he had much to do with renewable energies. At the end of the 18th century, in my homeland – Southern Poland, and back in the day is was Austrian Galicia – there was one watermill per 382 people, on average.

And so I am rereading the posthumous article, attributed to reverend Thomas Bayes, received by Mr John Canton, an editor of ‘Philosophical Transactions’ at the Royal Society. On the 23rd of December, 1763, John Canton read a letter, sent from Newington-Green, on the 10th of November, by Mr Richard Price. The letter was being accompanied by an attachment, in the form of a dissertation on ‘the doctrine of chances’, allegedly found by Mr Price in the notes of a defunct friend, Thomas Bayes. The friend had been defunct for two years, at the time, which is quite intriguing in itself. Anyway, Mr Richard Price presented the dissertation as Thomas Bayes’ work, and this is how Bayesian statistics were born  (Bayes, Price 1763[1]). Just as a reminder: in Thomas Bayes’ world, we are talking about having p successes and q failures in p + q trials, in the presence of one single success being probable at the rate ‘a’, and the probability of a single failure being ‘b’. The general way of thinking about it, in this specific universe, is that we take the sum of probabilities, like (a + b), and we give it some depth by elevating it to the power p + q. We create a space of probability through developing the Newtonian binomial (a + b)p+q.

At this point it is useful to dig a little bit into the logic of the Newtonian binomial. When I do (a + b)p+q , Isaac Newton tells me to kind of climb a ladder towards q, one step at a time, and so I am climbing that ladder of failure. First, I consider full success, so my p successes are exactly equal to my n trials, and my failure count is q = 0. In this most optimistic case, the number of different ways I can have that full score of successes is equal to the binomial coefficient (pq/q!) = (p0/0!) = 1/1 = 1. I have just one way of being successful in every trial I take, whatever the number of trials, and whatever the probability of a single success. The probability attached to that one-million-dollar shot is (pq/q!)*ap. See that second factor, the ap.? The more successes I want the least probability I have them all. A probability is a fraction smaller than 1. When I elevate it to any integer, it gets smaller. If the probability of a single success is like fifty-fifty, thus a = 0,5, and I want 5 successes on 5 trials, and I want no failures at all, I can expect those five bull’s eyes with a probability of (50/0!)*0,55 = 0,55 = 0,03125. Now, if I want 7 successes on 7 trials, zero failures, my seven-on-seven-shots-in-the-middle-probability is equal to (70/0!)*0,57 = 0,57 = 0,0078125. See? All I wanted was two more points scored, seven on seven instead of five on five, and this arrogant Newtonian-Bayesian approach sliced my odds by four times.

Now, I admit I can tolerate one failure over n trials, and the rest has to be just pure success, and so my q = 1. I repeat the same procedure: (p1/1!)*ap-1b1. With the data I have just invented, 4 successes on 5 trials, with 0,5 odds of having a single success, so with a = b = 0.5, I have (41/1!) = 4 ways of having that precise compound score. Those 4 ways give me, at the bottom line, a compound probability of (41/1!)*0,54*0,51 = 4*0,54*0,51 = 0,125. Let’s repeat, just to make it sink. Seven trials, two failures, five successes, one success being as probable as one failure, namely a = b = 0,5. How many ways of having 5 successes and 2 failures do I have over 7 trials? I have (52/2!) = 12,5 them ways. How can I possibly have 12,5 ways of doing something? This is precisely the corkscrewed mind of Thomas Bayes: I have between 12 and 13 ways of reaching that particular score. The ‘between’ has become a staple of the whole Bayesian theory.

Now, I return to my sheep, as the French say. My sheep are renewable (energies). Let’s say I have statistics telling me that in my home country, Poland, I have 12,52% of electricity being generated from renewable sources, A.D. 2014. If I think that generating a single kilowatt-hour the green way is a success, my probability of single success, so P(p=1) = a = 0,1252. The probability of a failure is P(q=1) = b = 1 – 0,1252 = 0,8748. How many kilowatt-hours do I generate? Maybe just enough for one person, which, once again averaged, was 2495,843402 kg of oil equivalent or 29026,65877 kilowatt hour per year per capita (multiplied the oil of by 11,63 to get the kilowatt hours). Here, Thomas Bayes reminds me gently: ‘Mr Wasniewski, I wrote about the probability of having just a few successes and a few failures over a few plus a few equals a few total number trials. More than 29 thousands of those kilowatt-hours or whatever it is you want, it is really hard to qualify under ‘a few’. Reduce.’ Good, so I reduce into megawatt hours, and that gives me like n = 29.

Now, according to Thomas Bayes’ logic, I create a space of probabilities by doing (0,1252 + 0,8748)29. The biggest mistake I could make at this point would be to assume that 0,1252 + 0,8748 = 1, which is true, of course, but most impractical for creating spaces of probability. The right way of thinking about it is that I have two distinct occurrences, one marked 0,1252, the other marked 0,8748, and I project those occurrences into a space made of 29 dimensions. In this interesting world, where you have between six and eight ways of being late or being tall, I have like patches of probability. Each of those patches reflects my preferences. You want to have 5 megawatt hours, out of those 29, generated from renewable sources, Mr Wasniewski? As you please, that will make you odds of ((529-5/(29-5)!)*0,12525*0,874829-5 = 1,19236E-13 of reaching this particular score. The problem, Mr Wasniewski, is that you have only 0,000000096 ways of reaching it, which is a bit impractical, as ways come. Could be impossible to do, as a matter of fact.

So, when I create my multiverse of probability the Thomas Bayes way, some patches of probability turn out to be just impracticable. If I have like only 0,000000096 ways of doing something, I have a locked box, with the key to the lock being locked inside the box. No point in bothering about it. When I settle for 10 megawatt hours successfully generated from renewable sources, against 19 megawatt hours coming from them fossil fuels, the situation changes. I have ((1029-10)/(29-10)!) = 82,20635247, or rather between 82 and 83, although closer to 82 ways of achieving this particular result. The cumulative probability of 10 successes, which I can score in those 82,20635247 ways, is equal to ((1029-10)/(29-10)!)*0,125210*0,874829-10 =  0,0000013. Looks a bit like the probability of meeting an alien civilisation whilst standing on my head at 5 a.m. in Lisbon, but mind you, this is just one patch of probability, and I have more than 82 ways of hitting it. My (0,1252 + 0,8748)29 multiverse contains 29! = 8,84176E+30 such patches of probability, some of them practicable, like 10 megawatt hours out of 29, others not quite, like 5 megawatt hours over 29. Although Thomas Bayes wanted to escape the de Moivre – Laplace world of great numbers, he didn’t truly manage to. As you can see, patches of probability on the sides of this multiverse, with very few successes or very few failures, seem blinking red, like the ‘Occupied’ sign on the door to restrooms. Only those kind of balanced ones, close to successes and failures scoring close to fifty-fifty, yield more than one way of hitting them. Close to the mean, man, you’re safe and feasible, but as you go away from the mean, you can become less than one, kind of.

Thus, if I want to use the original Bayesian method in my thinking about the transition towards renewable energies, it is better to consider those balanced cases, which I can express in the form of just a few successes and a few failures. As tail events enter into my scope of research, so when I am really honest about it, I have to settle for the classical approach based on the mean, expected values, de Moivre – Laplace way. I can change my optic to use the Bayesian method more efficiently, though. I consider 5 local projects, in 5 different towns, and I want to assess the odds of at least 3 of them succeeding. I create my multiverse of probabilities as (0,1252 + 0,8748)3+2=5, which has the advantage of containing just 5! = 120 distinct patches of probability. Kind of more affordable. Among those 120 patches of probability, my target, namely 3 successful local projects out of 5 initiated, amounts to (32/2!) = 4,5 ways of doing it (so between 4 and 5), and all those alternative ways yield a compound probability of (32/2!)*0,12523*0,87472 = 0,006758387. Definitely easier to wrap my mind around it.

I said, at the beginning of the today’s update, that I am using Thomas Bayes’ theory as a filter for my findings, just to check my logic. Now, I see that the results of my quantitative tests, those presented in previous updates, should be transformed into simple probabilities, those a’s and b’s to put inside (a + b) when doing (a + b)p+q. My preferences as for successes and failures should be kept simple and realistic, better below 10.

[1] Mr. Bayes, and Mr Price. “An essay towards solving a problem in the doctrine of chances. by the late rev. mr. bayes, frs communicated by mr. price, in a letter to john canton, amfrs.” Philosophical Transactions (1683-1775) (1763): 370-418

A race across target states, or Bayes and Nakamoto together

My editorial

And so I continue prodding my idea of local, green energy systems, with different theories of probability. The three inside me – my curious ape, my austere monk, and my happy bulldog – are having a conversation with two wise men: reverend Thomas Bayes, and Satoshi Nakamoto. If you need to keep track of my last updates, you can refer to ‘Time puts order in the happening’ as well as to ‘Thomas Bayes, Satoshi Nakamoto et bigos’. And so I am at the lemmas formulated by Thomas Bayes, and at the basic analytical model proposed by Nakamoto. Lemma #1 by Thomas Bayes says: ‘The probability that the point o will fall between any two points in the line AB is the ratio of the distance between the two points to the whole line AB’. Although Thomas Bayes provides a very abundant geometric proof to this statement, I think it is one of those things you just grasp intuitively. My chances of ever being at the coast of the Pacific Ocean are greater than those of ever visiting one tiny, coastal village in the Hawaii, just because the total coastline of the Pacific is much bigger an expanse than one, tiny, Hawaiian village. The bigger is my target zone in relation to the whole universe of probability, the greater is my probability of hitting the target. Now, in lemma #2, we read pretty much the same, just with some details added: ‘The ball W having been thrown, and the line os drawn, the probability of the event M in a single trial is the ratio of Ao to AB’.

I think a little reminder is due in relation to those two Bayesian lemmas. As for the detailed Bayes’s logic, you can refer to Bayes, Price 1763[1], and I am just re-sketching the landscape, now. The whole universe of probability, in Thomas Bayes’s method, is a flat rectangle ABCD, with corners being named clockwise, starting from A at the bottom right, as if that whole universe started around 4 o’clock. AB is kind of width of anything that can happen. Although this universe is a rectangle, it is essentially unidimensional, and AB is that dimension. I throw two balls, W and O. I throw W as the first, at the point where it lands in the rectangle ABCD becomes a landmark. I draw a line through that point, perpendicular to AB, crossing AB at the point o, and CD and the point s. The line os becomes the Mississippi river of that rectangle: from now on, two sub-universes emerge. There is that sub-universe of M happening, or success, namely of the second ball, the O, landing between the lines os and AD (in the East). On the other hand, there are all those strange things that happen on the other side of the line os, and those things are generally non-M, and they are failures to happen. The probability of the second ball O hitting M, or landing between the lines os and AD, is equal to p, or p = P(M). The probability of the ball O landing west of Mississippi, between the lines os and BC, is equal to q, and this is the probability of a single failure.

On the grounds of those two lemmas, Thomas Bayes states one of the most fundamental propositions of his whole theory, namely proposition #8: ‘If upon BA you erect a figure BghikmA, whose property is this, that (the base BA being divided into any two parts, as Ab and Bb and at the point of division b a perpendicular being erected and terminated by the figure in m; and y, x, r representing respectively the ratio of bm, Ab, and Bb to AB, and E being the coefficient of the term in which occurs ap*bq when the binomial [a + b]p + q is expanded) y = E*xp*rq. I say that before the ball W is thrown, the probability the point o should fall between f and b, any two points named in the line AB, and that the event M should happen p times and fail q [times] in p + q = n trials, is the ratio of fghikmb, the part of the figure BghikmA intercepted between the perpendiculars fg, bm, raised upon the line AB, to CA the square upon AB’.

Right, I think that with all those lines, points, sections, and whatnot, you could do with some graphics. Just click on this link to the original image of the Bayesian rectangle and you will see it as I tried to recreate it from the original. I think I did it kind of rectangle-perfectly. Still, according to my teachers of art, at school, my butterflies could very well be my elephants, so be clement in your judgment. Anyway, this is the Bayesian world, ingeniously reducing the number of dimensions. How? Well, in a rectangular universe ABCD, anything that can happen is basically described by the powers ABBC or BCAB. Still, if I assume that things happen just kind of on one edge, the AB, and this happening is projected upon the opposite edge CD, and the remaining two edges, namely BC and DA, just standing aside and watching, I can reduce a square problem to a linear one. I think this is the whole power of geometry in mathematical thinking. Whilst it would be foolish to expect rectangular universes in our everyday life, it helps in dealing with dimensions.

Now, you can see the essence of the original Bayesian approach: imagine a universe of occurrences, give it some depth by adding dimensions, then give it some simplicity by taking some dimensions away from it, and map your occurrences in thus created an expanse of things that can happen. Now, I jump to Satoshi Nakamoto and his universe. I will quote, to give an accurate account of the original logic: ‘The success event is the honest chain being extended by one block, increasing its lead by +1, and the failure event is the attacker’s chain being extended by one block, reducing the gap by -1. The probability of an attacker catching up from a given deficit is analogous to a Gambler’s Ruin problem. Suppose a gambler with unlimited credit starts at a deficit and plays potentially an infinite number of trials to try to reach breakeven. We can calculate the probability he ever reaches breakeven, or that an attacker ever catches up with the honest chain, as follows:

p = probability an honest node finds the next block

q = probability the attacker finds the next block

qz = probability the attacker will ever catch up from z blocks behind

Now, I rephrase slightly the original Nakamoto’s writing, as the online utilities I am using on my mutually mirroring blogs – https://discoversocialsciences.com and https://researchsocialsci.blogspot.com – are not really at home with displaying equations. And so, if p ≤ q, then qz = 1. If, on the other hand, p > q, my qz = (q/p)z. As I mentioned it in one of my previous posts, I use the original Satoshi Nakamoto’s thinking in the a contrario way, where my idea of local green energy systems is the Nakamoto’s attacker, and tries to catch up, on the actual socio-economic reality from z blocks behind. For the moment, and basically fault of a better idea, I assume that my blocks can be carved in time or in capital. I explain: catching from z blocks behind might mean catching in time, like from a temporal lag, or catching up across the expanse of the capital market. I take a local community, like a town, and I imagine its timeline over the 10 years to come. Each unit of time (day, week, month, year) is one block in the chain. Me, with my new idea, I am the attacker, and I am competing with other possible ideas for the development and/or conservation of that local community. Each idea, mine and the others, tries to catch over those blocks of time. The Nakamoto’s logic allows me to guess the right time frame, in the first place, and my relative chances in competition. Is there any period of time, over which I can reasonably expect my idea to take over the whole community, sort of qz = 1 ? This value z can also be my time advantage over other projects. If yes, this will be my maximal planning horizon. If not, I just simulate my qz with different extensions of time (different values of z), and I try to figure out how does my odds change as z changes.

If, instead of moving through time, I am moving across the capital market, my initial question changes: is there any amount of capital, like any amount z of capital chunks, which makes my qz = 1 ? If yes, what is it? If no, what schedule of fundraising should I adopt?

Mind you, this is a race: the greater my z, the lower my qz. The more time I have to cover in order to have my project launched, the lower my chances to ever catch on. This is a notable difference between the Bayesian framework and that by Satoshi Nakamoto. The former says: your chances to succeed grow as the size of your target zone grows in relation to everything that can possibly happen. The more flexible you are, the greater are your chances of success. On the other hand, in the Nakamoto’s framework, the word of wisdom is different: the greater your handicap over other projects, ideas, people and whatnot, in terms of time or resources to grab, the lower your chances of succeeding. The total wisdom coming from that is: if I want to design a business plan for those local, green energy systems, I have to imagine something flexible (a large zone of target states), and, in the same time, something endowed with pretty comfortable a pole position over my rivals. I guess that, at this point, you will say: good, you could have come to that right at the beginning. ‘Be flexible and gain some initial advantage’ is not really science. This is real life. Yes, but what I am trying to demonstrate is precisely the junction between the theory of probability and real life.

[1] Mr. Bayes, and Mr Price. “An essay towards solving a problem in the doctrine of chances. by the late rev. mr. bayes, frs communicated by mr. price, in a letter to john canton, amfrs.” Philosophical Transactions (1683-1775) (1763): 370-418

Time puts order in the happening

My editorial

I am developing on what I have done so far. The process, I believe, is called ‘living’, in general, but I am approaching just a tiny bit of it, namely my latest developments on making a local community run at 100% on green energy (see my latest updates “Conversations between the dead and the living (no candles)” and ‘Quelque chose de rationnellement prévisible’). I am working with the logic of Bayesian statistics, and more specifically with the patient zero of this intellectual stream, reverend Thomas Bayes in person (Bayes, Price 1763[1]). I have those four conditions, which, taken together, define my success:

Q(RE) = S(RE) = D(E) << 100% of energy from local green sources

and

P(RE) ≤ PP(E) << price of renewable energy, within individual purchasing power

and

ROA ≥ ROA* << return on assets from local green installations superior or equal to a benchmark value

and

W/M(T1) > W/M(T0) << a local virtual currency based on green energy takes on the market, progressively

Now, as I study the original writing by Thomas Bayes, and as I read his geometrical reasoning, I think I should stretch a little the universe of my success. Stretching universes allows a better perspective. Thomas Bayes defines the probability of a p successes and q failures in p + q = n trials as E*ap*bq, where a and b are the simple probabilities of, respectively, p and q happening just once, and E is the factor of ap*bq, when you expand the binomial (a + b)p+q. That factor is equal to E = pq/q!, by the way. Thank you, Isaac Newton. Thank you, Blaise Pascal. Anyway, if I define my success as just one success, so if I take p = 1, it makes no sense. That Bayesian expression tends to yield a probability of success equal to 100%, in such cases, which, whilst comforting in some way, sounds just stupid. A universe made of one hypothetical success, and nothing but failures fault of success, seems a bit rigid for the Bayesian approach.

And so I am thinking about applying those four conditions to individuals, and not necessarily to whole communities. I mean, my success would be one person fulfilling all those conditions. Let’s have a look. Conditions 1 and 2, no problem. One person can do Q(RE) = S(RE) = D(E), or consume as much energy as they need and all that in green. One person can also easily P(RE) ≤ PP(E) or pay for that green energy no more than their purchasing power allows. With condition 4, it becomes tricky. I mean, I can imagine that one single person uses more and more of the Wasun, or that local cryptocurrency, and that more and more gets bigger and bigger when compared to the plain credit in established currency that the same person is using. Still, individual people hold really disparate monetary balances: just compare yourself to Justin Bieber and you will see the gap. In monetary balances of significantly different a size, structure can differ a lot, too. Thus, whilst I can imagine an individual person doing W/M(T1) > W/M(T0), that would take a lot of averaging. As for condition 3, or ROA ≥ ROA*, I think that it just wouldn’t work at the individual level. Of course, I could do all that sort of gymnastics like ‘what if the local energy system is a cooperative, what if every person in the local community has some shares in it, what if their return on those shares impacted significantly their overall return on assets etc.’ Honestly, I am not feeling the blues, in this case. I just don’t trust too many whatifs at once. ROA is ROA, it is an accounting measure, I like it solid and transparent, without creative accounting.

Thus, as I consider stretching my universe, some dimensions look more stretchable than others. Happens all the time, nothing to inform the government about, and yet educative. The way I formulate my conditions of success impacts the way I can measure the odds of achieving it. Some conditions are more flexible than others, and those conditions are more prone to fancy mathematical thinking. Those stiff ones, i.e. not very stretchable, are something the economists don’t really like. They are called ‘real options’ or ‘discreet variables’ and they just look clumsy in a model. Anyway, I am certainly going to return to that stretching of my universe, subsequently, but now I want to take a dive into the Bayesian logic. In order to get anywhere, once immersed, I need to expand that binomial: (a + b)p+q. Raising anything to a power is like meddling with the number of dimensions the thing stretches along. Myself, for example, raised to power 0.75, or ¾, means that first, I gave myself a three-dimensional extension, which I usually pleasantly experience, and then, I tried to express this three-dimension existence with a four-dimensional denominator, with time added to the game. As a result, after having elevated myself to power 0.75, I end up with plenty of time I don’t know what to do with. Somehow familiar, but I don’t like it. Dimensions I don’t know what to do with look like pure waste to me. On the whole, I prefer elevating myself to integers. At least, I stay in control.

This, in turn, suggests a geometrical representation, which I indeed can find with Thomas Bayes. In Section II of this article, Thomas Bayes starts with writing the basic postulates: ‘Postulate 1. I suppose the square table or plane ABCD to be so levelled that if either of the balls O or W be thrown upon it, there shall be the same probability that it rests upon any one equal part of the plane or another, and that it must necessarily rest somewhere upon it. Postulate 2. I suppose that the ball W will be first thrown, and through the point where it rests a line ‘os’ shall be drawn parallel to AD, and meeting CD and AB in s and o; and that afterwards the ball O will be thrown p + q = n times, and that its resting between AD and os after a single throw be called the happening of the event M in a single trial’. OK, so that’s the original universe by reverend Bayes. Interesting. A universe is defined, with a finite number of dimensions. Anyway, as I am an economist, I will subsequently reduce any number of dimensions to just two, as reverend Bayes did. As my little example of elevating myself to power 0.75 showed, there is no point in having more dimensions than you can handle. Two is fine.

In that k-dimensional universe, two events happen, in a sequence. The first one is the peg event: it sets a reference point, and a reference tangent. That tangent divides the initial universe into two parts, sort of on the right of the Milky Way as opposed to all those buggers on the left of it. The, the second event happens, and this one is me in action: I take n trials with p successes and q failures. Good. As I am quickly thinking about it, it gives me always one extra dimension over the k dimensions in my universe. That extra dimension is order rather than size. In the original notation by Thomas Bayes, he has two dimensions in his square, and then time happens, and two events happen in that time. Time puts order in the happening of the two events. Hence, that extra dimension should be sort of discrete, with well-defined steps and no available states in between. I have two states of my k-dimensional universe: state sort of 1 with just the peg event in it, and sort of state 2, with my performance added inside. State 1 narrows down the scope of happening in state 2, and I want to know the odds of state 2 happening within that scope.

Now, I am thinking about ball identity. I mean, what could make that first, intrepid ball W, which throws itself head first to set the first state of my universe. From the first condition, I take the individual demand for energy: D(E). The second condition yields individual purchasing power regarding energy PP(E), the third one suggests the benchmark value regarding the return on assets ROA*. I have a bit of a problem with the fourth condition, but after some simplification I think that I can take time, just as reverend Bayes did. My W ball will be the state of things at the moment T0, regarding the monetary system, or W/M(T0). Good, so my universe can get some order through four moves, in which I set four peg values, taken from the four conditions. The extra dimension in my universe is precisely the process of setting those benchmarks.

[1] Mr. Bayes, and Mr Price. “An essay towards solving a problem in the doctrine of chances. by the late rev. mr. bayes, frs communicated by mr. price, in a letter to john canton, amfrs.” Philosophical Transactions (1683-1775) (1763): 370-418