September 2023

The Principle of Insufficient Reason

Also known as the principle of indifference states, if you have a bunch of theories and don’t have a reason to prefer one of them, then they all get the same prior probability.

1) what is the probability that the trillionth digit of pi is 5? Well, until you do the calculations, the prior probability is 1 in 10.

2) Andy knows his friend Becky will arrive at the City airport between 9:00 and 10:00. Five airlines land between these timings. Airline A and B on terminal 1, C and D on terminal 2 and E on terminal 3. What should Andy do? He can eliminate terminal 3 (the lowest probability of 1/5) and then toss a coin and decide between 1 and 2 (equal prior probabilities of 2/5 each) accordingly.

The Principle of Insufficient Reason Read More »

Electricity Production – Power – Energy Gap

We have seen the carbon intensity of the various national electric grids in the previous post. India is one of the countries with a reasonable growth of renewables – 40% installed power of non-fossil fuel-based electricity – yet with one of the higher carbon intensities in the group with 632 gCO2/kWh. We use that example to explain the difference between power and energy.

Power vs Energy

Power, defined as W, kW, MW etc., is the capacity of the generator to deliver the electric energy. And energy is what is delivered by the machine to do work. For example, if a one MW system runs for one hour, it produces 1 MWh of energy. In other words, a 1 MW system delivers 8.76 GWh of energy a year if it works full-time (1 x 24 x 365). But, if the same generator works only 10% of the time, it produces 876 MWh.

Capacity factor

We have encountered it before. It is the actual amount of energy obtained (in MWh) in an average hour of the year if you install a one MW plant. You can get it by dividing the exact electricity output by the maximum possible.

Let’s look at India’s electricity production (excluding utility and captive Power).

And the installed power,

You can see the issue: the installed power from non-fossil-fuel-based electricity production is in the 40s, whereas the energy contribution is only in the 20s. The capacity factors are estimated by dividing the power with the corresponding energy for a 24-running generator.

Note the low capacity factor for the gas generators. It is not an inherent problem of gas turbines but is likely due to controlled production as a flexible means to manage the peak load requirements.

Reference

CO2 Emissions in 2022: IEA
Electricity production: Enerdata
Carbon Dioxide Emissions From Electricity: world-nuclear.org
Greenhouse gas emissions: Our World in Data
Electricity Mix: Our World in Data
Electricity sector in India: Wiki
Renewable energy in India: Wiki

Electricity Production – Power – Energy Gap Read More »

Electricity Production – Power and Energy

The global emissions of CO2, which is about three-quarters of all greenhouse gases, stood at 36.8 Gt in 2022. A third of the CO2 comes from power production. Reduction of CO2 intensity, therefore, is crucial for a few reasons. First, it reduces the present emissions. More importantly, a cleaner grid catalyses future decarbonisation of other industries via electrification.

The carbon intensity of electric grids, expressed as grams of CO2 per kWh of electricity produced, is presented below.

You can see in the plot that the global average is ca. 436.34 gCO2/kWh. Coupled that with 28,528 Terrawat-hour (TWh) of electricity production in 2022, you get 436.34 (gCO2/kWh)* 28528 (TWh) /1e6 = 12.45 Gt CO2.

There are two commonly used units for the power production of an area – energy produced and the installed power. And they often cause some confusion. That is next.

Reference

CO2 Emissions in 2022: IEA
Electricity production: Enerdata
Carbon Dioxide Emissions From Electricity: world-nuclear.org
Greenhouse gas emissions: Our World in Data
Electricity Mix: Our World in Data
Electricity sector in India: Wiki
Renewable energy in India: Wiki

Electricity Production – Power and Energy Read More »

Complex Coin-Toss

Here is a game. If you win the game, you get a dollar; else, you lose one. What is the probability of winning the game?

The game involves a fair coin and two urns.
Urn 1: 3 red balls; 1 blue ball.
Urn 2: 1 red ball; 3 blue balls.
You toss the coin first. If heads, you draw a ball from urn 1 and if tails, urn 2. Drawing a red ball wins the game.

