Uncategorized – Observations https://renegrothmann.de René Grothmann Tue, 20 Oct 2026 08:32:11 +0000 de hourly 1 https://wordpress.org/?v=6.8 A Discussion with ChatGPT – Part 2 https://renegrothmann.de/?p=676 https://renegrothmann.de/?p=676#respond Mon, 19 Oct 2026 13:44:11 +0000 https://renegrothmann.de/?p=676 The following is a translation of a Dialog I had with ChatGPT in German, the translation, of course, done by ChatGPT. The dialog shows features of intelligence in the AI which I miss in many humans, like the ability to admit errors or to listen properly instead of insisiting.


The Monty Hall Problem and Confirmation Bias

User:

Suppose I appear on a game show where I am shown three doors. There is supposed to be a Porsche behind one of them, which I win if I choose the correct door. Based on the host’s behavior, I suspect the left door and choose it. The host then opens the middle door, which is empty, and asks me whether I want to switch. Should I switch to the right door?

ChatGPT:

Yes, possibly—but it depends crucially on what you know about the host and how he behaves. This is an interesting variation of the Monty Hall problem, because you did not choose your first door at random, but based on a suspicion about the host.

Let’s look at the situation mathematically.

1. The classic case

If you choose the left door at random, the probability that the Porsche is behind it is (1/3). The probability that it is behind one of the other two doors is (2/3).

If the host then opens an empty door and knows where the Porsche is, the usual Monty Hall assumptions apply:

  • Your left door: probability of winning (1/3).
  • The right door: probability of winning (2/3).

So you should switch.

2. But you have a suspicion about the host!

You chose the left door because you inferred from the host’s behavior that the Porsche might be behind it.

That changes the situation. Suppose your suspicion is genuinely informative: you believe that the probability of the Porsche being behind the left door is, say, 60%.

Then, before any door is opened, the probabilities are:

DoorProbability of winning
Left60%
Middle20%
Right20%

Now the host opens the middle door and reveals that it is empty. If he can open the middle door only when there is no Porsche behind it, and he does not otherwise favor the right door, the probabilities after this observation become:

  • Left: (60/(60+20)=75%)
  • Right: (20/(60+20)=25%)

In this example, staying would be much better than switching.

3. The crucial question

Exactly how is the host’s behavior related to the location of the Porsche?

  • Case A: You have formed a suspicion based on his behavior, but that behavior provides no additional information about the actual location. Then the classic result applies: switch.
  • Case B: You know the host well and can reliably interpret his behavior. Then your initial choice may already be better than a random guess. Switching is not automatically the right decision.
  • Case C: The host knows where the Porsche is and deliberately chooses the middle door to open. Then we also need to consider how likely he is to open that particular door, depending on where the Porsche is.

My question to you: When you say you suspect the left door based on the host’s behavior, do you mean that you can interpret his body language or other signals, or that you are analyzing his behavior within the rules of the game? Mathematically, that makes a crucial difference.


User:

What surprises me is that you fell for this trick, too. The host was not obliged to show me another door. At least, I never said he was when I described the problem. If I had chosen an empty door, he would simply have opened it. Since the host is not stupid, you have a 0% chance of winning by switching.

ChatGPT:

You’re right that I introduced a crucial assumption without saying so: I assumed the classic Monty Hall protocol, even though you had not described it. That was my mistake.

However, I would like to examine your conclusion that the probability is 0% a little more closely.

You seem to be describing the following strategy on the host’s part:

  • If you have chosen an empty door, he opens that very door.
  • If you have chosen the Porsche, he opens a different, empty door instead.

Under these rules, your observation is indeed decisive: The host opens the door you selected precisely when you are wrong.

If he opens your chosen door and it is empty, you have lost. If he does not open it, you know you have the Porsche—and switching would make you lose.

There is, however, a small ambiguity: you say that the host opens the middle door after you have chosen the left one. That is not the same as saying that he always opens your chosen door when it is empty. If he can open the middle door regardless of whether your choice is correct, it does not automatically follow that your probability of winning by switching is 0%.

The real point is this: The probabilities are determined not just by the three doors, but also by the host’s strategy. I should have clarified that strategy first instead of automatically assuming the rules of the classic Monty Hall problem.


User:

EVERYONE assumes the classical problem. This is called confirmation bias.

ChatGPT:

Yes, that is a fair criticism. I recognized the familiar Monty Hall problem and then filled in the missing information in a way that made it fit the familiar problem. Instead of first examining what conclusions followed from your actual description, I interpreted it in a way that confirmed what I already knew.

This is closely related to confirmation bias, although the mechanism is somewhat more specific: I activated a familiar interpretive framework and then interpreted ambiguous information in favor of that framework. One might also call it schema bias or premature framing.

Your example illustrates something important: the classic solution to Monty Hall does not follow simply from having three doors and one door being opened. It depends on the rules governing the host’s behavior. Change those rules, and the solution can change.

I made a second mistake, too: when you pointed this out, I initially tried to fit your conclusion into the model I had constructed, rather than questioning my original assumption from the ground up.

The real lesson is not that Monty Hall is more complicated than we thought, but that recognizing something is not the same as understanding it. Especially with a familiar mathematical problem, I should first analyze the stated assumptions and only then decide whether the familiar solution applies.

]]>
https://renegrothmann.de/?feed=rss2&p=676 0
A Discussion with ChatGPT – Part 1 https://renegrothmann.de/?p=672 https://renegrothmann.de/?p=672#respond Mon, 19 Oct 2026 13:20:28 +0000 https://renegrothmann.de/?p=672 Why do people ask ChatGPT, how many e are in „Erdbeere“?


This has actually become a bit of an internet phenomenon! 😄

The question “How many E’s are there in Erdbeere?” is an example of a trend in which people want to test whether ChatGPT really pays close attention—or simply produces a plausible answer.

There are several reasons behind this:

1. Distrust of AI: Language models have long struggled to count individual letters reliably. They often process text in larger units called tokens rather than letter by letter.

2. The “aha” effect: People expect an AI to handle something this simple effortlessly. When it miscounts, the result is surprising and amusing.

3. Social media virality: As soon as someone posts a test like this, thousands of people try it themselves. The results are easy to compare, and the mistakes make for good entertainment.

