Publications by Peter Prevos

Euler Problem 14: Longest Collatz Sequence

01.03.2017

Euler Problem 14 looks at the Collatz Conjecture. These playful sequences, named after German mathematician Lothar Collatz (1910–1990), cause mathematicians a lot of headaches. This video introduces the problem much better than I can describe it. Euler Problem 14 Definition The following iterative sequence is defined for the set of positive...

3093 sym R (1512 sym/3 pcs) 14 img

Create Air Travel Route Maps in ggplot: A Visual Travel Diary

06.03.2017

I have been lucky to fly to a few countries around the world. Like any other bored traveller, I thumb through the airline magazines and look at the air travel route maps. These maps are beautifully stylised depictions of the world with gently curved lines between the many destinations. I always wanted such a map for my own travel adventures. Cre...

2332 sym R (1594 sym/3 pcs) 6 img

Euler Problem 15: Pathways Through a Lattice

09.03.2017

Euler Problem 15 analyses taxicab geometry. This system replaces the usual distance function with the sum of the absolute differences of their Cartesian coordinates. In other words, the distance a taxi would travel in a grid plan. The fifteenth Euler problem asks to determine the number of possible routes a taxi can take in a city of a certain si...

1964 sym R (392 sym/1 pcs) 4 img

Tic Tac Toe Simulation — Random Moves

12.03.2017

Tic Tac Toe might be a futile children’s game but it can also teach us about artificial intelligence. Tic Tac Toe, or Naughts and Crosses, is a zero-sum game with perfect information. Both players know exactly what the other did and when nobody makes a mistake, the game will always end in a draw. Tic Tac Toe is a simple game but also the muc...

2123 sym R (2146 sym/2 pcs) 2 img

Euler Problem 16: Power Digit Sum

15.03.2017

Euler Problem 16 is reminiscent of the famous fable of wheat and chess. Lahur Sessa invented the game of chess for King Iadava. The king was very pleased with the game and asked Lahur to name his reward. Lahur asked the king to place one grain of rice on the first square of a chessboard, two on the next square, four on the third square and so...

1897 sym R (241 sym/2 pcs) 10 img

Euler Problem 17: Number Letter Counts

22.03.2017

Euler Problem 17 asks to count the letters in numbers written as words. This is a skill we all learnt in primary school mainly useful when writing cheques—to those that still use them. Each language has its own rules for writing numbers. My native language Dutch has very different logic to English. Both Dutch and English use a single syllable u...

2684 sym R (2578 sym/2 pcs) 2 img

Data Pseudo-Science: Developing a Biorhythm Calculator

29.03.2017

Data science is a serious occupation. Just like any other science, however, it can also be used for spurious topics, such as calculating your biorhythm. This post provides an example of data Pseudo-Science though a function that calculates and visualises your biorhythm. Based on the graph, I must be having a great day right now. The broader and ...

3604 sym R (875 sym/1 pcs) 14 img

Tic Tac Toe War Games: The Intelligent Minimax Algorithm

05.04.2017

In a previous post, I shared how to build a randomised Tic Tac Toe simulation. The computer plays against itself playing at random positions. In this post, I will share how to teach the computer to play the game strategically. I love the 1983 classic movie War Games. In this film, a computer plays Tic Tac Toe against itself to learn that it cann...

4023 sym R (6166 sym/6 pcs) 4 img

Data Science from a Strategic Business Perspective

11.04.2017

Last night I spoke at the Melbourne R User Group (MelbuRn) about data science from a strategic business perspective. It was great to see so many people attending. My presentation outlined the strategy that I developed and am implementing for my employer Coliban Water. This strategy is based on a common-sense approach that leverages our existing ...

1628 sym 2 img

R-Cade Games: Simulating the Legendary Game of Pong

19.04.2017

Pong is one of the earliest arcade games on the market, first released in 1972. From the day I first saw this miracle box, I wanted to know more about computers. I learnt how to write code from the 1983 book Dr. C. Wacko’s Miracle Guide to Designing and Programming your own Atari Computer Arcade Games. This book explains in a very clear and hu...

1926 sym R (2212 sym/1 pcs) 2 img