“Algorithms to Live By” - My Favourite Developer Audiobook

“Algorithms to Live By” - My Favourite Developer Audiobook

Today I want to share with you a review of the most exciting book I have listened to so far –“Algorithms to Live By: The Computer Science of Human Decisions” by Brian Christian and Tom Griffiths*.* I have already mentioned it on this blog when simulating the secretary problem. This is just an example of many fascinating problems this book talks about. Continue reading to find out why it makes such an amazing listening experience. ...

October 3, 2018 · 4 min · Bartosz Jedrzejewski
Implementing Minimax Algorithm in Java

Implementing Minimax Algorithm in Java

If you want to write a program that is able to play a strategy game, there are good chances that you will be looking at a Minimax algorithm. This is especially true when it comes to games like chess, where variations of the Minimax algorithm are what is used to build the strongest chess-playing programs in existence. In this article, I will look at implementing the basic version of the Minimax algorithm with Java. ...

September 23, 2018 · 5 min · Bartosz Jedrzejewski
Please, stop writing so many “for loops” in Java!

Please, stop writing so many “for loops” in Java!

In this blog post, I want to take you back to basics and talk about Java for loops. To be honest, I am writing this blog post partially for myself, as this is something that I am myself too often guilty of. Since Java 8, we don’t have to write so many for loops in Java! I hope this blog post will make your code nicer to read and quicker to write. ...

September 15, 2018 · 3 min · Bartosz Jedrzejewski
Simulating the Secretary Problem with Java

Simulating the Secretary Problem with Java

You might have noticed that I like reading books. I have recently read *“Algorithms to Live By: The Computer Science of Human Decisions”*which absolutely fascinated me! The book mentions a famous optimal stopping (Wikipedia) problem called Secretary Problem. In this blog post, I will explain it and then we will have some fun simulating it with Java. Let’s see if we can find a solution by brute force! Secretary Problem Defined Imagine that you need to hire a secretary. Imagine now that you have 100 candidates that you are going to interview. Because you are a perfect interviewer, you can compare every single person against everyone else that you have seen so far. After the interview, you have to either hire the person or reject. If you reject, you can’t change your mind. You win if you have managed to hire the best candidate out of the whole lot. ...

September 9, 2018 · 5 min · Bartosz Jedrzejewski