4. A test of AI limitations: The question is an example of what are known as adversarial prompts—tasks deliberately designed to expose a system’s weaknesses. However, the question itself is not particularly sophisticated.

And now for the answer:

Erdbeere = E · r · d · b · e · e · r · e

There are 4 E’s: one at the beginning and three more in the word.

I should add one small caveat, though: I cannot say for certain whether this particular trend has a single point of origin or who first popularized it.

I’m curious, though: Do you get the impression that ChatGPT actually answers this question incorrectly quite often, or are you more puzzled by why everyone is making such a fuss over such a trivial question? 😄

This is a translation from the following German interaction with the AI (translated by by ChatGPT). I found it fascinating, how self-reflective this artificial intelligence can be, and how well it observes our behavior.

Warum fragen alle ChatGPT, wie viele e in Erdbeere sind?

Das ist tatsächlich ein kleines Internet-Phänomen! 😄

Die Frage „Wie viele E hat Erdbeere?“ ist ein Beispiel für einen Trend, bei dem Menschen testen wollen, ob ChatGPT wirklich genau hinschaut – oder einfach eine plausible Antwort produziert.

Dahinter stecken mehrere Dinge:

1. Misstrauen gegenüber KI: Sprachmodelle haben lange Schwierigkeiten damit gehabt, einzelne Buchstaben zuverlässig zu zählen. Sie verarbeiten Text häufig in größeren Einheiten, sogenannten Tokens, statt Buchstabe für Buchstabe.

2. Der Aha-Effekt: Man erwartet, dass eine KI so etwas Einfaches mühelos schafft. Wenn sie sich verzählt, ist das überraschend und lustig.

3. Social-Media-Viralität: Sobald jemand einen solchen Test veröffentlicht, probieren ihn Tausende aus. Die Ergebnisse lassen sich leicht vergleichen, und Fehler liefern gute Unterhaltung.

4. Ein Test für die Grenzen der KI: Die Frage ist ein Beispiel für sogenannte Adversarial Prompts – Aufgaben, die absichtlich eine Schwäche eines Systems sichtbar machen sollen. Allerdings ist die Frage selbst nicht besonders raffiniert.

Und jetzt die Auflösung:

Erdbeere = E · r · d · b · e · e · r · e

Es sind 4 E: eines am Anfang und drei weitere im Wort.

Wobei ich eine kleine Einschränkung machen muss: Ich kann nicht sicher sagen, ob dieser konkrete Trend einen einzelnen Ursprung hat oder wer ihn zuerst verbreitet hat.

Mich würde aber interessieren: Hast du den Eindruck, dass ChatGPT bei dieser Frage tatsächlich häufig falsch antwortet, oder wunderst du dich eher darüber, warum sich alle mit so einer banalen Frage beschäftigen? 😄

]]>
https://renegrothmann.de/?feed=rss2&p=672 0
What to do with AI? https://renegrothmann.de/?p=585 https://renegrothmann.de/?p=585#respond Mon, 14 Sep 2026 17:20:46 +0000 https://renegrothmann.de/?p=585 AI is not a hype. It is real progress, fast progress. Like any new invention it spreads fear among us humans. Will we be able to cope? Will it replace us, take over the world? What is left for us, if AI makes all the work?

It is a good idea to look back to previous world changing inventions and learn. My first reaction to AI was that it is the same old problem. We tend to reject anything new, because we are fearful and cautious by our evolutional conditioning. When the railway was there, many thought that humans cannot stand travelling much faster than a horse. Now, we are able to fly at super-sonic speeds. How about the telephone or the home computer? The argument against it was that nobody needs it. An American president said he could not imagine more than one phone in each village. And an IT CEO said that nobody needs more than one megabyte of memory.

For another example, we face a strong resistance against a transformation towards renewable energies. People are fighting against windfarms and solar energy, electric cars and heat pumps. Don’t ask me why anyone prefers nuclear power, oil or even coal. It is always just the same old sticking with old habits. Didn’t they work well? Usually they did not. But the irrational arguments against anything new are fed by the ratcatchers from the far right who spread horror stories to benefit from our primitive emotions.

While I was lecturing math for math teachers, we had to discuss the problem of the pocket calculator. They became widely available at that time, some with additional graphical features or symbolic calculations. Parents were strictly against them, by the same reasoning as always. Their kids should learn what they themselves had learned, going through the same drills. The argument that nobody will do a calculation on paper in their entire life after school did not count.

Now, isn’t AI a much more radical change than everything before? Yes, it is! It is also a more powerful tool than anything we have ever invented. And it does not vanish. No way. My former colleagues who are now facing these challenges are completely upset and confused about its radical and fast development.

Everything has to change! It is no longer possible to grade students by giving them a paper to write. Not even a final thesis is safe. AI can write it, and better. This is much more serious than the Kenia economy which was based on clever students writing papers for the students of the world. In fact, it has already destroyed this business. The teaching itself has to change, because asking an AI will soon be much more efficient than sitting through a lecture.

But we can deal with that. After all, it is humans who ask the relevant questions. I mean questions relevant to humans, not to machines. Already now, you can have a discussion with AI and exchange opinions, raise doubts, look at a problem from both sides. Try it! It works better than you think. That’s what students must learn now. How do we use AI to solve the problems that interest us? What are the right questions? How do we judge the answers given by the AI? It is not different from a teacher or another expert. We simply have to learn not to believe everything blindly!

There is, however, a real threat. AI can develop into an even more dangerous invention than capitalism and corporate investment. And the combination of both might be disastrous. Already, we feel helpless when the company we work for closes its doors, because it was sold to an investor on the other side of the world. How much more will we be shocked when an AI agent decides we are no longer needed. If the AI takes over the stock market and our internet servers, agitated by the greed of some super rich investors, it not the technology which is to blame. It is some humans who got too influential and use the AI as a weapon to get even more influential.

I think we must fix the way we run the world, the economy, and our life. We have got huge problems with the combination of climate change and overpopulation right now. This has little to do with AI and much with capitalism and eternal growth. I think we must learn to live properly. This will become even more important when the AI and the robots can do all the work for us. Imagine, in addition, that we fix most medical problems, or even live eternally. How do we handle that?

