Rambunctious Recitation is number game that follows the rules of the
Van Eck sequence. Here’s a great video from the Numberphile channel on
YouTube about it. And here start our troubles because it seems no one
has yet found an efficient algorithm for generating this sequence. We
will really need to brute force it.
How can we resolve this predicament with the tools available to us?
The troubles are far from over, this time it’s the docking program on
the ferry that’s not compatible with the port computer system. We need
to emulate the port’s software by using a bitmasking system to figure
out the correct instructions. Let’s see if we are able to implement
this logic with Power BI.
As usual there’s a file with a set of instructions. Some lines refer
to memory addresses and others to bitmasks. We need to apply the mask
to the values stored in the memory addresses beneath it until we reach
the next mask repeating the process to the end of the file.
We arrived to the island after the ferry trip and we see ourselves in
need of transportation to the nearest airport. Fortunately there’s a
shuttle bus service between the sea port and the airport that could
take us there.
Day 13 is a wonderful mathematical puzzle, following the theme of
modular arithmetic of the previous one. Let’s dive into it as there
some surprises with the numeric limits on Power BI.
After the waiting room we are at a ferry navigating to the island.
There seems to be a problem with the navigation system, and we
volunteered to help. We have a set of instructions and we need to make
some sense of them to help the captain circumvent the storm.
The solution to the problem will be given by calculating the Manhattan
distance (sum of the absolute values of its east/west position and its
north/south position).
Today’s puzzle title is “Seating System” but it’s actually a variation
of a well known zero-player game called Conway’s Game of Life. Many of
us may recall this game as a popular choice for work assignments in
computer science courses.
Dr. John Conway, the English mathematician who created this game was
last year a victim of COVID-19. If you want to know a little more
about him you can read this article that was featured this week on
Hacker News.
Day 10 puzzle brings us an array of adapters. In the first part we
will need to find the number of differences of 1 and 3 jolts. Part two
asks us to find the total number of distinct ways in which we can arranje
the adapters to connect the device to the charging outlet.
We have a list of numbers of each the first 25 are a preamble. After
this, any number can be calculated as a sum of any pair of numbers in
that interval.
In day 8 we find a some weird infinite loop on a handheld device. To
fix this problem we are asked to create a program that goes trough a
stack of instructions.
Day 7: Handy Haversacks is the hardest puzzle to solve using only
Power BI until now. It took me a lot of time to find a viable and fast
solution.
I have first tried to solve this using DAXPATH but had issues
with the different levels of recursion. It was possible in the real
data input for the same bag to be child of different bags in different
levels. Only after a deep dive on using the List.Generate a light
began to appear on the end of the tunnel.
Time to check for some custom declarations forms. In the first part
we will check the distinct number of questions anyone on each group
answered “yes”, and on the second part the questions where everyone
gave a positive response.
The input for this problem is very similar to the passports we have seen on day 4.
We have several lines that represent the answers of the persons in a group and the groups
are separated by a blank line.
Following this strategy we load the data to our file and we find our
first challenge. “Each passport is represented as a sequence of
key:value pairs separated by spaces or newlines. Passports are
separated by blank lines.”
The interesting part begins after line 3, where we are going to need
to get positions that are over the length of the row. The value that
we wish for row 4 is 1, which is the value of the remainder of
dividing 12 by the lenth of the track which is 11. Adding a new column
with the remainder we can crosscheck with our data and everything
seems to work:
In part one we need to check if a given character occurs between a
certain lower and upper bound.
This kind of operation seems to be more suited to be done in Power
Query as we are going row by row checking for the validity of the
rule. My idea here is to create a column with value of 1 if the
password is valid and 0 otherwise.
This will be the first post of a series where I hope to be able to
solve the problems from the Advent of Code using only Power BI.
This event, sadly, only came to my attention this year. It started in
2015 and it’s a lot of fun. In these posts I will talk about my
thinking and strategy to try and solve these problems.