After years of learning, I still can't understand what is considered to be an AI. What are the requirements for an algorithm to constitute Artificial Intelligence? Can you provide pseudocode examples of what constitutes an AI?
AI is not a simple term. There are different types, ranging from the most simplistic rule-based AI to black-box AI's so complicated it's unreasonable for a human to understand exactly what they're doing.
There's no pseudocode that if used in a program automatically constitutes it as an AI. It's not that black and white. But I can give examples:
Here's a rule-based chess AI that forfeits if it's too far behind, and plays aggressively if it's far enough ahead.
if player.score - my.score > 10: forfeit elif my.score - player.score > 10: agressive = True for each piece of my.pieces: for each square of board.squares: if noThreats(square) and agressive is True: move(piece, square) return
This is considered an "AI" because it feigns intelligence - appearing to have a true understanding of chess while simply following a set of rules, making it an "Artificial" Intelligence.
Here's another more complicated AI:
decisionNet = NeuralNetwork(64 inputs, 2 outputs) choice = decisionNet(board.squares) // Returns a chess square with one of my pieces and desitnation move(choice)
This uses a neural network to make the decision, which could have been trained on a bunch of example games or against itself. Due to this "training phase", humans can't understand precisely what the network is doing without extensive effort, so it's an even gives an even more convincing understanding of chess. But if we want, we could still understand the nuances of this network, and show it doesn't possess an intelligence, it again only feigns it.
I should mention that virtually any code that has an if statement can be considered AI. The examples I provided are just easier to pass off as understanding a very complicated concept (chess), as opposed to, say, verifying a user login. They both have the same fundamentals, it's just one appears more complicated on the surface than the other.
Philosophically, my own research has led me to understand AI as any artifact that makes a decision. This is because the etymology of "intelligence" strongly implies "selecting between alternatives", and these meanings are baked in all the way back to the proto-Indo-European.
(Degree of intelligence, or "strength" is merely a measure of utility, typically versus other decision making mechanisms, or, "fitness in an environment", where an environment is any action space.)
Therefore, the most basic form of automated (artificial) intelligence is:
if [some condition] then [some action]
It is worth noting that narrow AI which matches or exceeds human capability, in the popular sense, manifested only recently when we had sufficient processing and memory to derive sufficient utility from statistical decision making algorithms. But Nimatron constitutes perhaps the first functional strong-narrow AI in a modern computing context, and the first automated intelligence are simple traps and snares, which have been with us almost as long as we've used tools.
I will leave it to others to break down all the various forms of modern AI.