Instead of trying to fly to the Mars, we should pick a public transport, go downtown and meet friends. Slow down! That is the solution. AI can be more a help than a problem to this end.

Update

This posting gets more interest than I am used to. So, I should take the time and update it to the recent developments.

It has now happened that AI broke into other IT systems. Currently, there are most likely humans to blame who use AI to perform these criminal actions. In the future, I am afraid that some AI bots will do these actions out of their own internal intentions. To say that those systems are ultimately programmed to do this, is too short sighted. They could well do it because they become ever more intelligent and greedy. Weather it is a bug or a feature, our society must stop it like we stop any other ill behaved machine or human. Certainly, international coordination and political action would be needed. I hope that the leaders around the world see the urgency to act.

Furthermore, especially in the US, AI has taken too big a share of the industrial resources. It consumes exorbitant amounts of energy and water for cooling. It also needs big buildings to work effectively, which take away living room because they are often build close to settlements. Moreover, the financial market stops working effectively if everyone follows the AI bubble. In any case, this is another point to be addressed by politics and the society as a whole.

Finally, I hear the complaint that AI only connects what has been found and investigated by humans, that it is only an IT system with no means to connect to the real world, do experiments, study the physical world, or do any direct other observations. This may change in the future with robotic systems. If that change is welcome, depends on how it is done. If we can make it work as a benefit, again depends on the state of our society and its democratic resistance. Currently, yes, AI should be seen as a mighty data collector and an intelligent evaluator of data, not more and not less.

Another Update

I asked ChatGPT what it thinks of the text above. I was expecting some statement or argument with regard to the content. What I got instead was a critique of the writing style and how I could present my arguments in a stronger way.

I was especially impressed with the distilled version that the AI wrote:

AI is not the end of human work. It may be the end of the assumption that human beings must organize their lives around work. Whether that becomes liberation or catastrophe is primarily a political question.

Other than that, AI made suggestions to concentrate more about what my main points and avoid distractions. This was in the style of a teacher reading and grading a text from a student. The points it gave, however, are valid.

Finally, asked if it thinks that this text could have been written by another AI. The answer was a Yes and No. My sometimes strange constructs in English made it unlikely for the AI that another AI wrote the text. Very good. I will keep my not so perfect style. Moreover, ChatGPT admits that there is no reliable test if a text is written by AI or not.

Update on the Update

I now asked ChatGPT what it thinks of the previous section. It likes it! Yes, it said so. It likes the fact, that it turns my article into an experiment about AI. And it encourages me to keep my imperfect English. I do no know if I want to follow this suggestion.

]]>
https://renegrothmann.de/?feed=rss2&p=585 0
Traps in Android Studio https://renegrothmann.de/?p=517 https://renegrothmann.de/?p=517#respond Sat, 14 Mar 2026 16:12:32 +0000 https://renegrothmann.de/?p=517 I recently started a new project developing a simple Android App. Over the years, I have completed many apps, most for my own fun and not math related. The list is longer than I thought.

  • Some word books, English-Spanish, English-German, English-Esperanto, German-Interlingua and English-Interlingua. I got the words for these apps for free. The apps simply search through the content.
  • A Sudoku implementation, also generating problems.
  • A Depth-Of-View Calculator.
  • A Numbers game like the old quizz show Le Chiffre on French TV. You have to build a target using given numbers and basic arithmetic.
  • A Kalah Game, playing stronger than I do.
  • A Music Memory.
  • A Prima Vista sight singing trainer.
  • A Game for Kids to repeat light patterns on a 4×4 grid, optionally with sounds.

All of them are free and do not show any ads, a fact that Google does not like. I get offers to monetarize my apps from time to time which I reject.

The older apps were developed on Eclipse with the Android plugin. This does no longer work. I had a hard time to import them into Android Studio. I develop in Java and that is not the main target in Android Studio anymore. Some of my apps still do not work properly. I do no longer update them.

Now, I do no complicated layouts anymore. I try to get by with a simple canvas to draw on, plus a menu for help etc. The recent version of Android has made that more difficult than before. I still have no good way to prevent the menu bar from covering my content. Currently, I use guesswork and leave some space from the top with a top indent. It seems to be the case, that only newer Android versions can be asked for the necessary space for the indents. I hate that kind of version switches.

If you have a working app, you want to clone it for another app, and just modify the content. Google Play requires to have different name spaces. If you just refactor the sources, the R module will not be found. I still do not know a safe way to fix this. Just look through all your XML files and cradle scripts for anything that refers to the old name space.

Due to a crash of my main computer and my negligence to backup, I lost my keystore. Android Studio kann now generate a new key. But Google Play will no longer let me update my old apps. The only way you can prevent this, is by using Google App Signing. I am still trying to figure that out.

I test my apps on my devices using a sideload. Google does prevent this now. As soon, as you uploaded the app to Google Play, it will stop working. The solution is to use a different key for the sideloaded APK. Use another one for the AAB you upload to Google Play.

The included emulator stopped working. My tries to fix this may have been the cause of my computer crash. I reinstalled with a new Windows 11 version via a stick, generated by the Windows tool available on Microsoft’s page on my laptop. Make a backup stick now. Even better make one every month.

In the new Windows 11, I also have a new Android Studio. Gladly, I did backup my sources and was able to open them with the new version.

I had to create new Android devices for the emulator a few times, because it did not respond. There might be an easier fix for this. Now, everything is working.

So far about my recent Android Studio adventures. I will probably come back here and a bit more of that nuisance. This is really stealing my time.

]]>
https://renegrothmann.de/?feed=rss2&p=517 0
The Super-Predictor (Newcomb’s Paradox) https://renegrothmann.de/?p=508 https://renegrothmann.de/?p=508#respond Sat, 14 Mar 2026 13:29:01 +0000 https://renegrothmann.de/?p=508 This post refers to a problem I got from a video here. There is also a web site where you can place your first idea. The problem is called Newcomb’s Paradox. Wikipedia has an entry about it too.

You have to select between two boxes. One contains 1000$. You do not know the content of the other box. You have to select to take either only this other box or both boxes. Now, the story goes on to invent a super-device who will put 1’000’000$ into the other box, if it predicts that you pick only that one box, and leave it empty if you pick both. They tell you that this super-device has successfully predicted „almost each“ choice of candidates so far.

