Previous Up Next

Diary, December 2021

Sun Mon Tue Wed Thu Fri Sat
              1  2   3   4
  5   6   7   8   9  10  11
 12  13  14  15  16  17  18
 19  20  21  22  23  24  25
 26  27  28  29  30  31

Wednesday, December 1, 2021

Advent of Code

With 18 of my colleagues, I joined this years Advent of Code. My programs will be committed to my AdventOfCode2021 repository on GitHub. It took me about an hour to finish todays puzzles.

I have been thinking about how to formulate the puzzle in a manner that does not state anything about how to execute it. On reddit a solution has been published in the programming APL that is probably the shortest possible in any programming language, and which reads: +/¯1↓x<1⊖x (ten Unicode characters requiring fifteen bytes in UTF-8). Although it is very short, it is an executable algorithm. One way to represent the puzzle is with this expression:

f(A : List of Integer) = count { i | A[i] < A[i+1] }
This is a definition of a function, which takes a list of integers and counts the number of succesive pairs where the latter element is larger. The first question is whether it is possible to define semantics such that this can be interpretted in only one way. One possible problem could be how the variable i is dealt with. Maybe in this function it is not a problem, but if it is part of a more complex expression, it could ambigious. This also assumes that we already have read the list of integers from some input. The input for the puzzle is given as a file and it is assumed that the integers are represented as decimal numbers using Arabic numerals in the ASCII encoding. From the input we may also conclude that the integers are small and can be represented as 32-bit integers. Functions or methods to parse numbers in this type of representation are present in most programming languages. Although the expression suggest that the list of integers is passed as a whole to the function, an actual executable implementation does not need to do this, because it could also be implemented using an iterator that reads the input number by number and an implementation of the function that processes the numbers on by one. That is actually how I solved this in my C++ program.

Thursday, December 2, 2021

Palindrome date

Today is a palindrome date when written like 12/02/2021 (MM/DD/YYYY) or 2021.12.02 (YYYY.MM.DD). The previous such date was February 2, 2020 and the next will be March 2, 2030.

Extra puzzle of the first day

I solved the extra puzzle of the first day of Advent of Code with a program that calculates a running sum, but after I had formalized it like the first puzzle, into:
f(A : List of Integer) = count { i | A[i] + A[i+1] + A[i+2] < A[i+1] + A[i+2] + A[i+3] }
I realized, it could be simplified into:
f(A : List of Integer) = count { i | A[i] < A[i+3] }
Which eliminates the need to calculate any sum at all, let alone perform some addition and/or substraction.

Rijksmuseum Twenthe

In the afternoon, Conny and I visited Rijksmuseum Twenthe. There we saw a number of exhibitions. First of all the exhibition Artemisia: Vrouw & Macht, which is about Artemisia Gentileschi. ("Vrouw & Macht" is Dutch for "Women & Power".) We saw the following paitings:

Next we saw the exhibition Deep Truth, which I already visited on Sunday, September 12. We looked at the following works:

During this, we also walked through the normal collection and saw Falaises près de Pourville by Claude Monet. Finally, we saw the two exhibitions part of Fotomanifestatie Enschede:

At 15:47, I bought the following three books in the museum shop:

Back at the car we noticed condensation on the inside of the car windows and some snow on the car. We concluded that the snow fell during our stay in the musuem. We saw a row of dark clouds on the horizon while driving home.

Saturday, December 4, 2021

Advent of Code

This morning, I got up early to solve todays puzzles of Advent of Code. I found these easier than yesterday. Some of my colleagues have been using Excel for solving the puzzles of the past days. Last night, I wrote an additional solution to yesterdays second puzzle. Then I also realized that it would be rather easy to solve it, if you would sort the input data first. You can do this with an external utility or even in Excel, if I am not misstaken. Todays, puzzle is about playing bingo, where you win when you have filled one row of column. Is it possible to create a set of bingo cards, such that no matter in which order you draw the numbers, there is always but one card that wins at when the next number is drawn? It would require that no two cards have a row or a column with exactly the same numbers in it. For each card there are 2.5!.5! ways to arrange the rows and the columns, such that the card will always win at the same moment. What is the largest set of such a set of cards if numbers are taken from a certain range? Of course, this depends on the number of balls you have available.

With respect to Advent of Code, I found the following links:

Tuesday, December 7, 2021

Aerosolised droplets

Today, the RIVM included in their statement of how COVID-19 spread, the following sentense: "Under certain conditions, the virus can travel farther, carried in aerosolised droplets that are tiny enough to float in the air, and infect people at greater distances." The sentense basically affirms that COVID-19 is an airborn virus.

Friday, December 10, 2021


At 10:19:08, I bought the book Twaalf Twentse tochten written by Truus Wijnen in Dutch and published by Gegarandeerd Onregelmatig in 2014, ISBN:9789078641339, from charity shop Het Goed for € 1.50.

Saturday, December 11, 2021

Palindrome date and double date

