Applying Naive Bayes Algorithm in Rock-Scissor-Paper Game


Last Friday, @justyy hosted a rock-sicssors-papers wechat group contest for CN community and the contest is going on fire!

The robot player just plays randomly without any intelligence at all and I am planing to add the basic intelligence to it by applying the Naive Bayes algorithm.

The Naive Bayes model is basically the following formula to compute the probability:

tex_d75bd4569ecc64c17876b864b9c03074 Applying Naive Bayes Algorithm in Rock-Scissor-Paper Game algorithms games machine learning

Known the probability of P(A), P(B), and the condition probability of P(A|B), then we can compute the P(B|A). How to apply this to the rock-sissors-papers game?

  • Assume the game has been going on for a few turns and the robot has collected enough sampling data (data set)
  • We need to compute the P(rock), P(paper), and P(sissors) for both player and the robot.
  • Assume the player had X, then we need to compute winning probability of P(scissor | X), P(paper | X) and P(rock | X)
  • Pick the one has the largest probability.

Let’s hope this is fun.

You may also like: 浅谈 Naive Bayes 算法在石头剪刀布游戏的应用

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
317 words
Last Post: Logic Tests Series (2) - DECR
Next Post: How to get notification on SteemIt contests using IFTTT + Feed?

The Permanent URL is: Applying Naive Bayes Algorithm in Rock-Scissor-Paper Game

Leave a Reply