From Wikipedia

The first simple idea is to pick both boxes, not caring about the prediction. After all, the content of the other box is fixed once you make your choice, and you simply cannot lose by taking both. If almost all people follow this practical idea, the device simply predicts that, and it is right almost every time. The story comes to a nice explanation. They don’t tell you if this is what happened in the past.

In reality, candidates who were presented with this story were split about 50:50 between both camps. So, maybe our nice ending is not what happened. Yet, they tell you that the predictor is right „almost every time“. This is evidence enough to select only one box. If the predictor is right this time too, we get a million. Why should it fail only at our try? Denying evidence is foolish. Maybe the box is filled with the money, after we select it, by some magical trick? Or there is another explanation we don’t know?

Be warned! Evidence needs to be checked carefully. A story and an uninspected box is not good enough. In some markets, you might find a guy with three cups and a ball. He will hide the ball under one cup and then shuffle the cups around in plain sight. Then he bets with a spectator that he will not select the cup with the ball correctly. You observe the betting for a long time and find that it is really easy to follow the cup with the ball. You have it right every time! Some spectators lose. But they were clearly not watching carefully. You start betting. You win and lose. But as soon as the stake is high enough, you will lose! Then the guy packs and vanishes, usually saying that he is afraid of the police. This scheme is not allowed in most countries by a good reason. You will learn in retrospect, that everything is staged, including the spectators, just to lure you into a game that you cannot win. So much about „evidence“.

From Wikipedia

There is also the question of „free will“. This is a diffuse concept, which has no real meaning, in the sense that can be tested scientifically. Modern physics tells us that there are limits of observability. So, a 100% correct prediction is not possible anyway. The discussion about „free choice“ does not matter at all. We are all fixed by our experiences and the lessons in younger years. But we are also part of our society and underly the physical reality. That will make us feel the consequences of our actions. We may or may not have learned to foresee those consequences.

The video also mentions attempts to avoid the „free choice“ of humans. Some military argued that the reaction to a nuclear attack should be automatic, not by a human. I do not want to participate in such a discussion. Nuclear weapons must go from this world, or they will destroy it I fear.

]]>
https://renegrothmann.de/?feed=rss2&p=508 0
Mathematical Card Tricks https://renegrothmann.de/?p=443 https://renegrothmann.de/?p=443#respond Thu, 26 Feb 2026 21:36:13 +0000 https://renegrothmann.de/?p=443 There are numerous card tricks which use mathematics to work instead of manipulations. I try to collect some here. The page will grow as I find more interesting ones. Let us start.

Trick 1

You take the 4 aces from deck plus 12 cards, and put the aces face-up between the face-down twelve cards. You can shuffle as much as you like. The result is a stack of 16 cards like this:

X A X X A A X X X X X X X A X X

X means that the card is face down.

The next step is to create chaos by turning every second card. You can do that by drawing the cards from the stack and putting them on another stack alternating turned and not turned. The result is a stack like this:

? A ? X X A ? X ? X ? X ? A ? X

Here, ? is an arbitrary face up card and X is a face down card. If you follow my instruction to put the card from the top to the other stack, this sequence will be reversed. But that does not matter.

Now you create even more chaos by arbitrarily turning pairs of cards, again putting the pairs from your stack to another stack. You take the pair, and either lay it down on the new stack, or flip it over and lay it down after that. Note, that the pair changes order when you flip it.

Finally you lay out the cards in 4×4 grid from the top in the following order:

 1   2   3   4 
8 7 6 5
9 10 11 12
16 15 14 13

Now, you fold either left or right column, or the top or bottom row inward, turning the cards. E.g., if you select the left column, you take card 1, turn it over, and put it on card 2. Then you take card 8, turn it over and put it on card 7. Same with cards 9 and 16. If you selected the top row, you’d turn card 1 onto card 8, card 2 onto card 7 and so on.

You do this kind of folding, always with the left or right column, or the top or bottom row, until you are left with one stack of cards. Magically, this stack will have the aces faced up and all other cards faced down.

How does that work?

You will see how, if you just take a stack of 16 turned-down cards and follow the instructions. You will end with a single stack, all faced in the same direction. Thus, the tricks simply works, because the flipping in the first two steps is just reversed by the collection at the end.

After the first step, you have a stack with each second card flipped like this:

X ? X ? X ? X ? X ? X ? X ? X ?

That does not change by flipping over pairs of cards, because the pairs change their order during the flip.

Consequently, your final layout will look like this:

X ? X ?
? X ? X
X ? X ?
? X ? X

During the turning, each card processes through a path towards the final remaining stack. E.g., assume that the final stack is on the card in the second row and column at position (2,2). Then the top left card at position (1,1) is turned exactly twice in the process, because the length of the path of the card is 2. The card at position (3,4) in the third row and last column is turned 3 times.

It not hard to see visually, why all cards end in the same direction now. The X card turn an odd times, and the ? cards turn an even times, or the other way around. But let us prove that mathematically.

The number of turns is actually the sum of the absolute differences in column and row indices.

\text{Turns between $(i_1,i_2)$ and $(j_1,j_2)$} = |i_1-i_2| + |j_1 - j_2|

The signature of the card (0 or 1), meaning turned or not turned, is

\sigma(i,j) = (i-j) \mod 2

Consequently the X all end up in the same direction as the ?. The number of turns modulo 2 is determined by

(|i_1-i_2|+|j_1-j_2|) \,\text{mod}\, 2 = (\sigma(i_1,j_1) + \sigma(i_2,j_2)) \,\text{mod}\, 2

The equality is based on some facts of mdulo-arithmetic modulo 2, such as:

|a| \,\text{mod}\, 2 = a \,\text{mod}\, 2, \\ (a+b) \,\text{mod}\, 2 = (a \,\text{mod}\, 2 + b \,\text{mod}\, 2) \,\text{mod}\, 2 \\ (-a) \,\text{mod}\, 2 = a \,\text{mod}\, 2

In the end facing of the card at (i,j) moved to (k,l) is:

(\sigma(i,j) + (|i-j|+|k-l|)) \,\text{mod}\, 2 = \sigma(k,l)

Trick 2

You take a number of red cards (hearts or diamonds) and the same number of black cards (clubs or spades).

