As a follow-up to my 2018 Smart Temperature and Humidity Gauge here is a new and improved wireless version. A smartphone screen replaces the previous LCD display, allowing the data to be read remotely from the device location. The four displayed parameters are the same, but the previous Absolute Humidity formula with its -30°C to +35°C range has been replaced with a new formula (Mander 2020) with an extended temperature range.

The WiFi-enabled microcontroller can be programmed to operate in Station mode, Access Point mode or both modes simultaneously so you can use the device at home, at work, on the beach, wherever you want to know the values of the parameters which determine your comfort.

The wireless function also enables you to read temperatures inside a closed compartment such as a fridge. By following the readings on your smartphone (I set mine to refresh every 20 secs) you can see what the upper and lower thermostat settings are. For example the air in the 4°C compartment of our fridge cycles between 2.9°C and 7.5°C. I was surprised by this to begin with, but then realized that things stored in fridges generally have significantly larger heat capacities than air so their temperatures will cycle over narrower ranges.

The original Smart Gauge prototype with attached LCD display

– – – –

Hardware

The CarnotCycleAIR Smart Gauge is built around an Arduino IDE compatible Sparkfun ESP8266 Thing Dev microcontroller featuring an integrated FTDI USB-to-Serial chip for easy programming. A 2-pin JST connector has been soldered to the footprint alongside the micro-USB port and the board is powered by a rechargeable 3.7V lithium polymer flat pouch battery which fits neatly underneath the standard 400 tie-point breadboard. The system is designed to work with DHT sensors such as the DHT22 with a temperature range of -40°C to +80°C and relative humidity range of 0-100%, or the DHT11 with a temperature range of 0°C to +50°C and relative humidity range of 20-90%. These are available mounted on 3-pin breakout boards which feature built-in pull-up resistors. Both sensors are designed to function on the 3.3V supplied by the board, enabling the signal output to be connected directly to one of the board’s I/O pins without the need for a logic level converter [the ESP8266’s I/O pins do not easily tolerate voltages higher than 3.3V. Using 5V will blow it up].

Note: Comparing temperature readings in ambient conditions with an accurate glass thermometer has shown that when the sensors are plugged directly into the breadboard they record a temperature approx. 1°C higher than the true temperature, which in turn affects the accuracy of the computed absolute humidity and dewpoint. The cause appears to be Joule heating in the breadboard circuitry. Using jumper leads to distance the sensor from the board solves the problem.

When used in Station mode the range is determined largely by the router. In Access Point mode where the device and smartphone communicate directly with each other, the default PCB trace antenna was found to work really well with an obstacle-free range of at least 35 meters (115 feet).

A Sparkfun LiPo Charger Basic, an incredibly tiny device just 3 cm long with a JST connector at one end and a micro-USB connector at the other, was used to recharge the battery. Charging time was about 4 hours.

The Sparkfun LiPo Charger Basic

– – – –

Circuitry

The circuitry for CarnotCycleAIR Smart Gauge couldn’t be simpler.

The ESP8266 (with header pins) is placed along the center of the breadboard and 3.3V is supplied to the power bus from the left header (3V3, GND). The DHT sensor is powered from this bus and the signal is routed to a suitable pin. I used pin 12 on the right header. That’s all there is to it.

– – – –

Coding extensions

CarnotCycleAIR Smart Gauge is a further development of an ESP8266 project – “ESP8266 NodeMCU Access Point (AP) for Web Server” – published online by Random Nerd Tutorials which displays temperature and relative humidity on a smartphone with the ESP8266 set up as an Access Point.

CarnotCycleAIR uses these variables to compute and display two further comfort parameters, Absolute Humidity and Dewpoint. If you are interested in building the CarnotCycleAIR Smart Gauge described in this blogpost, you will need to make extensions to the source code published online at https://randomnerdtutorials.com/esp8266-nodemcu-access-point-ap-web-server:

