 # k-Nearest-Neighbors Darts

Of what use boredom and knowledge of my studies can be. When I was at my grandparents’ in Japan – already last year, I believe –, I had some one or two hours of free time and nothing to do. It was in the afternoon and I wanted to relax a little.

So I was on the second floor and the TV program didn’t really interest me at that moment. I turned to the desk, searched for something, grabbed three arrows and positioned myself towards the corner of the room so as to face a dartboard.

#### Background

Because yes, my grandmother plays darts. Or at least she used to while she was still able to go to the second floor. Since she can’t do that anymore, the dartboard stands in the room somewhat forlornly and is only used when I visit.1

But in this moment – it was due to the layout of the three darts on the board (and in part due to my ingenuity) – I had a glorious idea: I would invent a new game of darts! And this game shall have rules so incomprehensible that it would not be any fun at all to play.

The layout of the darts immediately reminded me of a classification problem. To be precise, it reminded me of the k-nearest-neighbors algorithm from which I then also stole the name.2

There will thus follow instructions and rules for this new game which I call k-nearest-neighbors darts. For illustration I will give examples which you can follow using Figure 1.

#### The Game

A note on notation: numerical triples in squared brackets represent the three numbers hit on the board. d and t are added to the numbers if a double ring or a triple ring was hit. – means that the board (or at least a valid section) was missed. The brackets are read left-to-right. The first number denotes the so-called middle (see below) and will be marked bold in the examples and the notation. [20, 8d, –] means that at first a normal 20, then a double 8 was hit and that the last throw missed the board (or a valid section).

Start with a score of 501 points. The goal is to be the first player to reduce the score to 0 points. Now throw a dart. Assuming it hits a section that belongs to a number, you now have to try to hit each number beside the one you first hit. The section you hit first is called ‘middle section’ (or just ‘middle’ (M)).

If you succeed in hitting such an adjacent triple (this is called a golden triple), you take the sum of the numbers and triple it. The multipliers in form of the double rings and triple rings work just like in a normal game (i.e. they double and triple the value).

Let’s assume for our first example that we hit 20 first; this is now our middle. We now have to hit a section of number 5 and of number 1 next. Let’s assume we succeed and we hit a normal 5 and a double 1 (this is [20, 5, 1d] in our notation). We now reach a score of 81 points ((20 + 5 + 2) * 3), which we subtract from our intial score of 501 points (420 points remain).

But it could also be that we hit [20, 5, 12]. As you can see from Figure 1 that these are still three adjacent numbers. But since our middle is now at edge of this triple we just add the values (20 + 5 + 12 = 37). It is thus, as we can see, also possible to achieve other triples (such a triple as this one is called a silver triple).

Of course it can happen that you do not succeed in hitting three adjacent numbers. If so, there are still some possibilities to get points. Let’s assume again that M = 20.

If we now hit [20, 5, 13] (or miss the board, [20, 5, –]), we at least add the numbers 20 and 5 and take this as our score (25) for this round.

Assuming we already hit with the second dart a number that is not adjacent to our middle (e.g. 13 in our case), we have two further possibilities: either we we hit a number adjacent to our middle with the third dart (e.g. [20, 13, 5]) or we hit a number that is adjacent to our second number (adjacent to 13 are 4 and 6).

The former will be treated as described above, but if we e.g. hit a 6 at the end ([20, 13, 6]), we at least have a pair. But since this pair has nothing to do with our initial middle, we add those two values (13 + 6 = 19) and halve it (9,5) and round it up, if necessary (thus we at least score 10 points).

As we can see, the concept of a middle plays a significant role in this game. If you for instance throw multiple darts (2 or 3) in the middle, you add the values and halve it (and round up if necessary). That means with [20, 20d, 20] you get (20 + 40 + 20)/2 = 40 points or with [12, –, 12t] you get (12 + 36)/2 = 24 point. The same holds for e.g. [20, 20, 18]. In case three darts are thrown into the middle, it’s called a bronze triple.

But if you hit the middle and the remaining two hit the same number which is not the middle, you don’t get any points. For example [20, 18, 18] would not get you any points.

#### Bullseye!

An exceptional position is taken – how could it be any different – by the bullseye. With a bullseye, it’s like this: if you first hit a bullseye (OBE = Outer Bullseye, IBE = Inner Bullseye), you are allowed to anything you want on the board afterwards. It is counted as a gold triple so the numbers will be added and tripled. [OBE, 17d, 9] thus leads to (25 + 34 + 9) * 3 = 204 points, [IBE, 2, 18] leads to (50 + 2 + 18) * 3 = 210 points. These triples are called diamond triples.

If you hit only one number after bullseye (i.e. you miss one of the remaining two throws), the two values are only being added. [OBE, –, 15] thus leads to 25 + 15 = 40 points, [IBE, 1, –] leads to 50 + 1 = 51 points.

If, on the other hand, you first hit a normal number (M = 20), but then hit a BE, anything is again possible for the last throw. It will be added and tripled. [20, OBE, 6] leads to (20 + 25 + 6) * 3 = 153 points. This kind of triple is called crystal triple.3

In case you hit a BE at the end, values are only added, i.e. [12, 5, IBE] leads to 12 + 5 + 50 = 67 points, [17d, –, OBE] leads to 34 + 25 = 59 points.

#### At the end

As every other game of darts as well, there is a special way of how to end the game. In this game, it’s pretty easy: you have to end it by throwing any of the possible triples.4

So if 87 points is what you have left, you could win this game by for instance either throwing [6, 13, 10] (= (6 + 13 + 10) * 3 = 87) or [15d, 2t, 17t] (= 30 + 6 + 51 = 87). And this ends this article.

Mumon

—————————————————————

Footnotes

1 There is no room for it on the first floor.

2 The k-nearest-neighbors algorithm is about classifying a new and unseen data point. That means that we want to give a certain label or category to the point. The k in the name of the algorithm is a variable that can be instantiated with any positive integer. Let’s take k=1.

We now have a new data point which we plot alongside many other (already known) data points – these are already classified. The algorithm now looks at the k nearest neighbors of the new point and calculates a classification for the new point based on the classifications of these neighbors.

In the case of k=1, this is very easy: the new data point gets the same label as the data point closest to it.

3 There is also the very rare and extremely difficult platinum triple: three bullseye in a row. If you achieve this, you instantly win.

4 There is actually one other triple apart from the platinum triple with wich you can win the game in the very first round. Can you find it?