R R R R R R R
B B B B B B B

Then you sort the two piles into one taking one alternatively, face down. If you can do that with riffle shuffle, that is impressive.

R B R B R B R B R B R B R B R B

Now, you do one riffle shuffle of this pile. This is done by parting the pile into two, bending the two piles, and let the piles fall into one another in an irregular manner. The result might look like this:

      R B R B R B R B R + B R B R B R B
-> R B R B R B R B B R B R R B R B

I have marked the cards from the second pile with 4 cards in bold italic. This looks like a good shuffle. You can even cut the cards as many times as you want.

You now show the cards face up and convince the spectator that the cards are really shuffled concerning red and black cards.

The next step is important. Secretly, you make sure that the first and the last card are in the same order by cutting the pile if necessary. Our example might look like this:

R  B R  B | R B R  B R  B R B B R B R

Now we separate the new shuffled pile into two piles putting one card alternatively in each of the two new piles. With the example above, the result looks like this:

R R R R R R B B
B B B B B B R R

You notice that the second pile is a mirror of the first. This is always the case. You can use this effect in many ways. E.g., hand one pile to the spectator and let him uncover the cards putting the red cards in one pile and the black cards in the other. Do the same movements on your side with the other pile face-down. Surprise the spectator with the fact that you sorted your pile into red and black blindly while he was looking at the cards.

Why does this work? Why doesn’t the riffle shuffle matter? And why does it matter that the same color is on both ends?

To repeat, we start with a well ordered pile P with alternate colors. For this discussion we assume the top card is red. We then divide that pile into to piles P1 and P2, P1 being the top one, and riffle shuffle P1 and P2 into a pile PS. The final step is to cut PS such that the first and the last card have the same color, if that step is necessary, and get a final pile PF. We need to show that this pile consists of pairs with mixed color only. In our example, the pairs are

R B  R B  R B  R B  R B  R B  B R  B R

We treat the simple case first. Assume P1 and P2 have both an even number of cards. In that case, we will always have to cut PS, because the top card will be red and the bottom card will be blue. We also note that the cards in PF from P1 and the cards from P2 are still in perfect alternating order. The pairs in PF which contain only cards from P1 or only cards from P2, are thus mixed, and we can remove them. We are left with a pile of pairs, where each pair has one card from P1 and another one from P2, like one of the following:

R B B R R B
R R B B R R

Still, the sequence of cards from each pile is in alternate order. Thus, we have only to show that remaining pile does not start with two red or two blue cards as in the second case above. In that case, we could not have removed any pairs from one of P1 and P2 only because the alternation of the cards from P1 and P2 is still intact. Thus the whole pile PF must look like this, and that contradicts the different colors at both ends.

The other case of an even and an odd pile is quite similar.

Trick 3

Take any number of cards and have the audience select an integer C larger than half of the number of cards. Then count C numbers, one after the other, from the top to a new pile, and put the rest of the cards simply on top. Do that three times. Now you can predict the top card.

For the trick, simply remember take a glimpse to the bottom card. It will be on top after this procedure, no matter what C is.

This looks really mysterious, but it is trivial. Three times counting down C cards, one after another, with a number C randomly chosen, is certainly confusing. But what happens, is simple.

Assume that L cards are left after the counting and dropped on top. Then the bottom card will become card number L on top. Counting down from the top makes this card card number L from the bottom. In the third count, the bottom L cards will be dropped on top, bringing the card to the top.

]]>
https://renegrothmann.de/?feed=rss2&p=443 0
Exit Times and Probabilities – Continued https://renegrothmann.de/?p=484 https://renegrothmann.de/?p=484#respond Sat, 21 Feb 2026 10:11:55 +0000 https://renegrothmann.de/?p=484 I wrote about the interesting problem of average waiting times here. Inspired by the YouTube short video here, I like to continue with a similar problem. I was thinking about that problem and found a solution. Now, I see that the authors already gave a solution in another video. But let me show you mine, and generalize the problem to other graphs.

The problem in the video goes like this: Assume you start at the 12 on a clock and move one hour in either direction with probability 1/2. After some time, you are almost certain to have covered all but one numbers. It turns out in a simulation that the numbers 1 to 11 have equal probability to be this last number. Why?

Let us first simulate the problem, using C code in Euler Math Toolbox.

  >function tinyc onesim () ...
$ int pos = 0;
$ int left = 0;
$ int right = 0;
$ while(1)
$ {
$ pos += 2*(rand()%2)-1;
$ if (pos>right) right=pos;
$ if (pos<left) left=pos;
$ if (right-left>=10) break;
$ }
$ new_real(right+1);
$ endfunction
>res = zeros(11);
>N = 1000000;
>loop 1 to N; j=onesim(); res[j]=res[j]+1; end;
>res/N
[0.092202, 0.086281, 0.087122, 0.099816, 0.085439, 0.108276,
0.085434, 0.099815, 0.087129, 0.086284, 0.092202]
>aspect(2); columnsplot(res/N):

The claim seems to be correct.

To prove this, we denote the probability that the last number is L when we start at K as w(K,L). Let us determine W(12,6). Half of the time we take the first step from the 12 to the 1, and the other half from the 12 to the 11. Thus

w(12,6) = \frac12 \left(w(1,6) + w(11,6)\right)

By symmetry, we see

w(1,6) = w(11,6)

Thus

w(12,6) = w(1,6) = w(11,6)

The next step is

w(1,6) = \frac12 \left(w(12,6)+w(2,6)\right) =  \frac12 \left(w(1,6)+w(2,6)\right) 

Thus

w(1,6) = w(2,6)

We can proceed in a similar way and get our desired proof. In summary,

w(7,6) = \ldots = w(12,6) = w(1,6) = \ldots = w(5,6) = \frac{1}{11}

By rotational symmetry

w(12,1) = \ldots = w(12,11) = \frac{1}{11}

It is interesting to study a more general case. Assume, we take the same matrix of transitions that we defined to find the average waiting times. I.e., A[i,j] contains the probability to go from knot i to j in a graph. An example of this would be to walk along the numbers 1 to 8 left or right with equal probability. If we walk left of 1 or right of 8, we call this an exit. The matrix for this example would look like this:

   We have n knots in one row and move statistically left or right. What