1. Declare global variables for absolute humidity and dewpoint. I named these variables ah and td (dewpoint is actually a temperature).
2. In the html body code add paragraphs for absolute humidity and dewpoint below those for temperature and relative humidity using the same format.
3. In the html script code add setInterval(function (){ … } coding for absolute humidity and dewpoint below those for temperature and relative humidity using the same format.
4. In void setup, add server.on coding for absolute humidity and dewpoint below those for temperature and relative humidity using the same format.
5. In void loop, add computation coding and serial print lines for absolute humidity and dewpoint. Place the code above the penultimate close brace. The formulas are published in these blogposts:

https://carnotcycle.wordpress.com/2020/08/01/compute-absolute-humidity-from-relative-humidity-and-temperature-50c-to-140c
https://carnotcycle.wordpress.com/2017/08/01/compute-dewpoint-temperature-from-rh-t

– – – –

© P Mander December 2021

Every day this blog gets visits from all over the world, and in numbers which show that thermodynamics interests many, many people. They come from lands big and small, rich and poor, happy and less-than-happy. And they are all united in their desire for knowledge.

Knowledge is power. And in the case of thermodynamics, that knowledge is especially powerful.

There are now 100 posts and pages on this blog, covering a sizeable range of topics in thermodynamics and allied disciplines. They are written for enquiring minds, and it is truly gratifying to see so much of the CarnotCycle resource being accessed by so many.

Thank you for visiting.

full house

CarnotCycle is a thermodynamics blog but occasionally takes five for recreation

In popular variants of poker like Texas Hold’em, players form their best hand from the two cards dealt to them and five community cards – seven cards in total. Compared to 5-card poker, the frequency and probability profile of 7-card poker is shifted upscale, with one-pair and two-pair hands actually having a greater probability than a high-card hand.

Calculating frequencies for 7-card hands is a bit of a nightmare due to flushes and straights tending to intrude into other hands, and the mathematical expressions can get very complicated. These are given on Wikipedia’s page “Poker Probability” but there is no accompanying explanation of how each expression is arrived at. This blogpost attempts to supply it.

I have also included a section on starter hand frequencies and probabilities at the end.

– – – –

Combinatorial expressions

Combination nCr
The number of ways cards taken r at a time from n can be combined

example n = 3 (AKQ), r = 2
3C2 = AK, AQ, KQ
In combinations, order does not matter.

Permutation nPr
The number of ways cards taken r at a time from n can be arranged

example n = 3 (AKQ), r = 2
3P2 = AK, KA, AQ, QA, KQ, QK
In permutations, order matters.

– – – –

Frequency expressions for 7-card poker hands

Royal flush

1 straight: AKQJ10

This hand accounts for 5 cards from the pack. The 6th and 7th cards can be any two of the remaining 47 as they will not affect the hand rank.

Ways to choose suits for straight 4C1 = 4
Ways to choose 6th and 7th cards 47C2 = 1081

4 x 1081 = 4,324 hands

Probability = 0.00003232062056
– – – –

Straight flush

9 straights: KQJ109, QJ1098, J10987, 109876, 98765, 87654, 76543, 65432, 5432A

This hand accounts for 6 cards rather than 5, since the next higher rank cannot be chosen as it would change the hand rank. The 6th and 7th cards can be any two of the remaining 46.

Ways to choose straights 9C1 = 9
Ways to choose suits 4C1 = 4
Ways to choose 6th and 7th cards 46C2 = 1035

9 x 4 x 1035 = 37,260 hands

Probability = 0.000278507475

– – – –

Four of a kind

This hand accounts for 4 cards from the pack. The 5th, 6th and 7th cards can be any three of the remaining 48.

Ways to choose rank for quad 13C1 = 13
Ways to choose suits for quad 4C4 = 1
Ways to choose three extra cards 48C3 = 17296

13 x 17296 = 224,848 hands

Probability = 0.001680672269

– – – –

Full house

This hand can be composed from 7 cards in three different ways:
A] two triples and a single AAA BBB C
B] a triple and two pairs AAA BB CC
C] a triple, a pair and two singles eg AAA BB C D

A] two triples and a single
Ways to choose ranks for triples 13C2 = 78
Ways to choose suits for triples 4C3 x 4C3 = 16
Ways choose single 44C1 (the two triple ranks make 8 cards unavailable) = 44

A = 78 x 16 x 44 = 54912

B] a triple and two pairs
Ways to choose rank for triple 13C1 = 13
Ways to choose ranks for two pairs 12C2 = 66
Ways to choose suits for triple 4C3 = 4
Ways to choose suits for two pairs 4C2 x 4C2 = 36

