AI Notes
Unit :- 1
What is Artificial Intelligence (AI)?
Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial
defines “man-made” and intelligence defines “thinking power” hence AI means man-made
thinking power.
So, we can define AI as:
It is a branch of computer science by which we can create intelligent machines which can
behave like a human, think like humans, and able to make decisions.
Importance of A.I. :-
1. Automation and Efficiency: AI automates repetitive tasks, enhancing productivity
and reducing human error.
2. Data Analysis and Insights: AI processes vast amounts of data quickly to generate
valuable insights and predictions.
3. Improving Healthcare: AI aids in faster diagnosis, personalized treatments, and drug
discovery for better healthcare outcomes.
4. Enhancing Decision-Making: AI supports data-driven decisions, optimizing
operations and reducing risks in businesses.
5. Personalization: AI tailors recommendations and services to individual preferences,
improving user experience.
6. Solving Complex Problems: AI helps address global challenges like climate change,
health crises, and poverty with innovative solutions.
7. Advancements in Robotics: AI-powered robots perform precise, dangerous, or
repetitive tasks, boosting productivity and safety.
8. Ethical and Social Considerations: AI raises ethical concerns about job
displacement, biases, and privacy that need careful regulation.
9. Education and Research: AI enhances personalized learning, automates
administrative tasks, and advances research across fields.
[Link] Connectivity: AI enhances communication, language translation, and internet
services, fostering global collaboration.
Advantages of Artificial Intelligence :-
1. High Accuracy with less errors: AI machines or systems are prone to less errors and
high accuracy as it takes decisions as per pre-experience or information.
2. High-Speed: AI systems can be of very high-speed and fast-decision making, because
of that AI systems can beat a chess champion in the Chess game.
3. High reliability: AI machines are highly reliable and can perform the same action
multiple times with high accuracy.
4. Useful for risky areas: AI machines can be helpful in situations such as defusing a
5. bomb, exploring the ocean floor, where to employ a human can be risky.
6. Digital Assistant: AI can be very useful to provide digital assistant to the users such
as AI technology is currently used by various E-commerce websites to show the
products as per customer requirement.
7. Useful as a public utility: AI can be very useful for public utilities such as a self-
driving car which can make our journey safer and hassle-free, facial recognition for
security purpose, Natural language processing to communicate with the human in
human-language, etc.
Disadvantages of Artificial Intelligence :-
High Cost: The hardware and software requirement of AI is very costly as it requires
lots of maintenance to meet current world requirements.
Can’t think out of the box: Even we are making smarter machines with AI, but still
they cannot work out of the box, as the robot will only do that work for which they are
trained, or programmed.
No feelings and emotions: AI machines can be an outstanding performer, but still it
does not have the feeling so it cannot make any kind of emotional attachment with
human, and may sometime be harmful for users if the proper care is not taken.
Increase dependency on machines: With the increment of technology, people are
getting more dependent on devices and hence they are losing their mental capabilities.
No Original Creativity: As humans are so creative and can imagine some new ideas
but still AI machines cannot beat this power of human intelligence and cannot be creative
and imaginative.
AI Techniques:
1. Machine Learning (ML): A method where computers learn from data to make
predictions or decisions without being explicitly programmed. Includes supervised,
unsupervised, and reinforcement learning.
2. Deep Learning: A subset of ML that uses neural networks with many layers (artificial
neurons) to analyze complex patterns in large datasets (e.g., image or speech
recognition).
3. Natural Language Processing (NLP): AI technique that enables machines to
understand, interpret, and generate human language, used in applications like chatbots,
language translation, and sentiment analysis.
4. Computer Vision: AI that enables machines to interpret and understand visual
information from the world, used in facial recognition, autonomous vehicles, and
medical image analysis.
5. Reinforcement Learning: A type of learning where an agent learns to make decisions
by receiving rewards or penalties for actions, commonly used in robotics and game-
playing AI.
6. Expert Systems: AI that mimics the decision-making abilities of a human expert, used
in areas like medical diagnosis and technical troubleshooting.
7. Robotic Process Automation (RPA): The use of AI to automate routine and rule-
based tasks, improving efficiency in business operations.
8. Generative Adversarial Networks (GANs): A deep learning model used to generate
new data instances, such as creating realistic images, videos, or text based on existing
datasets.
Criteria for AI Success:
1. Accuracy: AI should deliver accurate predictions or decisions that meet the desired
objectives with minimal errors.
2. Scalability: The AI solution should perform well when scaled to larger datasets or
more complex tasks without significant degradation in performance.
3. Adaptability: AI models need to adapt to new data and evolving conditions without
requiring complete retraining from scratch.
4. Efficiency: AI systems must operate within reasonable timeframes and resource
constraints, such as memory, computing power, and energy consumption.
5. Ethical Considerations: AI should be developed and deployed in a way that respects
privacy, avoids bias, and aligns with ethical standards.
6. Transparency: AI decision-making processes should be understandable and
explainable, especially in high-stakes environments like healthcare and finance.
7. Reliability: AI systems should function reliably and consistently in real-world
conditions, including handling unexpected or ambiguous inputs.
8. User-Friendliness: AI solutions should be easy for end-users to interact with, ensuring
that they add value without requiring deep technical expertise.
State space search
State space search is a process used in the field of computer science , including artificial
intelligence (AI), in which successive configurations or states of an instance are
considered, with the intention of finding a goal state with the desired property.
Problems are often modelled as a state space , a set of states that a problem can be in. The
set of states forms a graph where two states are connected if there is an operation that can
be performed to transform the first state into the second.
State space search often differs from traditional computer science search methods because
the state space is implicit : the typical state space graph is much too large to generate and
store in memory . Instead, nodes are generated as they are explored, and typically
discarded thereafter. A solution to a combinatorial search instance may consist of the goal
state itself, or of a path from some initial state to the goal state.
Water Jug Problem:
Problem: You are given two jugs, a 4-gallon one and a 3-gallon [Link] has any
measuring mark on [Link] is a pump that can be used to fill the jugs with [Link] can
you get exactly 2 gallons of water into the 4-gallon jug.
Solution:
The state space for this problem can be described as the set of ordered pairs of integers
(x,y)
Where,
X represents the quantity of water in the 4-gallon jug X= 0,1,2,3,4
Y represents the quantity of water in 3-gallon jug Y=0,1,2,3
Start State: (0,0)
Goal State: (2,0)
Generate production rules for the water jug problem.
State Space Tree:
Production System in AI
A production system (popularly known as a production rule system) is a kind of cognitive
architecture that is used to implement search algorithms and replicate human problem-
solving skills. This problem-solving knowledge is encoded in the system in the form of little
quanta popularly known as productions.
It consists of two components: rule and action.
Rules recognize the condition, and the actions part has the knowledge of how to deal with
the condition.
In simpler words, the production system in AI contains a set of rules which are defined by
the left side and right side of the system. The left side contains a set of things to watch for
(condition), and the right side contains the things to do (action).
What are the Elements of a Production System?
Global Database: The primary database which contains all the information necessary to
successfully complete a task. It is further broken down into two parts: temporary and
permanent. The temporary part contains information relevant to the current situation only
whereas the permanent part contains information about the fixed actions.
A set of Production Rules: A set of rules that operates on the global database. Each
rule consists of a precondition and postcondition that the global database either meets or
not. For example, if a condition is met by the global database, then the production rule is
applied successfully.
Control System: A control system that acts as the decision-maker, decides which
production rule should be applied. The Control system stops computation or processing
when a termination condition is met on the database.
What are the Features of a Production System?
Simplicity: Due to the use of the IF-THEN structure, each sentence is unique in the
production system. This uniqueness makes the knowledge representation simple to
enhance the readability of the production rules.
Modularity: The knowledge available is coded in discrete pieces by the production
system, which makes it easy to add, modify, or delete the information without any side
effects.
Modifiability: This feature allows for the modification of the production rules. The rules
are first defined in the skeletal form and then modified to suit an application.
Knowledge-intensive: As the name suggests, the system only stores knowledge. All the
rules are written in the English language. This type of representation solves the semantics
problem.
What are the Classes of a Production System?
A production system is classified into four main classes which are:
Monotonic Production System: In a monotonic production system, the use of one rule
never prevents the involvement of another rule when both the rules are selected at the
same time. Hence, it enables the system to apply rules simultaneously.
Partially Commutative Production System: In this production system if a set of rules
is used to change state A to state B then any allowable combination of these rules will
also produce the same results (convert state A to state B).
Non-Monotonic Production System: This production system increases the problem-
solving efficiency of the machine by not keeping a record of the changes made in the
previous search process.
Commutative Production System: These type of production systems is used when the
order of operation is not important, and the changes are reversible.
What are the Advantages of using a Production System in AI?
Offers modularity as all the rules can be added, deleted, or modified individually.
Separate control system and knowledge base.
An excellent and feasible model that imitates human problem-solving skills.
Beneficial in real-time applications and environment.
Offers language independence.
Issues in the design of the search programs.
1. State Space Explosion
Large state spaces can grow exponentially, leading to excessive computation and
memory usage, making the problem infeasible to solve.
2. Memory Consumption
Some search algorithms (e.g., BFS) require storing all explored nodes, which can lead
to high memory usage, especially with large state spaces.
3. Time Complexity
Search algorithms can be slow if they need to explore a large number of states, leading
to high time complexity and inefficiency.
4. Completeness
Some search algorithms (e.g., DFS) may fail to find a solution in certain cases, making
them incomplete if they don’t explore all possibilities.
5. Optimality
Some algorithms (e.g., greedy search) might find quick solutions that are not optimal,
which is problematic for applications needing the best solution.
6. Heuristics Design
A poorly designed heuristic can lead to inefficient search by guiding the algorithm in
the wrong direction or missing optimal solutions.
7. Handling of Dynamic or Changing Environments
In dynamic environments, states may change during search, requiring continuous
adaptation of the search strategy to account for those changes.
8. Incorporating Multiple Constraints
Problems with multiple constraints can complicate the search by adding extra
limitations, making it harder to find a feasible or optimal solution.
Heuristic Search :
Heuristic search is a type of search algorithm used in AI that guides the search process by
using a heuristic function (also called a "cost function" or "evaluation function") to
estimate the best path or solution.
The heuristic helps prioritize which nodes or states to explore next, making the search
more efficient by focusing on the most promising options instead of blindly exploring all
possibilities.
The heuristic method, however, might not always give the best solution, but it guaranteed
to find a good solution in reasonable time.
Heuristics function: Heuristic is a function which is used in Informed Search, and it finds
the most promising path. It takes the current state of the agent as its input and produces the
estimation of how close agent is from the goal.
It is represented by h(n), and it calculates the cost of an optimal path between the pair of
states. The value of the heuristic function is always positive.
h(n) <= h*(n) { where h(n) is heuristic cost, h*(n) is the estimated cost. }
Hill Climbing Algorithm in Artificial Intelligence
Hill climbing algorithm is a local search algorithm which continuously moves in the direction of
increasing elevation/value to find the peak of the mountain or best solution to the problem. It
terminates when it reaches a peak value where no neighbor has a higher value.
Hill climbing algorithm is a technique which is used for optimizing the mathematical problems.
One of the widely discussed examples of Hill climbing algorithm is Traveling- salesman
Problem in which we need to minimize the distance traveled by the salesman.
It is also called greedy local search as it only looks to its good immediate neighbor state
and not beyond that.
A node of hill climbing algorithm has two components which are state and value.
Hill Climbing is mostly used when a good heuristic is available.
In this algorithm, we don't need to maintain and handle the search tree or graph as it only keeps a
single current state.
Features of Hill Climbing:
Following are some main features of Hill Climbing Algorithm:
Generate and Test variant: Hill Climbing is the variant of Generate and Test method. The Generate
and Test method produce feedback which helps to decide which direction to move in the search
space.
Greedy approach: Hill-climbing algorithm search moves in the direction which
optimizes the cost.
No backtracking: It does not backtrack the search space, as it does not remember the previous
states.
Different regions in the state space landscape:
Local Maximum: Local maximum is a state which is better than its neighbor states, but there is also
another state which is higher than it.
Global Maximum: Global maximum is the best possible state of state space landscape. It has the
highest value of objective function.
Current state: It is a state in a landscape diagram where an agent is currently present.
Flat local maximum: It is a flat space in the landscape where all the neighbor states of current states
have the same value.
Shoulder: It is a plateau region which has an uphill edge.
Types of Hill Climbing Algorithm:
Simple hill Climbing:
Steepest-Ascent hill-climbing:
Stochastic hill Climbing:
1. Simple Hill Climbing:
Simple hill climbing is the simplest way to implement a hill climbing algorithm. It only evaluates the
neighbor node state at a time and selects the first one which optimizes current cost and set it as a
current state. It only checks it's one successor state, and if it finds better than the current state, then
move else be in the same state. This algorithm has the following features:
Less time consuming
Less optimal solution and the solution is not guaranteed
Algorithm for Simple Hill Climbing:
Step 1: Evaluate the initial state, if it is goal state then return success and Stop.
Step 2: Loop Until a solution is found or there is no new operator left to apply.
Step 3: Select and apply an operator to the current state.
Step 4: Check new state:
a. If it is goal state, then return success and quit.
b. Else if it is better than the current state then assign new state as a current state.
c. Else if not better than the current state, then return to step2.
Step 5: Exit.
2. Steepest-Ascent hill climbing:
The steepest-Ascent algorithm is a variation of simple hill climbing algorithm. This algorithm examines
all the neighboring nodes of the current state and selects one neighbor node which is closest to the goal
state. This algorithm consumes more time as it searches for multiple neighbors
3. Stochastic hill climbing:
Stochastic hill climbing does not examine for all its neighbor before moving. Rather, this search
algorithm selects one neighbor node at random and decides whether to choose it as a current state or
examine another state.
Problems in Hill Climbing Algorithm:
1. Local Maximum: A local maximum is a peak state in the landscape which is better than each of its
neighboring states, but there is another state also present which is higher than the local maximum.
Solution: Backtracking technique can be a solution of the local maximum in state space landscape.
Create a list of the promising path so that the algorithm can backtrack the search space and explore other
paths as well.
2. Plateau: A plateau is the flat area of the search space in which all the neighbor states of the current
state contains the same value, because of this algorithm does not find any best direction to move. A
hill-climbing search might be lost in the plateau area.
Solution: The solution for the plateau is to take big steps or very little steps while searching, to solve the
problem. Randomly select a state which is far away from the current state so it is possible that the
algorithm could find non-plateau region.
3. Ridges: A ridge is a special form of the local maximum. It has an area which is higher than its
surrounding areas, but itself has a slope, and cannot be reached in a single move.
Solution: With the use of bidirectional search, or by moving in different directions, we can
improve this problem.
Advantages of Hill Climbing Algorithm
1. Simplicity and Ease of Implementation: Hill Climbing is a simple
and intuitive algorithm that is easy to understand and implement,
making it accessible for developers and researchers alike.
2. Versatility: The algorithm can be applied to a wide variety
of optimization problems, including those with large search spaces
and complex constraints. It's especially useful in areas such
as resource allocation, scheduling, and route planning.
3. Efficiency in Finding Local Optima: Hill Climbing is often highly
efficient at finding local optima, making it a suitable choice for
problems where a good solution is required quickly.
4. Customizability: The algorithm can be easily modified or extended
to incorporate additional heuristics or constraints, allowing for more
tailored optimization approaches.
Generate and Test Search
Generate and Test Search is a heuristic search technique based on
Depth First Search with Backtracking which guarantees to find a solution
if done systematically and there exists a solution.
In this technique, all the solutions are generated and tested for the best
solution. It ensures that the best solution is checked against all possible
generated solutions.
It is also known as British Museum Search Algorithm as it's like looking
for an exhibit at random or finding an object in the British Museum by
wandering randomly.
Algorithm
1. Generate a possible solution. For example, generating a
particular point in the problem space or generating a path for a
start state.
2. Test to see if this is a actual solution by comparing the chosen
point or the endpoint of the chosen path to the set of acceptable
goal states
3. If a solution is found, quit. Otherwise go to Step 1
Best First Search :-
Best First Search is a heuristic search algorithm that selects the most
promising node for expansion based on an evaluation function. It
prioritizes nodes in the search space using a heuristic value to estimate
their potential.
By iteratively choosing the most promising node, it aims to efficiently
navigate towards the goal state, making it particularly effective for
optimization problems.
Approach:
The idea is to use priority queue or heap to store the costs of edges that
have lowest evaluation function value and operate similar to BFS
algorithm.
Algorithm
Follow the below given steps:
1. Create an empty priority queue called 'open_list'
2. Add the start node to open_list with priority = h(start)
3. Create an empty set called 'closed'
4. While open_list is not empty:
a. Remove the node n with the lowest h(n) from ‘open_list’ to
‘closed’
b. If n is the goal:
Return the path from start to goal
c. Else, Add n to closed
d. For each neighbor m of n:
i. If m is not in closed and not in open_list:
Add m to open_list with priority = h(m)
5. If the goal was not found, return failure
We make use of two lists open and close , initally only node S is present in the open
list and closed is empty.
Open : [S]
Closed: []
For first iteration we pop node S and move it to the closed list and the neighbor
nodes are added to open
Open: [A,B]
Closed: [S]
For second iteration the heuristic value of nodes A and B are compared , since B
has lower heuristic it is poped and moved to the closed [Link] nodes of B
are pushed to the open list.
Open: [E,F,A]
Closed: [S,B]
For third iteration the heuristic values of E,F and A are compared and since F has
lowest heuristic it is added to the closed [Link] of F are added to the open
list.
Open: [I,G,E,A]
Closed: [S,B,F]
For the fourth iteration we have our target node in the open list hence we select that
and move it to the closed list.
Open: [I,E,A]
Closed: [S,B,F,G]
The path taken is S->B->F->G
Advantages:
Best first search can switch between BFS and DFS by gaining the advantages of both the
algorithms.
This algorithm is more efficient than BFS and DFS algorithms.
Disadvantages:
It can behave as an unguided depth-first search in the worst case scenario.
It can get stuck in a loop as DFS.
This algorithm is not optimal.
A* Search Algorithm:
A* search is the most commonly known form of best-first search. It uses heuristic function h(n), and cost to
reach the node n from the start state g(n). A* search algorithm finds the shortest path through the search
space using the heuristic function. This search algorithm expands less search tree and provides optimal
result faster.
In A* search algorithm, we use search heuristic as well as the cost to reach the node. Hence we can
combine both costs as following, and this sum is called as a fitness number
Problem Solution
Initialization: {(S, 5)}
Iteration1: {(S--> A, 4), (S-->G, 10)}
Iteration2: {(S--> A-->C, 4), (S--> A-->B, 7), (S-->G, 10)}
Iteration3: {(S--> A-->C--->G, 6), (S--> A-->C--->D, 11), (S--> A-->B, 7), (S-->G, 10)}
Iteration 4: It will give the final result, as S--->A--->C--->G it provides the optimal path with cost 6.
AO* Algorithm
The AO* method divides any given difficult problem into a smaller group of problems that
are then resolved using the AND , OR graph concept. AND OR graphs are specialized graphs
that are used in problems that can be divided into smaller problems.
The AND side of the graph represents a set of tasks that must be completed to achieve the
main goal, while the OR side of the graph represents different methods for accomplishing
the same main goal.
Working of AO* algorithm:
The evaluation function in AO* looks like this:
f(n) = g(n) + h(n)
f(n) = Actual cost + Estimated cost
here,
f(n) = The actual cost of traversal.
g(n) = the cost from the initial node to the current node.
h(n) = estimated cost from the current node to the goal state.
Example of AO* Algorithm with AND-OR Graph
In this example, we will demonstrate how the AO algorithm* works using
an AND-OR graph. Each node in the graph is assigned a heuristic value,
denoted as h(n), and the edge length is considered as 1.
Step 1: Initial Evaluation Using f(n) = g(n) + h(n)
Starting from node A, we use the evaluation function:
f(A -> B) = g(B) + h(B)
= 1 + 5 (g(n) = 1 is the default path cost)
= 6
For the path involving AND nodes (C and D):
f(A -> C + D) = g(C) + h(C) + g(D) + h(D)
= 1 + 2 + 1 + 4 (C & D are AND nodes)
= 8
Since f(A -> B) = 6 is smaller than f(A -> C + D) = 8, we select
the path A -> B.
Step 2: Explore Node B
Next, we explore node B, and calculate the values for nodes E and F:
f(B -> E) = g(E) + h(E)
= 1 + 7
= 8
f(B -> F) = g(F) + h(F)
= 1 + 9
= 10
So, by above calculation B⇢E path is chosen which is minimum path, i.e
f(B⇢E) because B's heuristic value is different from its actual value The
heuristic is updated and the minimum cost path is selected. The
minimum value in our situation is 8. Therefore, the heuristic for A must
be updated due to the change in B's heuristic.
So we need to calculate it again.
Thus, f(B -> E) = 8 is chosen as the optimal path. Since B’s heuristic
value differs from its actual cost, we update the heuristic for A.
f(A -> B) = g(B) + updated h(B)
= 1 + 8
= 9
Step 3: Compare and Explore Paths
Now, we compare f(A -> B) = 9 with f(A -> C + D) = 8. Since f(A -> C
+ D) is smaller, we explore this path and move to node C.
For node C:
f(C -> G) = g(G) + h(G)
= 1 + 3
= 4
f(C -> H + I) = g(H) + h(H) + g(I) + h(I)
= 1 + 0 + 1 + 0 (H & I are AND nodes)
= 2
f(C⇢H+I) is selected as the path with the lowest cost and the heuristic
is also left unchanged because it matches the actual cost. Paths H & I
are solved because the heuristic for those paths is 0, but
Path A⇢D needs to be calculated because it has an AND.
The path f(C -> H + I) = 2 is selected. Since the heuristic
for H and I matches the actual cost (both are 0), these paths are
considered solved. Next, we calculate the value for A -> D as it also has
an AND node.
For node D:
f(D -> J) = g(J) + h(J)
= 1 + 0
= 1
After updating the heuristic for D, we recalculate:
f(A -> C + D) = g(C) + h(C) + g(D) + h(D)
= 1 + 2 + 1 + 1
= 5
Now that f(A -> C + D) has the lowest cost, this becomes the solved
path, and the AND-OR graph is now fully resolved.
Aspect A Algorithm* AO Algorithm*
Search Type Best-first search Best-first search
Aspect A Algorithm* AO Algorithm*
Informed search using
Type of Search Informed search using heuristics
heuristics
Solution Does not guarantee an
Always gives the optimal solution
Optimality optimal solution
Path Stops exploring once a
Explores all possible paths
Exploration solution is found
Memory Usage Uses more memory Uses less memory
May go into an endless loop without Cannot go into an endless
Endless Loop
proper checks loop
Comparison between A* Algorithm and AO* algorithm
Space
Algorithm Time Complexity Remarks
Complexity
BFS (Breadth-First
O(b^d) O(b^d) Guarantees shortest path in unweighted graphs.
Search)
May go deep without finding solution; can be
DFS (Depth-First Search) O(b^d) O(b * d)
optimized with iterative deepening.
Generate and Test O(b^d) O(b * d) Brute-force; tests each state against goal.
Hill Climbing O(b^m) O(b * m) m = max depth; can get stuck in local maxima.
O(b^n)
Best First Search (depends on O(b^n) Not optimal; heavily depends on heuristic.
h(n))
O(b^d)
A* O(b^d) Optimal if h(n) is admissible and consistent.
(optimistic h(n))
O(b^m) Works on AND-OR graphs; complexity depends
AO* O(b * m)
(vary with structure) on subgraph size.
Constraint Satisfaction Problem in AI
In the fields of artificial intelligence (AI) and computer science, an issue has been
designated as a constraint satisfaction problem (CSP). It is described by a set of variables, a
domain for each variable, and a set of constraints that outline the possible combinations of
values for these variables.
Finding a variable assignment that meets all of the criteria is the main objective of solving a
CSP. The goal of constraint satisfaction problems is to identify values for a collection of
variables that satisfy a set of limitations or guidelines.
Variable: Variables are the items that need to be determined. The objects in a CSP that
must have values given to them in order to meet a specific set of constraints are known as
variables.
Boolean, integer, and category variables are just a few examples of a variety of variables.
The set of variables is denoted as {X1,X2,…..,Xn} and often takes values from columns that
are predefined and represent possible values they can assume.
Domain: Domains describe the variety of possible values that a variable might have. A
domain may be finite or limitless, depending on the problem. For example, in Sudoku, a
variable that represents a puzzle cell can have as its domain a range of values from 1 to 9.
It is denoted by “D”. Domains can be finite, like {1, 2, 3}, or continuous, such as real
numbers between 0 and 1.
Constraints: Constraints are the rules that control how variables interact with one
another. The ranges of acceptable values for variables are determined by constraints in a
CSP. The different types of constraints include unary constraints, binary constraints, and
higher-order constraints, to mention a few. For example, in a sudoku puzzle, the limitations
might be that only one of each number from 1 to 9 can appear in each row, column, and
3*3 boxes.