Today is a palindrome date when the date is written in the format MM/DD/YY: 12/11/21, and a double date for that format. It is also a double date when written in the format YY.MM.DD: 21.12.11.

Matching brackets

Day 10 of Advent of Code 2021 is about brackets. There are four types of brackets (using ()[]{}<>) and the puzzles have to do with checking if they are matching. This can fail because there are some brackets missing at the end or because there is a mismatch. I decided to use a stack for my implementation of puzzles instead of using a recursive function. I felt that it was the right decision for finishing the puzzles. When I was done, I started thinking about repairing a mismatched sequence of brackets and what would be the minimum number of brackets to insert. It took me some time to come up with an algorithm. It is implemented in the program day10_s.cpp. What it first does is replacing all matched brackets (inside-out) with underscore characters. Next it uses a recursive function to try all possible matchings. For the input given, this runs fast enough, but the complexity is (at least) cubic to the length of the input. Memoization (using a sqaure amouth of memory to the length of the input) can be used to reduce it to at most cubic. I made some searches and made some inquiries (on Twitter, Hacker News, dan Reddit) but did not get any further. I suppose that some research on this must have been done in the past. I suspect that the two type brackets problem is easier than the three or more types of brackets problem.

Sunday, December 12, 2021

Hexagonal mazes

Last week, I was going through some old paper, and I found to sheets with hexagonal mazes. Today, I found them (at least one of them) on the website of Olin Shivers. I visited his website before on January 29, 1997, when he was still working at MIT. The mazes can be found on the page Maze generation. He mentions that Robert Givan finished the largest maze by hand. There are good reasons to believe that this is Bob Givan working at Purdue University.

Saturday, December 18, 2021


This evening, our government announced that there will be another lockdown starting early tomorrow morning till at least January 14. Although the number of people testing positive on Covid-19 has dropped in the past two weeks by more than a quarter and even the number of people in the hospital has dropped (the number of people in IC only slightly), there is great fear that the Omicron variant will cause those number to increase quickly. Today, I saw the data that from November 29 to and including December 5, about 0.2% of the examined samples were the omicron variant. During that period about 152349 people tested positive, which means that during that period about 300 people were already infected with the omicron variant. Yesterday, it was reported that in the capital city, Amsterdam, about 25% of the examend samples where of the Omicron variant.

Sunday, December 19, 2021

Snailfish numbers

Day 18 of this years Advent of Code is about Snailfish numbers. I decided to use a tree representation for my solution, but while I was doing this, I several times complementated to use a flat representation when I was struggling to implement an iterator that walks over the leaves of the tree. It took me 2:20:41 to finish the first puzzle and another ten minutes to solve the second puzzle. Yesterday afternoon, I tried to implement the algorithm using an array to store the numbers together with their depth. But it took me even more time. Then I thought a bit more about it. I realized that the explosions could be done in one pass. I also realized that a split at depth four, leads to a single explosion, which combined lead to a 'distrution' of the value to surrounding values, and which can be done in a single step. I also realized that with some clever moving around this can also be done in a single pass. Today, I worked on a third solution using a double linked list. Because the depth of the numbers is limited to at most four it is a limited depth binary tree, which can be represented by 31 cells. If you decided to use -1 for the representation of a pair, it is possible to use an array of 31 integers. (I used an array of size 32 out of convenience.) The idea is to asume that you have a tree with fullest depth and then you number the nodes, from left to right, starting with 1. During the addition, you temporary need an tree with five levels and thus 63 cells. This evening, I finished the fourth solution with this. I tested the solutions on the example input given at the end of the description for the first puzzle. The code can be found in the program 2021day18.cpp. With the command line option -t, the program gives some detailed output.

Wednesday, December 22, 2021

Palindrome date and double date

Today is a palindrome date when the date is written in the format MM/DD/YY: 12/22/21, and a double date when written in the format DD-MM-YY: 22-12-21.

Saturday, December 25, 2021

Advent of Code 2021

This evening, I finished all the puzzles of Advent of Code 2021. My programs can be found in this github repository:. I was the 5774th person to finish all the puzzles. Up to and including Thursday, I woke up early every day to compete in the contest against my colleagues. About thirthy of them started out and were about five others still running in the competition. However, on Thurday, I realized that I was taking it far too seriously and I decided to quit the competition with my colleagues, removing myself from the private leaderboard. In the evening, I managed to finish the puzzles of Thursday. Yesterday, I spend at least half of my hours being awake and a some hours into the night to work on yesterdays puzzle without being able to finish the puzzle. Today around noon, I had a quick look at todays puzzle, which did not look so hard. But it was only around nine in the evening that I continued working on the puzzles and managed to finish yesterdays puzzle and todays puzzle (only one). This years winner is Brian Chen with the alias betaveros. On second place is Andrew He.

Thursday, December 30, 2021

14.1° Celsius