B = 13 x 66 x 4 x 36 = 123552

C] a triple, a pair and two singles
Ways to choose rank for triple 13C1 = 13
Ways to choose rank for pair 12C1 = 12
Ways to choose ranks for two singles 11C2 = 55
Ways to choose suits for triple 4C3 = 4
Ways to choose suits for pair 4C2 = 6
Ways to choose suits for two singles 4C1 x 4C1 = 16

C = 13 x 12 x 55 x 4 x 6 x 16 = 3294720

A + B + C = 54912 + 123552 + 3294720 = 3,473,184 hands

Probability = 0.025961022

– – – –

Flush

This hand can be composed from 7 cards in three different ways:
A] from 7 cards of same suit
B] from 6 cards of same suit plus an offsuit
C] from 5 cards of same suit plus two offsuits

A] from 7 cards of same suit
Ways to choose suit 4C1 = 4
Ways to choose ranks 13C7 = 1716
Subtract royal flush and straight flush:
1xRF has 5 ranks, 8 remain. 8C2 = 28 ways to choose 6th+7th card
9xSF has 6 ranks since next higher rank not used, 7 remain. 7C2 = 21 ways to choose 6th+7th card
(1 x 28) + (9 x 21) = 217

A = 4 x (1716 – 217) = 5996

B] from 6 cards of same suit plus an offsuit
Ways to choose suit 4C1 = 4
Ways to choose ranks 13C6 = 1716
Subtract royal flush and straight flush:
1xRF has 5 ranks, 8 remain. 8C1 = 8 ways to choose 6th card
9xSF has 6 ranks since next higher rank not used, 7 remain. 7C1 = 7 ways to make 6th card
(1 x 8) + (9 x 7) = 71
Ways to choose offsuit 39C1 = 39

B = 4 x (1716 – 71) x 39 = 256,620

C] from 5 cards of same suit plus two offsuits
Ways to choose suit 4C1 = 4
Ways to choose ranks 13C5 = 1287
Subtract royal flush and straight flush:
1xRF + 9xSF = 10
Ways to choose two offsuits 39C2 = 741

C = 4 x (1287 – 10) x 741 = 3,785,028

A + B + C = 5996 + 256,620 + 3,785,028 = 4,047,644 hands

Probability = 0.030254941

– – – –

Straight

This hand can be composed from 7 cards in three different ways:
A] from a set of 7 distinct ranks ABCDEFG
B] from a set of 6 distinct ranks including a pair ABCDEFF
C] from a set of 5 distinct ranks including two pairs or a triple ABCDDEE or ABCDEEE

A] from a set of 7 distinct ranks
Ways to form a set of 7 distinct ranks which include 5 consecutive ranks = 217
Ways to choose suit 4^7
Subtract flushes:
Ways to choose 7 cards in same suit = 7C7 x 4C1= 4
Ways to choose 6 cards in same suit = (7C6 x 4C1) x 3C1 = 84
Ways to choose 5 cards in the same suit = (7C5 x 4C1) x 3C1 x 3C1 = 756

A = 217 x (4^7 – 4 – 84 – 756) = 3,372,180

B] from a set of 6 distinct ranks including a pair
Ways to form a set of 6 distinct ranks which include 5 consecutive ranks = 71
Ways to choose rank of pair 6C1 = 6
Ways to choose suits for pair 6C1 = 6
Ways to choose suits for the other cards = 4^5
Subtract flushes: 4 + (5 x 3 x 2) = 34

B = 71 x 6 x 6 x (4^5 – 34) = 2,530,440

C] from a set of 5 distinct ranks including two pairs or a triple
Ways to form a set of 5 consecutive ranks = 10
– – – – including two pairs:
Ways to choose ranks of pairs 5C2 = 10
Ways to choose suits of pairs and 3 remaining cards = 6 x 62 + 24 x 63 + 6 x 64 = 2268
– – – – including triple:
Ways to choose rank of triple 5C1 = 5
Ways to choose suits for triple 4C3 = 4
Ways to choose suits of 4 remaining cards = 4^4
Subtract flushes for which 4 remaining cards have suit matching one in triple = 3