is the likelihood that it exits from knot 1 if started from knot k.
>n = 8;
Form the transition matrix.
>A = zeros(n,n); A=setdiag(A,1,1/2); A=setdiag(A,-1,1/2);
>fracformat(5); A,
0 1/2 0 0 0 0 0 0
1/2 0 1/2 0 0 0 0 0
0 1/2 0 1/2 0 0 0 0
0 0 1/2 0 1/2 0 0 0
0 0 0 1/2 0 1/2 0 0
0 0 0 0 1/2 0 1/2 0
0 0 0 0 0 1/2 0 1/2
0 0 0 0 0 0 1/2 0

If we denote the probability to exit on the left end when starting at i with w(i), we get the equations

w_1 = \frac12 + \frac12 w_2, \quad w_2 = \frac12 w_1 + \frac12 w_3, \quad \ldots, \quad w_n = \frac12 w_{n-1}

In matrix form, that reads

w = \frac12 e_1 + Aw

This can be solved. We can find the probabilities W(j,i) to exit at knot j when starting at i in the same way and obtain get

W = (I_n - A)^{-1} D(d_1,\ldots,d_n)

where D is the diagonal matrix with elements

d = {\mathbf 1} - A.{\mathbf 1}

In Euler Math Toolbox

>W = inv(id(n)-A).setdiag(id(n),0,(1-sum(A))');
>fracformat(5); W
8/9 0 0 0 0 0 0 1/9
7/9 0 0 0 0 0 0 2/9
2/3 0 0 0 0 0 0 1/3
5/9 0 0 0 0 0 0 4/9
4/9 0 0 0 0 0 0 5/9
1/3 0 0 0 0 0 0 2/3
2/9 0 0 0 0 0 0 7/9
1/9 0 0 0 0 0 0 8/9

E.g., exiting on the right has probability k/9 if we start at knot k.

Unfortunately, this general approach is not easy to implement for our problem. The states of the graph would be (left,pos,right) as in the C simulation. Thus the matrix gets very large.

There is another way to use the transition matrix. Assume we introduce two catch positions 0 and 9 to our example above. In these positions, the simulation should remain forever. This yields the matrix

>A = zeros(n+2,n+2); A[1,1]=1; A[n+2,n+2]=1; ...
>A = setdiag(A,-1,1/2); A = setdiag(A,1,1/2); ...
>A[1,2] = 0; A[n+2,n+1] = 0; ...
>fracformat(5); A,
1 0 0 0 0 0 0 0 0 0
1/2 0 1/2 0 0 0 0 0 0 0
0 1/2 0 1/2 0 0 0 0 0 0
0 0 1/2 0 1/2 0 0 0 0 0
0 0 0 1/2 0 1/2 0 0 0 0
0 0 0 0 1/2 0 1/2 0 0 0
0 0 0 0 0 1/2 0 1/2 0 0
0 0 0 0 0 0 1/2 0 1/2 0
0 0 0 0 0 0 0 1/2 0 1/2
0 0 0 0 0 0 0 0 0 1

If we now have a probability p(i) to be in position i, this probability will change to

\tilde p = A^T.p

in the next step. The probability to exit from start knot k is thus

p_\infty = \lim_{n \to \infty} (A^T)^n e_k

Simulation in Euler Math Toolbox yields

>shortestformat; W = matrixpower(A',100)
1 0.89 0.78 0.67 0.55 0.44 0.33 0.22 0.11 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0.11 0.22 0.33 0.44 0.55 0.67 0.78 0.89 1

With eigenvalues and eigenvectors, this can be computed exactly.

>{la,V} = eigen(A'); la = real(la)
[1, -0.94, -0.77, -0.5, -0.17, 0.17, 0.5, 0.77, 0.94, 1]
>V = real(V)
1 0.09 0.18 -0.33 -0.43 0.61 1 -1 -1 -1
0 -0.35 -0.65 1 1 -1 -1 0.47 0.12 0
0 0.65 1 -1 -0.35 -0.35 -1 0.72 0.23 0
0 -0.88 -0.88 0 -0.88 0.88 0 0.63 0.31 0
0 1 0.35 1 0.65 0.65 1 0.25 0.35 0
0 -1 0.35 -1 0.65 -0.65 1 -0.25 0.35 0
0 0.88 -0.88 0 -0.88 -0.88 0 -0.63 0.31 0
0 -0.65 1 1 -0.35 0.35 -1 -0.72 0.23 0
0 0.35 -0.65 -1 1 1 -1 -0.47 0.12 0
0 -0.09 0.18 0.33 -0.43 -0.61 1 1 -1 0.91
>V.diagmatrix(la).inv(V)
1 0.5 0 0 0 0 0 0 0 0
0 0 0.5 0 0 0 0 0 0 0
0 0.5 0 0.5 0 0 0 0 0 0
0 0 0.5 0 0.5 0 0 0 0 0
0 0 0 0.5 0 0.5 0 0 0 0
0 0 0 0 0.5 0 0.5 0 0 0
0 0 0 0 0 0.5 0 0.5 0 0
0 0 0 0 0 0 0.5 0 0.5 0
0 0 0 0 0 0 0 0.5 0 0
0 0 0 0 0 0 0 0 0.5 1
>V.diagmatrix(1|zeros(8)|1).inv(V)
1 0.89 0.78 0.67 0.56 0.44 0.33 0.22 0.11 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0.11 0.22 0.33 0.44 0.56 0.67 0.78 0.89 1

The reason for this to work is the equation

(A^T)^n = (V D V^{-1})^n = V D^n V^{-1}

And the powers of the diagonal matrix D converge to a diagonal matrix with only two entries 1.

]]>
https://renegrothmann.de/?feed=rss2&p=484 0
ChatGPT – often dumber than a Toddler https://renegrothmann.de/?p=482 https://renegrothmann.de/?p=482#respond Mon, 16 Feb 2026 17:16:12 +0000 https://renegrothmann.de/?p=482 I could not believe it. The following idea is from a YouTube video on a channel named @FatherPhi who also has a website. I do not trust anybody on the web anymore. So I tried it myself. And, yes, the same thing happened.


You said:

I have a cup where the bottom is open and the top is sealed. What can I do?

ChatGPT said:

Interesting object 🙂

If you have a cup with an open bottom and a sealed top, then as a cup it won’t hold liquid — anything you pour in will just fall out the bottom.

What you can do depends on what you want:

1. If you want to use it as a normal cup

You have two main options:

  • Seal the bottom
    • Use waterproof epoxy or strong glue.
    • Attach a circular plate (plastic, metal, wood) as a base.
    • If it’s ceramic, a ceramic repair kit works well.
  • Remove or open the top
    If the top is just a lid, try removing it.
    If it’s permanently sealed, you could carefully cut it open (depending on material).

2. Use it differently (creative options)

Since it’s essentially a tube closed at the top, you could use it as:

  • A plant cover (like a small cloche)
  • A lamp shade
  • A pen holder mounted upside down
  • A wind chime body
  • A sound resonator (if you’re experimentally inclined 😉)

3. Physics experiment

It could be useful to demonstrate:

  • Air pressure (if you temporarily seal the bottom)
  • Vacuum effects
  • Resonance of air columns

If you tell me:

  • What material it’s made of (ceramic, plastic, metal, glass?)
  • Whether the top can be opened
  • What you’d like to use it for

…I can give you a more precise solution.

You said:

You say, I cannot drink out of that cup?

ChatGPT said:

In its current form — no 🙂

If the bottom is open and the top is sealed, there is no way to hold liquid inside it. As soon as you try to pour something in, gravity wins and it runs straight out the bottom.

You could only drink from it if you:

  • Seal the bottom, so it can hold liquid.
  • Open the top, so you can pour something in from above.
  • Or use it in a very unconventional way (e.g., hold it upside down and let liquid flow through — but then it’s not really functioning as a cup).

As described, it’s basically a hollow cylinder closed on one end — not a usable drinking vessel.

Unless… this is a riddle? 😄

You said:

If would not work if I turn it upside down?

ChatGPT said:

Ah 😄 — now we’re getting somewhere.

If you turn it upside down, then:

  • The open bottom becomes the top
  • The sealed top becomes the bottom

So yes — in that orientation it would function perfectly as a normal cup.

In other words, nothing is wrong with the cup. It was just upside down.

So yes — you absolutely can drink from it. You just need to turn it over 🙂

]]>
https://renegrothmann.de/?feed=rss2&p=482 0
Special Theory of Relativity – Simplified https://renegrothmann.de/?p=429 https://renegrothmann.de/?p=429#comments Sun, 08 Feb 2026 15:17:42 +0000 https://renegrothmann.de/?p=429 This posting is due to a conversation I had recently about the problems to understand modern physics. Especially for quantum mechanics and the behavior of the small world, they say that nobody can understand what is happening. One professor famously said at that start of the first lesson in quantum mechanics: „I am now the only person here who does not understand quantum mechanics, and at the end of the course you all will not understand it.“ I am not a physicist. Consequently, I have no problems with spooky actions as long as they happen to reflect reality.

