Fundamentals of Artificial Intelligence: Concepts, A* Worked Example and Exam Traps
Build a working map of AI, agents, search, learning and language. Then trace A* step by step to see why a goal route costing 10 must be replaced by one costing 8.
KnowledgeGate Team
Exam prep & CS education

Artificial intelligence is often introduced through overlapping terms such as automation, machine learning, agents, reasoning and search, leaving learners with memorised definitions but no working mental model. AI, machine learning, deep learning and generative AI differ in scope; a warehouse inspection robot's route can be formulated and solved with A*. The first route generated for goal G costs 10, but correct frontier handling replaces it with the optimal route of cost 8.
1. Define AI through goals, information and action
As a practical study definition, an AI system uses represented information to select outputs or actions involving perception, reasoning, learning, planning or language. This does not, on its own, mean that it thinks or understands like a person.
A fixed traffic-light timer is ordinary automation. A rule-based diagnostic expert system can be AI without learning. A classifier fitted from examples is AI implemented through machine learning. Neither using rules nor learning from data defines all AI.
Four classic lenses describe the field: thinking humanly, acting humanly, thinking rationally and acting rationally. The earlier Approaches to AI guide owns the full four-way comparison. Here, those lenses frame a practical agent model: state the goal, represent the available information and select the action that best serves the performance measure.
2. Place machine learning, deep learning and generative AI correctly
Machine learning is one family of methods within AI. Deep learning is a family within machine learning. Generative AI is defined by producing new content and is commonly built with deep neural models, but it is not synonymous with all deep learning or all AI.
Four boundary cases make the hierarchy concrete. An explicit shortest-route search is AI without learning. A spam classifier fitted from labelled messages uses machine learning. A many-layer neural image classifier uses deep learning. A model asked to produce three alternative email subject lines is doing a generative task.
A neural network is one model family, not the definition of AI. Classify a system by what it does and how it does it, not by whichever AI label sounds newest.
3. Turn a task into an intelligent-agent specification
An agent receives percepts through sensors and affects an environment through actuators. A rational action is expected to maximise the performance measure, given the available percept history and knowledge. Rational does not mean omniscient, guaranteed to succeed or morally correct.
For an illustrative warehouse inspection robot, the PEAS specification is:
PEAS part | Specification |
|---|---|
Performance | Reach inspection point |
Environment | The static warehouse route graph in the next section |
Actuators | Drive, turn, brake and stop |
Sensors | Position beacon, wheel odometry and proximity detector |
The current state is S. The goal test is current node = G, and each edge label is its route cost. Only this abstract layer is fully observable, deterministic, sequential, static, discrete and single-agent. A real robot would usually face incomplete sensor information and moving people, making its environment partially observable and dynamic.
4. Formulate the route graph and read an A* heuristic
The dedicated A* Search Algorithm guide owns OPEN/CLOSED bookkeeping, relaxation and heuristic guarantees. The compact trace here has a different role: it connects the warehouse robot's PEAS specification, state model and performance measure to one route decision. The search states are {S,A,B,C,D,G}, with start S and goal G. Directed weighted edges are S->A:2, S->B:4, S->G:10, A->C:2, A->D:5, B->D:1, C->G:5 and D->G:3. Path cost is the sum of edge costs. The complete routes cost:
S->G = 10S->A->C->G = 2+2+5 = 9S->A->D->G = 2+5+3 = 10S->B->D->G = 4+1+3 = 8
Breadth-first search orders by depth, so it does not guarantee the lowest cost here. For a full Greedy-versus-A* comparison on a separate graph, use Fundamentals of Heuristic Search; this trace instead completes the agent-to-action chain. Uniform-cost search uses g(n), greedy best-first search uses h(n), and A* uses f(n)=g(n)+h(n). Here, g(n) is cost from S, while h(n) estimates remaining cost to G.
Node | S | A | B | C | D | G |
|---|---|---|---|---|---|---|
| 7 | 6 | 3 | 4 | 2 | 0 |
True cheapest remaining cost | 8 | 7 | 4 | 5 | 3 | 0 |
Every estimate is admissible because it never exceeds the true remaining cost. It is also consistent. For example, h(B)=3 <= 1+h(D)=3, and h(A)=6 <= 2+h(C)=6.