C = (10 x 10 x 2268) + (10 x 5 x 4 x (4^4 – 3)) = 277,400

A + B + C = 3,372,180 + 2,530,440 + 277,400 = 6,180,020 hands

Probability = 0.04619382

– – – –

Three of a kind

This hand is composed from 7 cards having 5 distinct ranks AAA BCDE

Ways to choose ranks 13C5 = 1287
Subtract straights = 10
Ways to choose rank of triple 5C1 = 5
Ways to choose suits for triple 4C3 = 4
Ways to choose suits of 4 remaining cards = 4^4
Subtract flushes for which 4 remaining cards have suit matching one in triple = 3

(1287 – 10) x 5 x 4 x (4^4 – 3) = 6,461,620 hands

Probability = 0.048298697

– – – –

Two pair

This hand can be composed from 7 cards in two different ways:
A] from three pairs plus a single AA BB CC D
B] from two pairs plus three singles of distinct rank AA BB CDE

– – – – for three pairs plus a single
Ways to choose ranks of three pairs 13C3 = 286
Ways to choose suits of three pairs 4C2 x 4C2 x 4C2 = 216
Ways to choose single (the three pair ranks make 12 cards unavailable) 40C1 = 40
– – – – for two pairs plus three singles
Ways to choose ranks of 5 cards 13C5 = 1287
Subtract straights = 10
Ways to choose ranks of two pairs 5C2 = 10
Ways to choose suits of pairs and 3 remaining cards = 6 x 62 + 24 x 63 + 6 x 64 = 2268

(286 x 216 x 40) + (1287 – 10) x 10 x 2268 = 31,433,400

Probability = 0.234955364

– – – –

One pair

This hand is composed from 7 cards having 6 distinct ranks AA BCDEF

Ways to choose ranks 13C6 = 1716
Subtract royal flush and straight flush:
1xRF has 5 ranks, 8 remain. 8C1 = 8 ways to choose 6th card
9xSF has 6 ranks since next higher rank not used, 7 remain. 7C1 = 7 ways to make 6th card
(1 x 8) + (9 x 7) = 71
Ways to choose rank of pair 6C1 = 6
Ways to choose suits for pair 4C2 = 6
Ways to choose suits of 5 remaining cards = 4^5
Subtract flushes: 4 + (5 x 3 x 2) = 34