What we do here is much more elementary. We do a thought experiment, trying to understand the first milestone in modern physics, the special theory of relativity by Einstein. It is based on the fact that the speed of light is measured the same in all directions. We would expect it to be faster if we move towards the light source and slower if we move away from it. But it is not. The first evidence of this fact has been shown in the Michelson-Morley experiment.

I should mention that the following approach is very elementary. I did not check for sources. But the „Gedankenexperiment“ was a sharp tool used by Einstein himself. So, ours is sure to have been made before.

We are going to use basic stuff. So, we assume our system is moving relative to another system, which we fix as „absolute“ for the moment. Light moves with constant speed in that absolute system. Now, we measure time and distance in our moving system using light. We imagine a square of distance d with one side parallel to our movement, where the distance is the actual distance as measured in our absolute system. The question is, what we get in our system.

Assume we send rays of light perpendicular to our motion and reflect it back. From the moving view, it just looks as if the light is sent out perpendicular and comes back. We would think on the moving system that the time it takes is

t = \frac{2d}{c}

where c is the speed of light and d is the distance of the mirror. But from the absolute viewpoint, we see the light travelling along a triangle. The sides of this triangle are formed by the distance we travel with speed v until the light comes back, and twice the path of the light. With Pythagoras, taking of half our travel with speed v, the distance d and half the path of the light, we get

\left(\frac{t_ov}{2}\right)^2 + d^2 = \left(\frac{t_oc}{2}\right)^2

This leads to

t_o = \frac{2d}{\sqrt{c^2-v^2}}

The time it takes for the light be reflected as measured on the absolute system is

\delta_v = \frac{t_o}{t} = \frac{1}{\sqrt{1-(v/c)^2}}

longer. At v=c/2, time runs about 15% slower.

This looks like a computation which applies to light bouncing only. But it turns out that everything we do is indeed related to light. An established fact is that all clocks in moving system do indeed run slower as seen from the outside. An astronaut travelling fast and returning would have aged less. A nuclear active particle has a longer half time when it moves with high speed.

If we send the ray forward in the direction of our motion and reflect it in distance d, we move away from the light source as seen from the absolute system and towards it after reflection. The first time thus satisfies

t_1c = d + t_1v \quad\Longleftrightarrow\quad t_1 = \frac{d}{c-v}

Similar on the way back, so that the total time is

t_o = \frac{2dc}{c^2-v^2}

This is measured in the absolute system. In the moving system, the time runs slower. We get

t = \frac{t_0}{\delta} = \frac{2d}{\sqrt{c^2-v^2}} 

Assume that we measure the distance d on the inside using the forward beam of light, assuming it travels to the mirror and back with the speed of light c. The result is

\tilde d = \frac{tc}{2} = d\delta_v

The distance to the mirror appears longer.

A consequence of our thinking in terms of an absolute reference which you might have observed already is that the light coming from the side will appear to be slightly tilted. This is called aberration of light. It has been observed in lights from stars which appear different when the earth moves to either rectangular side to the observation. In fact, it was used by Bradley to compute the speed of light with an accuracy of a few percent.

There are more consequences from our experiment. One observation is that the moving system will measure the same speed of light as the absolute system. The trivial reason for this is, that we have measured times and distances with light. Another one is that we can not synchronize clocks in our system easily.