The marginal probability of getting a head is 1/2, and getting a red ball from Urn 1 = 3/4. Therefore, the joint probability of getting a red ball from Urn 1 is (1/2)x(3/4) = (3/8). Similarly, the joint probability of getting a red ball from Urn 2 is (1/2)x(1/4) = (1/8). The overall probability of drawing a red is

(3/8) + (1/8) = (4/8) = (1/2), same as flipping a coin.

Complex Coin-Toss Read More »

Affirming the Consequent

You must have heard similar arguments.

  1. If the lamp is broken, then the room will be dark.
  2. The House is dark.
    So:
  3. The lamp must be broken.

Or another:

  1. Binge drinking leads to liver cirrhosis.
  2. He has liver cirrhosis.
    So:
  3. He must be a binge drinker.

Affirming the consequent is a logical fallacy that starts from a true statement and jumps to the conclusion that the converse form would be true by ignoring alternative explanations. In other words, the truth of the premises can not guarantee the truth of the conclusion. Take the first example: there may be other reasons why the room is dark. It can be a power failure or someone just switched off the light.

‘the lamp is broken’ and ‘binge drinking’ are the antecedents of the arguments. The consequent in the first example is ‘the room will be dark’, and for the second example, it is ‘ liver cirrhosis.’

Smoke without fire

Then there is this proverb, “There’s no smoke without fire”. Like so many other proverbs, this one is also a fallacy.

If fire, then smoke
smoke
So:
fire

Well, there could be a smoke machine, or someone mistook fog as smoke!

Reference

Affirming the consequent: Wiki

Affirming the Consequent Read More »

Program Crashes

A company has bought three software packages for their operations. They are Abacus, Biscuit and Circuit. On average, Abacus crashes 1 in 200 times, Biscuit 1 in 10 times, and Circuit 1 in 50. Of the ten employees, two were assigned Abacus, five got Biscuit, and three received Circuit. If Sophia’s trial crashed on the first trial, what is the probability that she got Abacus?

Use Bayes’ equation to get the answer:

\\ P(A|CR) = \frac{P(CR|A) * P(A)}{P(CR|A) * P(A) + P(CR|B) * P(B) + P(CR|C) * P(C)} \\ \\ = \frac{(1/200) * (0.2)}{(1/200) * (0.2) + (1/10) * (0.5) + (1/50) * (0.3)} = 0.01754

Reference

An Introduction to Probability and Interactive Logic by Ian Hacking

Program Crashes Read More »

The Additionality Problem

We have seen how the cap and trade works. The regulator sets a maximum value for the emissions (cap). It provides allowances, in emission permits, to firms to cover each unit of CO2 (or a pollutant) produced. The company can redeem one for every emission unit or trade it to another party, who can then use it.

Additionality is a term that is closely associated with this. By trading, an emitter can buy offset rather than reduce the emission. A quality offset must mean that GHG reduction has happened by the seller as a result of a project which otherwise would not have been possible. The additionality is a positive intervention that reduces GHG. In other words, it is not additional if the reductions would have happened anyway.

An infamous example is a company that declares offset by buying credits from a project that claims to conserve a forest which was already conserved!

The Additionality Problem Read More »

Random Walk to -30

If a 1-dimensional random walk starts at 0, with steps of one (to the right or left), what is the probability of reaching -30 before reaching 10?

Suppose P30​ is the probability of reaching -30, and (1−P30) is the probability that to end with 10.

Let X be the position on the x-axis at the end of this game
E[X] = -30 x P30 + 10 x (1-P30)
For a random walk with equal steps (+1 or -1), E[X] = 0.
0 = -30 x P30 + 10 x (1-P30)
-10 = P30(-30 -10)
P30 = 1/4 = 0.25 = 25%

Random Walk to -30 Read More »

Random Sampling

We know the ‘sample’ function creates a random sample of elements from a vector. But if you want to get a random sample between two limits, ‘runif’ is the function. Here is a plot of 1000 samples between 0 and 1.