5. Run A* step by step and replace the first goal route
Start with S on the frontier. Select the lowest f. At step 3, break equal f=8 values by lower h, placing G before A.
Step | Node expanded | Frontier after update, ordered by f | Decision |
|---|---|---|---|
0 | none |
| start |
1 |
|
| choose |
2 |
|
| choose |
3 |
|
| replace |
4 |
|
| goal popped, stop |
The update keeps the lower path cost and changes G's parent from S to D.
The parent pointers are G<-D<-B<-S. Reverse them to obtain S->B->D->G, with cost 4+1+3=8. The alternatives cost 10, 9 and 10, so 8 is minimal.
Generating a goal is not the same as selecting it for expansion. Direct route S->G appears at cost 10, but stays on the frontier while lower-f possibilities are explored. Expanding D updates G to cost 8. With this consistent heuristic and graph-search handling, stop when the goal is popped, not when first generated.

6. Keep representation, reasoning, learning and language distinct
Knowledge representation means choosing structures in which facts and relationships can be stored and queried. The chosen representation determines which queries are easy to answer. Suppose we store Connected(A,B) and Connected(B,C), with the rules Connected(x,y) -> Reachable(x,y) and Reachable(x,y) AND Connected(y,z) -> Reachable(x,z). The first rule derives Reachable(A,B); the second then derives Reachable(A,C). Repeating the second rule until no new fact appears computes reachability over a finite graph.
Reasoning applies stored rules or a model to current information. Supervised learning estimates a mapping from labelled examples. Unsupervised learning seeks structure without target labels. Reinforcement learning updates behaviour from reward signals. One system may combine search, reasoning and learning, but the terms are not interchangeable.
Natural-language processing is an application area that may use rules, statistical learning or neural models. The application label names the type of input and output; it does not identify one required algorithm.
7. Repair common AI and A* traps
Trap | Repair |
|---|---|
AI = machine learning | ML is one AI method family |
Every AI system learns | Search and rule-based systems can be AI |
Rational = always correct | Rational means the best expected action from available information |
|
|
Smallest | That is greedy ordering; A* minimises |
BFS finds the cheapest weighted route | Use UCS or an appropriate A* setup |
Stop when | Keep it on the frontier and later update it to cost |
Representative assessment moves include choosing the AI and ML relationship, matching PEAS sensors and actuators, classifying an environment, distinguishing g, h and f, and tracing the frontier until G(g=8,h=0,f=8) is popped. One compact self-check combines them: if h(B) rises from 3 to 5 while B's true remaining cost is 4, the heuristic is not admissible. The route costs stay unchanged, but the usual A* optimality guarantee no longer follows from this heuristic.
8. Fundamentals of AI: the short version and next step
Keep this six-line recall chain:
Define the goal.
Specify PEAS.
Classify the environment.
Represent states and costs.
Choose the search or learning method that matches the task.
Verify the result against the performance measure.
On paper, rebuild S -> B -> D -> G from memory, then explain why the first G changes from 10 to 8. AI is the broad field; ML and deep learning are method families inside it. Continue with Artificial Intelligence (AI), or explore the verified Skill Development Courses route.
Keep learning
Artificial Intelligence and Machine Learning: Concepts, Worked Examples and Exam Patterns
Build a clean map of AI, ML and deep learning, then apply it through k-NN and confusion-matrix calculations. Finish with common question styles and traps.
Search Algorithms in AI: BFS, DFS, UCS and A* Explained on One Worked Graph
Run five major AI search algorithms on the same weighted graph, compare the paths they return, and check admissibility and consistency with real numbers.
Natural Language Processing in AI: Core Concepts, a Worked Bigram Example, and How Exams Test It
Build NLP from tokens to transformers, then reproduce the TF-IDF and bigram calculations that exam and placement questions expect.
Multi Agent Systems in AI: Concepts, Nash Equilibrium and Auctions with Worked Examples
Learn the complete MAS concept set, then compute a Nash equilibrium, a minimax choice and a Vickrey auction outcome step by step.





