Bas Jacobs
/
Recent content on Bas JacobsHugo -- gohugo.ioen-usWed, 18 May 2022 00:00:00 +0000Riddler: Nonconformist Dice
/post/2022-05-18-riddler-nonconformist-dice/
Wed, 18 May 2022 00:00:00 +0000/post/2022-05-18-riddler-nonconformist-dice/Last week’s Riddler Classic is a question about rolling tetrahedral dice:
You have four fair tetrahedral dice whose four sides are numbered 1 through 4.
You play a game in which you roll them all and divide them into two groups: those whose values are unique, and those which are duplicates. For example, if you roll a 1, 2, 2 and 4, then the 1 and 4 will go into the “unique” group, while the 2s will go into the “duplicate” group.Closest Eredivisie football club
/post/2021-02-16-closest-eredivisie-football-club/
Tue, 16 Feb 2021 00:00:00 +0000/post/2021-02-16-closest-eredivisie-football-club/A couple of months back, I saw a map of England that showed the closest Premier League football club at any location. I can’t find the exact same map anymore, but this map on Reddit is similar.
I figured it would be a nice exercise in spatial visualization in R to try and create a similar map for the Netherlands. The Dutch highest football league is called the Eredivisie and consists of 18 clubs.Riddler: Another Hunt For Mysterious Numbers
/post/2021-02-06-riddler-another-hunt-for-mysterious-numbers/
Sat, 06 Feb 2021 00:00:00 +0000/post/2021-02-06-riddler-another-hunt-for-mysterious-numbers/This week’s FiveThirtyEight Riddler Express is similar to the Riddler Classic of two weeks ago:
By all accounts, Riddler Nation had a lot of fun hunting for the mysterious numbers a few weeks back. So here’s what we’re going to do: For the next four weeks, the Riddler Express will feature a similar puzzle that combines multiplication and logic. We’ll be calling these CrossProducts. For your first weekly CrossProduct, there are five three-digit numbers — each belongs in a row of the table below, with one digit per cell.Riddler: Can You Hunt For The Mysterious Numbers?
/post/2021-01-22-riddler-can-you-hunt-for-the-mysterious-numbers/
Fri, 22 Jan 2021 00:00:00 +0000/post/2021-01-22-riddler-can-you-hunt-for-the-mysterious-numbers/This week’s FiveThirtyEight Riddler Classic offers a sudoku-like puzzle:
There are eight three-digit numbers — each belongs in a row of the table below, with one digit per cell. The products of the three digits of each number are shown in the rightmost column. Meanwhile, the products of the digits in the hundreds, tens, and ones places, respectively, are shown in the bottom row. Can you find all eight three-digit numbers and complete the table?EleksDraw pen plotter with R
/post/2021-01-04-eleksdraw-pen-plotter-with-r/
Mon, 04 Jan 2021 00:00:00 +0000/post/2021-01-04-eleksdraw-pen-plotter-with-r/The EleksDraw pen plotter is a relatively cheap pen plotter that works like the better-known AxiDraw plotter. Unlike the AxiDraw, it comes as a kit that needs to be assembled, and the only software available is a Windows program. Since I’m using macOS and I wanted more freedom, I decided to fiddle around with it in Python, which resulted in a blog post and accompanying code. In this post, I describe how I got to get it working with ggplot2 in R.Image Triangulation with Julia
/post/2020-11-18-image-triangulation-with-julia/
Wed, 18 Nov 2020 00:00:00 +0000/post/2020-11-18-image-triangulation-with-julia/I have always been fascinated by computer generated art. Recently, I came across the paper Stylized Image Triangulation by Kai Lawonn and Tobias Günther. In this paper, the authors perform image triangulation (approximating an image by tessellation with triangles) by coming up with an initial grid and performing gradient descent. They achieve beautiful triangulations that capture the original images very well. Their code is a combination of MatLab and C++, and is available on github.Riddler: Can You Eat All The Chocolates?
/post/2020-10-02-riddler-can-you-eat-all-the-chocolates/
Fri, 02 Oct 2020 00:00:00 +0000/post/2020-10-02-riddler-can-you-eat-all-the-chocolates/Today’s 538 Riddler Classic is about eating chocolates:
I have 10 chocolates in a bag: Two are milk chocolate, while the other eight are dark chocolate. One at a time, I randomly pull chocolates from the bag and eat them — that is, until I pick a chocolate of the other kind. When I get to the other type of chocolate, I put it back in the bag and start drawing again with the remaining chocolates.Trees and Tents
/post/2019-04-21-trees-and-tents/
Sun, 21 Apr 2019 00:00:00 +0000/post/2019-04-21-trees-and-tents/Trees and Tents is a logic game in which tents need to be placed in a grid. Every tent must be next to a tree, and tents cannot touch horizontally, vertically or diagonally. For every row and column, the number of tents is given.
The website https://brainbashers.com/tents.asp posts a new puzzle every day, of which a 12x12 example is the following:
A 12x12 Trees and Tents puzzle from https://brainbashers.Showing images on hover in Plotly with R
/post/2018-10-28-showing-images-on-hover-in-plotly-with-r/
Sun, 28 Oct 2018 00:00:00 +0000/post/2018-10-28-showing-images-on-hover-in-plotly-with-r/For a project I was working on recently, I wanted to turn a ggplot scatterplot into an interactive visualisation: when hovering over a point, a corresponding image needed to be shown. I did not want to use Shiny, since I required the visualisation to be portable. This is possible by manually tinkering with html, but using the plotly and htmlwidgets packages, I was able to achieve what I wanted without the need to leave the comfy RStudio environment, and without needing to host the plot on the plot.Learning image representation with Keras in R
/post/2018-09-20-image-approximation-with-keras-in-r/
Thu, 20 Sep 2018 00:00:00 +0000/post/2018-09-20-image-approximation-with-keras-in-r/An image can be viewed as a function mapping pixel locations \(x,y\) to color values \(R,G,B\). Since neural networks are function approximators, we can train such a network to approximate an image. The network is then a representation of the image as a function and its contents can be displayed by evaluating the network for all pixel pairs \(x,y\).
The Keras package for R is now approximately 1 year old but I have to admit that I usually go to Python to implement neural networks.Generating the logo for this site
/post/2018-07-15-generating-the-logo-for-this-site/
Sun, 15 Jul 2018 00:00:00 +0000/post/2018-07-15-generating-the-logo-for-this-site/I wanted a logo for my blog. Something kind of personal, but abstract; preferably something that could be drawn with a single path. I decided to download an elevation map of the Netherlands (where I live) to somehow use a plot of that data as my logo. I thought it would be nice to generate a side view and smooth it. In this short post I will discuss how I did it.Pen plotter
/post/2018-06-28-pen-plotter/
Thu, 28 Jun 2018 00:00:00 +0000/post/2018-06-28-pen-plotter/Inspired by this blog post, I got interested in pen plotters and computer generated art. I liked the minimalist pieces of art a plotter could create, resembling a human hand doodling on a piece of paper. A lot of examples of this art can be found on Twitter at #plottertwitter. By far the most used plotter on Twitter is the AxiDraw, but since I didn’t want to spend over 400 euros and I liked the prospect of assembling something myself, I decided to buy the EleksDraw which was around 100 euros and came completely unassembled.