runif(1000, min = 0, max = 1)

Now, here is a question. If A and B are two random points between 0 & 1, what is the probability A / B lies between 1 and 2?

itr <- 1000000

toss <- replicate(itr, {
sa_A <- runif(1)
sa_B <- runif(1)
sam <- sa_A / sa_B

if(sam >= 1 & sam <= 2) {
  counter <- 1
}else{
  counter <- 0
}
})

mean(toss)
0.25

Here is a graphical representation. X/Y between 1 and 2 implies the area between two lines X / Y = 1 (Y = X) and X/Y = 2 (Y = X/2).

The area between the two lines = 1 x 1 – (1/2) x 1 x 1 – (1/2) x 1 x (1/2) = 1 – 0.5 – 0.25 = 0.25.

Random Sampling Read More »

Dice Polynomial – More Types

We have seen how dice values are expressed as polynomials and how the resulting exponents become the sum and coefficients become the number of ways of obtaining the sum. Let’s extend this further and use dice rolling as a technique to estimate the production of polynomials.

(x + x + x^3 + x^4 + x^6 + x^6) * (x + x^2 + x^3 + x^3 + x^5 + x^6)

This is equivalent to two six-sided dice with the following numbers
dice 1: [1, 1, 3, 4, 6, 6]
dice 2: [1, 2, 3, 3, 5, 6]

Throw them a million times, estimate the probability and convert them into whole numbers.

dice_1 <- c(1, 1, 3, 4, 6, 6)
dice_2 <- c(1, 2, 3, 3, 5, 6)
prob_1 <- rep(1/6,6)
prob_2 <- rep(1/6,6)

itr <- 1000000

toss <- replicate(itr, {
sam1 <- sample(dice_1, 1, prob = prob_1, replace = TRUE)
sam2 <- sample(dice_2, 1, prob = prob_2, replace = TRUE)
sam <- sam1 + sam2
})

Let’s write down what we see above:

2x2 + 2x3 + 5x4 + 2x5 + 5x6+ 6x7 + 3x8 + 6x9 + x10 + 2x11 + 2x12

Estimate the product manually (or run it through the ‘Wolfram’ calculator )
2 x^2 + 2 x^3 + 5 x^4 + 2 x^5 + 5 x^6 + 6 x^7 + 3 x^8 + 6 x^9 + x^10 + 2 x^11 + 2 x^12

(x + x + x^3 + x^4 )*(x + x^2 + x^3 + x^3 + x^5 + x^6)

dice_1 <- c(1, 1, 3, 4)
dice_2 <- c(1, 2, 3, 3, 5, 6)
prob_1 <- rep(1/4,4)
prob_2 <- rep(1/6,6)

itr <- 1000000

toss <- replicate(itr, {
sam1 <- sample(dice_1, 1, prob = prob_1, replace = TRUE)
sam2 <- sample(dice_2, 1, prob = prob_2, replace = TRUE)
sam <- sam1 + sam2
})

2x2 + 2x3 + 5x4 + 2x5 + 5x6 + 4x7 + x8 + 2x9 + x10
And the manual calculation gives:
2 x^2 + 2 x^3 + 5 x^4 + 2 x^5 + 5 x^6 + 4 x^7 + x^8 + 2 x^9 + x^10

(x + x + x3 + x4 )*(x + x2 + x3 + x3)

dice_1 <- c(1, 1, 3, 4)
dice_2 <- c(1, 2, 3, 3)
prob_1 <- rep(1/4,4)
prob_2 <- rep(1/4,4)

itr <- 1000000

toss <- replicate(itr, {
sam1 <- sample(dice_1, 1, prob = prob_1, replace = TRUE)
sam2 <- sample(dice_2, 1, prob = prob_2, replace = TRUE)
sam <- sam1 + sam2
})

2 x2 + 2 x3 + 5 x4 + 2 x5 + 3 x6 + 2 x7

Online Factoring Calculator: Wolfram

Dice Polynomial – More Types Read More »