“Kusto Detective Agency 2022 — Case #4 Badge

Walk Through Guide for Kusto Detective Agency 2022, Case #4 Solution

Aviv Yaniv
Courisity is a Drug

--

Do you ready for a tour? Because we have a s🌳t tour, especially for you!

The fourth case riddle is:

So we are tasked to find the Special Prime under 100M.

The GeeksForGeeks definition for Special Prime Number is:

A prime number is said to be Special prime number if it can be expressed as the sum of three integer numbers: two neighboring prime numbers and 1. For example, 19 = 7 + 11 + 1, or 13 = 5 + 7 + 1.
Note:- Two prime numbers are called neighboring if there are no other prime numbers between them.

We have the list of prime numbers, so to find Special Primes we shall want to sum the previous prime number and previous-previous prime with 1.

⚠SPOILER ALERT — THE SOLUTION DESCRIBED BELOW⚠

Lucky us🍀KQL has the prev function that lets us find the previous row value:

Now, it’s time to browse to https://aka.ms/99999517 and see the real riddle:

The key takeaways from the riddle:

  1. In New-York, there is 66-meter radius area containing the following trees: Turkish Hazelnut and four Schubert Chokecherries
  2. In the same area above, there is a message nearby a smallest American Linden tree
  3. The size of the tree can be derived using ‘tree_dbh’ (tree diameter) column

⚠SPOILER ALERT — THE SOLUTION DESCRIBED BELOW⚠

So let’s delve into the data, by leveraging the | take 1, to see a single row.

The nyc_trees table has; Tree ID, Block ID, Row Created Data, Tree Diameter, Tree Status, Tree Health, Latin Name, Common Name, Latitude, Longitude, etc...

We are directed to look at 66-meter radius area, to find that combination of trees.

Lucky us🍀 KQL has GeoLocation support!

Both of: Geohash (Rectangle), S2 Cell (Rectangle), H3 Cell (Hexagon)

The closest shape to have a radius is a Hexagon (until the Greek Geometry conundrum of Squaring the Circle is over).

So let’s find how to find a 66-meter radius of a H3 resolution table:

H3 Average edge length (Km)

The Edge Length of resolution 10 H3 cell is:

0.065907807 Kilometer = 65.907807 meters

We shall group the trees by H3 cells of resolution 10, and count how many trees of types Turkish Hazelnut and Schubert Chokecherries are within the cell using the countif aggregative function:

We found the H3 cell!

The coordinated of the H3 can be converted to Polygon using geo_h3cell_to_polygon:

Let’s see the area in the overview using the Polyline tool:

The Hexagon of the H3 cell overview using Polyline Tool

We know that the message is nearby the smallest American Linden of that cell…

American Linden, “Basswood”, Tilia Americana

So let’s find the smallest American Linden in that H3 cell:

And now is the time for a Virtual Tour there:

We see a mural near the tree:

Mural near the Tree

Let’s look closer at the beautiful mural:

El Puente, Ashes to Ashes

BusinessInsider describes this mural:

This is a commissioned anti-smoking piece created by the group El Puente with a group of characters smoking around a baby exalted by the light

It’s time to decrypt the message with the key “Ashes to Ashes”:

And another mystery is solved!

Enjoyed this article? Feel free to long-press the 👏 button below 😀

Click for Next Case Solution

Click for Previous Case Solution

Cases Solutions: 1 2 3 4 5

--

--

Aviv Yaniv
Courisity is a Drug

Senior Software Development Engineer 🖥️ Economist 📈 Beer Brewer 🍻 Photographer 📷 ~ “Curiosity is my drug”