(1716 – 71) x 6 x 6 x (4^5 – (4 + 5x3x2) = 58,627,800

Probability = 0.438225457

– – – –

High card

This hand is composed from 7 cards having 7 distinct ranks ABCDEFG

Ways to choose ranks 13C7 = 1716
Subtract royal flush and straight flush:
1xRF has 5 ranks, 8 remain. 8C2 = 28 ways to choose 6th+7th card
9xSF has 6 ranks since next higher rank not used, 7 remain. 7C2 = 21 ways to choose 6th+7th card
(1 x 28) + (9 x 21) = 217
Ways to choose suits = 4^7
Subtract flushes:
Ways to choose 7 cards in same suit = 7C7 x 4C1= 4
Ways to choose 6 cards in same suit = (7C6 x 4C1) x 3C1 = 84
Ways to choose 5 cards in the same suit = (7C5 x 4C1) x 3C1 x 3C1 = 756

(13C7 – 217) x (4^7 – 4 – 84 – 756) = 23,294,460 hands

Probability (5/7) = 0.174119195

– – – –

Frequency and probability of 7-card Poker hands

The equiprobable sample space comprises 52C7 = 133,784,560 7-card hands
94% of hands are in the lowest 5 categories

7 cards containing:
Frequency
Probability
Royal flush
4324
0.000032320
Straight flush
37260
0.000278507
Four of a kind
224848
0.001680672
Full house
3473184
0.025961022
Flush
4047644
0.030254941
Straight
6180020
0.046193820
Three of a kind
6461620
0.048298697
Two pair
31433400
0.234955364
One pair
58627800
0.438225457
High card
23294460
0.174119195
end

– – – –

Starting hand frequency and probability

The equiprobable sample space comprises 52C2 = 1326 starting hands
There are three categories of starting hand:

Pair (same rank)

Ways to choose rank 13C1 = 13
Ways to choose suits 4C2 = 6
13C1 x 4C2 = 78 hands (probability 5.88%)

Suited hand (same suit)

Ways to choose suit 4C1 = 4
Ways to choose ranks 13C2 = 78
4C1 x 13C2 = 312 hands (probability 23.53%)

Offsuit hand (different suits different ranks)

Ways to choose suits 4C2 = 6
Ways to choose ranks 13C1 x 12C1 = 13P2* = 156
4C2 x 13P2 = 936 hands (probability 70.59%)

– – alternatively – –

Ways to choose ranks 13C2 = 78
Ways to choose suits 4C1 x 3C1 = 4P2* = 12
13C2 x 4P2 = 936 hands (probability 70.59%)

*permutation (of 2 ranks from 13, or 2 suits from 4) can be used here instead of combination because order matters e.g. A7♣ ≠ A♣7. Permutation is applied to ranks or suits but not both because one automatically transposes the other.

Total 78 + 312 + 936 = 1326 starting hands

– – – –

P Mander April 2021

The statue of Thomas Graham, sculpted by William Brodie in 1872

On the south-eastern corner of Glasgow’s George Square is a fine statue of Thomas Graham (1805-1869). Born and raised in the city, he became a chemistry student at the University of Glasgow and graduated there in 1826. At some point in his studies he happened to read about an observation made by the German chemist Johann Döbereiner (1780-1849) that hydrogen gas leaked out from a crack in a glass bottle faster than air leaked in. It was this simple fact that set Thomas Graham on the path to scientific fame. But before we continue, a few words about Johann Döbereiner.

– – – –

Döbereiner’s lamp – the first lighter

Johann Döbereiner, professor of chemistry at the University of Jena, invented this amazing piece of apparatus in 1823, while Thomas Graham was still an undergraduate student in Scotland. It consists of a glass container (a) filled with dilute sulfuric acid and inside it an inverted cup (b) in which is suspended a lump of zinc metal (c,d). When the tap (e) is opened, the acid enters the cup and reacts with the zinc, producing hydrogen gas which flows out of a tube (f) and onto a piece of platinum gauze (g). Now here is the interesting part. The gauze catalyzes the reaction of hydrogen with atmospheric oxygen, producing a lot of heat in the process. The platinum gauze gets red hot and ignites the hydrogen flowing out of the tube, producing a handy flame for lighting candles, cigars, etc. In the days before matches, this gadget was a godsend and became a commercial hit with thousands being mass produced in a wonderful range of styles. A YouTube demonstration of Döbereiner’s Lamp can be seen here.

In a paper published in 1823, Döbereiner recorded the observation that hydrogen stored in a glass jar over water leaked out from a crack in the glass much faster than the surrounding air leaked in, causing the level of the water to rise significantly. This was the trigger for Graham’s research into the phenomenon of diffusion, during which he discovered not only an important quantitative relation between diffusion and gas density but also a means by which the separation of mixed gases could be achieved.

– – – –

Graham’s experiments on effusion

Taking his cue from Döbereiner’s leaking glass jar, Graham developed apparatus by which he could study the rate of escape of a contained gas through a small hole in a piece of platinum foil. This particular kind of diffusion, where the flux is restricted to a tiny orifice between one gaseous environment and another, is called effusion.

The rates of effusion of two gases can be compared using the apparatus illustrated. The first gas is introduced through the three-way tap C to fill the entire tube B. The tap is closed and the gas is then allowed to effuse through the hole in the platinum foil A. The time taken for the liquid level to rise from X to Y is recorded as the gas escapes into the atmosphere. The experiment is then repeated with the second gas. If the recorded times are t1 for the first gas and t2 for the second, the rates of effusion are in the ratio t2/t1.

Using this method Graham discovered that the rate of escape of a gas was inversely related to its density: for example hydrogen escaped 4 times faster than oxygen. Given that the density of oxygen is 16 times that of hydrogen, the nature of the inverse relation suggested itself and was confirmed by comparisons with other gases.

In 1829, Graham submitted an internal research paper in which he recorded his experimentally determined relation between the effusion rates of gases and their densities

Graham also experimented with binary gases, and noted that the greater rate of escape of the lighter gas made it possible to achieve a measure of mechanical separation by this means.

– – – –

Graham’s Law

By 1831 Graham had recognized that the comparative rates of effusion of two gases into the atmosphere could equally be applied to the diffusion of two gases in contact.

On Monday 19th December 1831, Graham read a paper before the Royal Society of Edinburgh in which he stated his eponymous square root law. This paper was published in the Philosophical Magazine in 1833 while he was professor of chemistry at Anderson’s College in Glasgow. Four years later he moved to London to became professor of chemistry at University College, where in 1848 he embraced Avogadro’s hypothesis by stating that the rate of diffusion of a gas is inversely proportional to the square root of its molecular weight.

Hence if the rates of diffusion of two gases are known and the molar mass of one is known, the molar mass of the other can be calculated from the relation

In 1910 the French chemist André-Louis Debièrne, a close associate of Pierre and Marie Curie, used this relation to calculate the molecular weight of Radon gas. (Trivial Fact: Debièrne was one of those fortunate Frenchmen to be born on France’s national day, Le Quatorze Juillet – 14 July. So every year his birthday was a national holiday :-)

– – – –

Thermodynamics and Kinetics

In the first half of the 19th century, the understanding of gases rested on the gas laws which Sadi Carnot’s compatriot Émile Clapeyron synthesized into the ideal gas law pv = RT in 1834. Meanwhile Avogadro’s hypothesis of 1811 laid the foundations of molecular theory from which developed the idea that gases consisted of large numbers of very small perfectly elastic particles moving in all directions through largely empty space.

These two strands of thought came together in the notion that gas pressure could be attributed to the random impacts of molecules on the walls of the containing vessel. In Germany Rudolf Clausius produced a paper in 1857 in which he derived a formula connecting pressure p and volume v in a system of n gas molecules of mass m moving with individual velocity c

In this equation we see the meeting of thermodynamics on the left with kinetic theory on the right. And it points up a feature of thermodynamic expressions that commonly escapes notice. We are taught that in classical thermodynamics, the time dimension is absent as a unit of measure although entropy is sometimes cast in this role as “the arrow of time”. But the fact is that time is very much present when you apply dimensional analysis.

Pressure is force per unit area and has dimensions ML-1T-2. And there is the time dimension T, in the definition of the thermodynamic intensive variable pressure. This is what enabled Clausius to equate a time-dependent expression on the right with a seemingly time-independent one on the left.

– – – –

Kinetic Theory and Graham’s Law

Since density ρ is mass per unit volume, the above equation can be written

If the rate of effusion/diffusion of a gas is taken to be proportional to the root mean square velocity of the gas molecules, then at constant pressure

which is the first statement of Graham’s law.

For 1 mole of gas, the aforementioned Clausius equation can be written as

where V is the molar volume, R is the gas constant, T is the temperature and N is the Avogadro number. Since the product of the Avogadro number N and the molecular mass m is the molar mass M, it follows that

Again, if the rate of effusion/diffusion of a gas is taken to be proportional to the root mean square velocity of the gas molecules, then at constant temperature

which is the second statement of Graham’s law.

– – – –

Graham’s Law and uranium enrichment

Plaque marking the site of the K-25 plant at Oak Ridge Tennessee.

Back in 1829 Thomas Graham noted from his effusion experiments on binary gases that a measure of mechanical separation could be achieved by this means. Over a century later, that observation was of crucial importance to the scientists engaged in the Manhattan Project which produced the first nuclear weapons during WW2.

To produce an atomic bomb required a considerable quantity of the fissile uranium isotope 235U. The problem was that this isotope makes up only about 0.7% of naturally occurring uranium. Substantial enrichment was necessary, and this was achieved in part by employing gaseous effusion of uranium hexafluoride UF6. Since fluorine has a single naturally occurring isotope, the difference in weights of 235UF6 and 238UF6 is due solely to the difference in weights of the uranium isotopes and so a degree of separation can be achieved.

The optimal effusion rate quotient (√ 352/349) is only 1.0043 so it was clear to the Manhattan Project engineers that a large number of separation steps would be necessary to obtain sufficient enrichment, and this was done at Oak Ridge Tennessee with the construction of the K-25 plant which ultimately consisted of 2,892 stages.

In more recent times, the development of the Zippe-type centrifuge made the gas diffusion method of 235U isotope separation redundant and led to the closure of the K-25 plant in 2013. The Zippe-type centrifuge is considerably more energy-efficient than gaseous diffusion, has less gaseous material in circulation during separation, and takes up less space.

– – – –

Further reading

Thomas Graham biography at encyclopedia.com

link: https://www.encyclopedia.com/people/science-and-technology/chemistry-biographies/thomas-graham

Thomas Graham Contributions to diffusion of gases and liquids, colloids, dialysis and osmosis Jaime Wisniak, 2013 (contains comprehensive references to Graham’s published work)

link: https://www.sciencedirect.com/science/article/pii/S0187893X13725217#bib0005

– – – –

P Mander, February 2021

balls and bag

One of the books with a valued place on the shelves of the CarnotCycle library is Introduction to Statistical Thermodynamics by Malcolm Dole (1903-1990) who had a long and distinguished career at Northwestern Tech, and who incidentally was involved in the operations of the K-25 plant at Oak Ridge, TN. The Dole Effect, which led to carbon replacing oxygen as the reference standard for atomic weights, is named for him.

But back to his book. In the chapter on the math of probability, Professor Dole illustrates the multiplication and addition rules with this sampling problem:

“A bag contains 2 white balls and 3 black balls, all balls being indistinguishable except for their colors. Three balls are drawn from the bag; what is the probability that the third ball is white?”

OK, there are two ways to solve this problem. One way is to list the sequences in which three balls can be drawn ending with a white ball on the third draw. Letting W represent the drawing of a white ball and B represent the drawing of a black ball, we have

W – B – W
B – W – W
B – B – W

Next we apply the multiplication rule to calculate the probabilities of the three sequences

W – B – W
2/5 × 3/4 × 1/2 = 6/60
B – W – W
3/5 × 2/4 × 1/3 = 6/60
B – B – W
3/5 × 2/4 × 2/3 = 12/60
end

Finally we apply the addition rule to get the answer: 6/60 + 6/60 + 12/60 = 24/60 = 2/5. The probability that the third ball is white is 2/5. Problem solved. Now we can go look at Facebook.

Hey but hang on, you said there were two ways. What’s the other way?

The other way is difficult to put into words but can be described as the illusion of sampling, in the sense of appearing simply to take balls out of the bag. If you read the question again, you will notice that the colors of the first two balls drawn from the bag are not mentioned. Does this matter? Yes it does, because unless this information is supplied, the sampling procedure cannot be said to exclude putting the first and second balls back in the bag before drawing the third.

So the second way is to recognize this and calculate on the basis of sampling with replacement. Under these circumstances, at each draw there are always 2 white balls and 3 black balls in the bag and the probability of drawing a white ball is always 2/5. It’s a lot quicker to get the answer this way.

But wait a minute, the probability calculations above did not involve replacing any balls, so how come the answer turned out as 2/5?

The best way to see this is to visualize the entire set of sequences of drawing all five balls. Using the combinatorial math for permutation with repetition we see there are 5!/2!3! = 10 sequences in total. For simplicity, the diagram below shows only the white balls in each sequence.

 1   2   3   4   5 
O O
O O
O O
O O
O O
O O
O O
O O
O O
O O

end
What you are looking at here is the probability distribution of the two white balls in the absence of any information concerning the colors of balls drawn from the bag, which according to the principle established above is equivalent to sampling with replacement. Hence there must be four white balls in each column, representing the 4/10 = 2/5 probability of a white ball in that position. This is what the probability calculations given above are actually computing for row 2 (W-B-W), row 5 (B-W-W) and rows 8 and 9 (B-B-W) in column 3.

– – – –

A playing card analogy

Another way to illustrate the illusion of sampling is to replace the bag and the 2 white and 3 black balls with a pack of 5 playing cards of which 2 are red suits and 3 are black suits. Two cards are drawn from the pack and placed face down on the table. The question is now asked, what is the probability that the third card drawn is red? The answer is immediately 2/5 since the suits of the first two cards have not been revealed – under these circumstances all cards have the same 2/5 probability of being red. Dealing cards face down is therefore equivalent to sampling with replacement. It is not until the cards have been looked at that they can be considered by the person(s) doing the looking as a sample taken from the pack.

– – – –

P Mander April 2021