Real Intelligence. Part 3 - The Gabbar Theory of Trial-and-Error
According to Mr Gabbar Singh of the movie "Sholay", it is "unjust" when there are 6 bullets to kill 3 men. It is precisely those situations that lead to trial-and-error . When the number of available possibilities are more than the actual required options, trial-and-error starts.
Each one of us have spent countless hours playing tic-tac-toe.
What is the single-most important idea that works towards maximizing your chances of winning at tic-tac-toe ?
Most of us, although having an intuitive feel of the game, and probably a memory of some of the horrendous mistakes that could be made in the game - play with a sense of possibilites.
Read it as : "we play tic-tac-toe with trial-and-error".
If asked to program, most programmers would go about programming by creating a complete game-tree of the problem. At each step, you work out all the possible options of 1 player, then for each option, work out the options for each player, and so on. The path that leads to win is chosen. To be accurate in your assessment, you have to have a look-ahead to the extent that decides win and loss of the game.
Let me ask again : what is the single-most important idea that could maximize your chance of winning at tic-tac-toe ?
In the previous article of this series, we looked at the 8-grid puzzle, and we discussed how most people would approach it with a trial-and-error approach.
The problem seems to have a spontaneous inclination towards a trial-and-error based approach. Let us explore if there is a "systematic" approach to this problem, and if so, how to go about discovering it.
Consider this : What's the problem statement ?
The problem-statement : is that we need to fill the numbers 1-8 in this grid, such that no two consecutive numbers are either horizontal, vertical or diagonal.
What does this statement mean ?
Let us try to explore the meaning of the problem-statement under various scenarios.
If we place a number "X" in the position shown below, then the two neighbours of the number X, (i.e. X-1 and X+1) cannot occur in the boxes marked as "No". e.g. if we place number 2 in the box marked X, the numbers 1 and 3 can only show up in the boxes marked "Yes". There are 4 possible boxes for 2 numbers.
To go back to the memorable words of Mr Gabbar Singh, this is a case of "4 boxes and 2 numbers", and it is unfair, and that is where trial-and-error begins - when you choose any two boxes to fix the two numbers, X-1 and X+1.
Let us explore another scenario. If we place the number "X" in the position shown below, then the two neighbours of the number X (i.e. X-1 and X+1) cannot occur in the boxes marked as "No". while the possibilities have come down, the Gabbar principle is at work here, too ...
Now, there is just another scenario to explain, as shown below. If you notice carefully, this is a "reverse gabbar" situation, where you have 1 box available for 2 numbers.
How do you resolve this situation ?
For sure, 1 box can hold only 1 number. So, the number that goes in that box should be such that there is only 1 neighbour of that number.
Which are the numbers which have only one neighbour ?
Which number can go in the box marked X ?
Can you now find a systematic way to the solution now ?
If we were to translate this idea into a program, how would the program look ?
We would discover a lot of elegance in all the solutions that we generate, in mathematical, academic, programming or even real-life situations if we resorted less to trial-and-error and applied more of what we would call "Real Intelligence".
To come back to the opening questions of this article - what, now, do you think is the singe-most important idea that maximizes your chance of winning at tic-tac-toe ?
Is there a way to play tic-tac-toe without any trial-and-error ?
How can we bring "Real Intelligence" to playing tic-tac-toe ?
Send in your thoughts to [email protected]
Part 2 - ReInvent's First Rule of Real Intelligence.
(c) 2016, ReInvent Software Solutions (India) Pvt Ltd. All Rights Reserved