Today, Conny and I went for a walk from our home. We did not know whether it would started to rain, so we did not plan to make a long walk at first. But while walking, we decided to go further, because it did not look like it was going to rain and the weather felt warm. At some point, we realized we had dressed ourselves too warm. At home I discovered that during out walk, the temperature at Twenthe Airport had gone up to 14.1° Celsius, which breaks the previous record of 13.0° for the temperature on this date in 1925. This is probably going to be our last walk for this year. Although there is a ban on fireworks this year, we still expect that a lot of illegal fireworks will be ignited tomorrow during the day and the night.

Friday, December 31, 2021

Brewing the Sublime

I finished reading the book Brewing the Sublime by Philip Vermeulen which I started reading two days ago, and which I bought earlier this month on the second. It is a small book with a lot of interesting notes with links. There is not an online version with the links. I started my own list:
  1. Sane man by Bill Hicks
  2. Beyond the Finite: The Sublime in Art and Science by Roald Hoffmann and Iain Boyd Whyte
  3. Wanderer above the Sea of Fog by Caspar David Friedrich
  4. Untitled (Black on Grey) by Mark Rothko
  5. Mark Rothko by Jacob Baal-Teshuva. Taschen, 2003
  6. How does our sense of taste work?
  7. "Sense." Wikipedia
  8. Definition of Visceral
  9. Grote Woorden, VPRO
  10. Toelichting op "Over het sublieme" by G.J.E. Rutten
  11. Dionysius Longinus on the Sublime: Translated from the Greek, with Notes and Observations, and Some Account of the Life, Writings and Character of the Author., page 37
  12. Earliest tea as evidence for one branch of the Silk Road across the Tibetan Plateau
  13. Aulos, Wikipedia
  14. See 12, page 22
  15. A Child of Hitler: Germany in the Days when God Wore a Swastika by Alfons Heck, Renaissance House, 1985.
  16. On the Absolute, the Sublime, and Ecstatic Truth by Werner Herzog
  17. Encounters at the End of the World
  18. Herzog shoots (part one)
  19. The Sublime: Documents in Contemporary Art by Simon Morley. MIT Press, 2010.
  20. Evoluton of the Thermometer, 1592-1743 by Henry Carrington Bolton
  21. History of the cotton manufacture in Great Britain by Sir Edward Baines.
  22. Dictionary of the History of Ideas. Studies of Selected Pivotal Ideas by Philip P. Wiener
  23. A Philosophical Enquiry into the Origin of Our Ideas of the Sublime and Beautiful by Edmund Burke
  24. Stockhausen über 11 September
  25. Stockhausen, Karlheinz by Terry Castle, August 27, 2011.
  26. Review of The Disintegration Loops by William Basinski.
  27. Vincent W.J. van Gerven Oei
  28. See 24
  29. An Encyclopaedia of the History of Technology by Ian McNeil
  30. Richard Trevithick's steam locomotive
  31. Roemruchte daden en opvattingen van doctor Faustroll, patafysicus: neowetenschappelijke roman, Dutch translation of Gestes et opinions du docteur Faustroll pataphysicien : Roman néo-scientifique suivi de Spéculations by Alfred Jarry
  32. Sweet Anticipation: Music and the Psychology of Expectation by David Brian Huron
  33. Powers of Ten: video.
  34. Swimming with Sharks: My Journey Into the World of Bankers by Joris Luyendijk
  35. See 36
  36. Microwave Oven
  37. Electrifying America: Social Meanings of a New Technology, 1880-1940 by David E. Nye
  38. American Technological Sublime by David E. Nye
  39. See 40
  40. See 40
  41. See 24
  42. Review: 'Rain Room,' technology's hot-ticket riff on Mother Nature by Christopher Knight about Rain Room, 2012
  43. About the installation: understanding the project
  44. First look inside LACMA's Rain Room: an indoor storm where you won't get wet...honest by Deborah Vankin
  45. Hitler, 1889-1936: Hubris by Ian Kershaw & Linz, Wikipedia.
  46. Elanor Larsen, Between Math and Mustery in FNews Magazine, February 2014, page 31.
  47. Modell 5: Kurt Hentschläger & Ulf Langheinrich
  48. 'FEED': Misselijkmakend en Misdadig by Annet de Jong, in Kurt Hentschläger: Press Review & Essays ZEE and FEED, page 67
  49. Brian Eno Covers the Velvet Underground's "I'm Set Free": Listen
  50. Sapiens: A Brief History of Humankind by Yuval Noah Harari
  51. Meer licht - Museum de Fundatie
  52. THEE PSYCHICK BIBLE: Thee Apocryphal Scriptures ov Genesis Breyer P-Orridge and Thee Third Mind ov Thee Temple ov Psychick Youth by Genesis P-Orridge

13.8° Celsius

The temperature at Twenthe Airport has gone up to 13.8° Celsius, which breaks the previous record of 13.7° on this date in 2017. But what is more remarkable is that that temperature was reached two times during last night. The temperature did not drop below 12.5° Celsius.

This months interesting links

Home | November 2021 | January 2022