Skip to main content

Tic Tac Toe

I thought my class on Thursday was pretty cool and would like to share these with you!

***

Ok, imagine "Tic Tac Toe". If you don't know Tic Tac Toe, go play it now: https://playtictactoe.org/

Ok now, as a human, when looking at the board, it's easy for you to know if X or O that wins. But imagine machines - how would machine learn and be able to decide which player wins.

Imagine that your data only consists of the positions of the X and O at the board.

So how would you design the algorithm?

Would you look at the places where has X and 0?
Figure out the neighbors and relationships?
See if we have continuous neighbor?
If it's not continuous, take a break and try another path?

That makes sense. Since that's actually how our brain processes it when we look at the board.

But what's cool is the Sequential Minimal Optimization (SMO) algorithm - a linear-based algorithm.

I'm gonna give you a second before we dive into the answers. Take a look at what it is.

***

Done?

Instead of looking at it the way that we do, it counts the number of X. If X is more, X wins. Makes sense? Except in the case where there's a tie, this would definitely be true.

Isn't it cool? For machines to be able to learn and understand something from a totally different perspective?

I thought it was cool and have been excited to share these with you!

Comments

Popular posts from this blog

VS 2022 / .Net Core Error : Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE.

I just created a new .Net Core 3.1 project. I installed Node.JS (from Nuget Packages). I've also used the VS installer to install Node.JS. But when I run, I was still having the issue below error : Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE. I was running Visual Studio 2022. What solved it was the following: 1) I searched for node.exe and found it at the following folder: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\NodeJs 2) Opened Windows Start Menu and typed "Edit the system environment variables" 3) Click on "Environment Variables" 4) At the next screen, look for "Path" under "System Variables". Double click it / click edit. 5) Add the nodejs path from (1). 6) Restart visual studio and taraa. Solution was from one of the answers in:  https://stackoverflow.com/questions/59115525/node-j

VS Code / Flutter: Error "'flutter' is not recognized as the name of a cmdlet..."

 I was trying to run a command: flutter pub add youtube_player_flutter But it was giving me the error: "'flutter' is not recognized as the name of a cmdlet..." To fix this, we need to add it to the Environment Variables (just like what I did for node.js in the previous post!) 1) You should know where's your flutter's sdk at this point. Mine is at: C:\src\flutter\bin 2) Opened Windows Start Menu and typed "Edit the system environment variables" 3) Click on "Environment Variables" 4) At the User variables for User, click on Path. 5) Add the flutter sdk's path from (1). 6) Do the same for "System Variables". Double click on "Path" / click edit. 5) Add the flutter sdk's path from (1). 6) Restart visual studio code and then, all done! Solution found at:  https://stackoverflow.com/questions/70113055/vs-code-flutter-is-not-recognized-as-the-name-of-a-cmdlet

MapBox Flutter Turn-by-turn Navigation - Not Updated / Not Working

 I have spent countless hours/days trying to fix the turn-by-turn navigation. I thought it was just me not understanding flutter and MapBox integration. Apparently, there was an issue in their SDK for turn-by-turn navigation. It has been fixed for Android native SDK but not for Flutter's. There may be a way to fix it. But I've decided to go native now. Bye Flutter. 😭 P.S. Share with me if you were able to make their turn-by-turn navigation a success!