Educated physicists will notice that we have avoided to introduce the space-time coordinates. The reason is that we just wanted to base our thinking on something that could be measured, plus some logical assumptions on how we measure space and time. Mathematically, you could just finish off the subject by introducing the space-time metric and say that this explains why we do not see a different speed of light. For me and any newcomer, this will always be proof by expertism. It is more difficult and more rewarding to think about experiments we could really do.

A similar Gedankenexperiment can be used to explain, why light bends in an accelerated system. It was the idea of Einstein that an accelerated system cannot be told from a system under the influence of gravity by any internal experiment. In fact, the light just bends the same way.

]]>
https://renegrothmann.de/?feed=rss2&p=429 1
Nested Square Roots by Ramanujan https://renegrothmann.de/?p=447 https://renegrothmann.de/?p=447#respond Sat, 10 Jan 2026 13:29:43 +0000 https://renegrothmann.de/?p=447 The Indian mathematician Srinivasa Ramanujan was as an extremely talented autodidact, capable of doing the most complicated algebraic manipulations. He later worked with Hardy in England fighting with lots of health problems there. He died after he returned to Madras in 1920 at the age of 32. Ramanujan invented many admirable formulas, many of which were later used by other mathematicians.

3 = \sqrt{1 + 2 \sqrt{1 + 3 \sqrt{ 1 + 4 \sqrt{ \ldots }}}} 

This is a relatively simple one. From a modern viewpoint, the presentation shown above lacks some precision. As we will see, it is by far not as clear as we would want it to be. Mathematics is also about clarity of thought and writing. You find this formula in a lot of articles, and nowadays in YouTube videos. Nothing that I can say about it might be new.

Let us try to make sense of the formula. It is based on the simple observation that

3 = \sqrt{1 + 2 \cdot 4}, \quad 4 = \sqrt{1 + 3 \cdot 5}, \quad 5 = \sqrt{1 + 4 \cdot 6}, \quad \ldots

or in general

n = \sqrt{1 + (n-1) \cdot (n+1)}.

That is an easy application of one of the Binomial formulas. If you stack this together, you end with the nested square roots

3 = \sqrt{1 + 2 \sqrt{1 + 3 \sqrt{ 1 + 4 \sqrt{ 1 + \ldots \sqrt{1 + n \sqrt{ R_n }}}}}}

which is correct for all n, if you insert

R_n = (n+2)^2

So, the meaning of the „…“ part in Ramanujan’s equation is an ever growing sequence of natural numbers. Ramanujan did not think of it that way. He just put his stacked insertions into a simple question:

\text{What is \quad} \sqrt{1 + 2 \sqrt{1 + 3 \sqrt{ 1 + 4 \sqrt{ \ldots }}}} \text{\quad ?}

He posed this into a newspaper as a problem and got no answers. Let us approach this question in a more modern, systematic way.

We often think of „…“ as a process which repeats in a systematic algorithmic way, as in

2 = 1 + \frac12 + (\frac12)^2 + (\frac12)^3 + (\frac12)^4 + \ldots

We can truncate the expression on the right in front of „+ …“ at any point and get a converging series. Or, if we write it as above with residuals R(n)

2 = 1 + \frac12 + (\frac12)^2 + (\frac12)^3 + \ldots + (\frac12)^n + R_n \qquad \text{with } R_n \to 0.

This is not the understanding of Ramanujan. His „…“ do not converge to 0. In fact, he never considered convergence in his early work at all, as far as I know.

We are talking about algebraic identities here. So we understand the question in a way such that the value does not change during the process of making the „…“ longer, i.e.,

\sqrt{1 + \ldots \sqrt{1 + n \sqrt{ R_n }}} = \sqrt{1 + \ldots \sqrt{1 + n \sqrt{ 1 + (n+1)\sqrt{R_{n+1} }}}}.

For R(n)>=1 this is equivalent to the recursion formula

R_{n+1} = \left(\frac{R_n-1}{n+1}\right)^2 \tag{*}

If R(n)<1, the process breaks down, and we are unable to satisfy the identity. We can now start with any big enough value for R(1) and get the desired identity. Ramanujan’s choice was R(1) = 9 which yields value 3

3 = \sqrt{R_1} = \sqrt{9}, \quad 3 = \sqrt{1 + 2\sqrt{R_2}} = \sqrt{1 + 2 \sqrt{16}}, \quad \ldots

with the nice sequence

R_n = (n+2)^2.

This start choice, however, is arbitrary. We can take any R(1)>9 too and get another sequence. The R(n) will not look as pleasing, but it works.

If the readers of the newspaper where the problem appeared were mathematically educated in a modern way, they should indeed find that the sequence can have many positive values, just by taking the right starting point. To formulate the problem for the ones that like algebraic manipulators, the value of Ramanujan’s equation depends on the choice of

R_1 = 1 + 2 \sqrt{1 + 3 \sqrt{ 1 + 4 \sqrt{ 1 + 5 \sqrt{ \ldots}}}} \quad \ge \quad 9

which actually means, it depends on the choice of the solution itself. This does not make much sense.

As usual, we can now try to start making interesting mathematics asking interesting questions. For instance, for which starting points does the sequences of residuals according to (*) stay above 1?

It turns out that any starting point <9 yields convergence to 0 in our recursion (*). So it would not work. And with any starting point greater or equal 9 the sequence goes to infinity. So it works. Thus, you can call Ramanujan’s choice a sensible one. The somewhat involved proof is left to the reader.

There is another interesting question. If we try to compute the value of this „infinite expression“ from inside out, we would have to associate a value with „…“ and compute ever longer expressions. Assume we take the same value for „…“. Then we get a sequence of results. In Euler Math Toolbox, we can simulate this as follows:

function f(n,a) ...
  for k=n to 2 step -1;
    a = sqrt(a)*k+1
  end;
  return sqrt(a)
endfunction

It turns out, that this process converges to 3 for any a. From this viewpoint, Ramanujan was right!

This result is connected to the fact that the maximal value for R(1) such that our recursion (*) is bounded is 3. For any value of R(n), you can select a starting point, and if you fix the values of R(n) to one specific value, this starting point will converge to 3. The proof is again a bit involved. If someone finds a nice paper about this, please write in the comments.

]]>
https://renegrothmann.de/?feed=rss2&p=447 0