












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Artificial Intelligence is the study of how to make computers do things which at the moment people do better.
An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators.
Types of Agents :
Human agent: Has eyes, ears, and other organs for sensors, and hands, legs, mouth, and other body parts for actuators. Robotic agent: Has cameras and infrared range finders for sensors and various motors for actuators. Software agent: Receives keystrokes, file contents, and network packets as sensory inputs and acts on the environment by displaying on the screen, writing files, and sending network packets.
Generic agent: A general structure of an agent who interacts with the environment.
Rational Agent : For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has. A rational agent should be autonomous.
Characteristics of Intelligent Agent :
Internal Characteristics: Learning/Reasoning: Ability to learn from previous experience and adapt its behavior. Reactivity: Capable of reacting appropriately to influences or information from the environment. Autonomy: Has control over its actions and internal states, with minimal user intervention. Goal-oriented: Has well-defined goals and gradually influences the environment to achieve them.
External Characteristics:
Communication: Requires interaction with the environment, such as humans, other agents, and information sources.
Cooperation: Cooperation of several agents enables faster and better solutions for complex tasks. Mobility: May navigate within electronic communication networks. Character: May demonstrate external behavior with human-like characteristics.
Applications of AI :
Speech recognition Autonomous planning and scheduling Spam fighting Logistics planning Robotics
Machine Translation
Reflex Actions and Rationality : Reflex actions, such as flinching from a hot stove, can be considered rational due to evolutionary adaptation. They are also intelligent, as they involve reasoning and logic.
AI as Science and Engineering : AI is both a science and an engineering discipline. Observing and experimenting, which are core to science, allow us to study artificial intelligence. From the knowledge gained, we can engineer new systems that encompass what we have learned and may even be capable of learning themselves.
Agent Programs in Intelligent Systems :
Simple reflex agents Model-based reflex agents Goal-based agents
Utility-based agents
Problem Solving Agent : A problem-solving agent is a goal-based agent. It decides what to do by finding a sequence of actions that lead to desirable states. The agent can adopt a goal and aim to satisfy it. Goal formulation is the first step in problem-solving.
Goal Formulation and Problem Formulation :
Goal Formulation: Based on the current situation and the agent's performance measure, the first step in problem-solving is to formulate the goal. Problem Formulation: The process of deciding what actions and states to consider given a goal.
Steps in Simple Problem Solving Agent :
Goal Formulation Problem Formulation Search Search Algorithm
Time complexity: O(b^d), where b is the branching factor and d is the depth of the search tree. Space complexity: O(b^(d+1)), where b is the branching factor and d is the depth of the search tree.
Uninformed Search Techniques :
Breadth-First Search (BFS) Uniform-Cost Search Depth-First Search (DFS) Bidirectional Search
Power of Heuristic Search : Heuristic search uses problem-specific knowledge while searching in the state space. This helps to improve average search performance. Heuristic search uses evaluation functions that denote the relative desirability (goodness) of an expanding node set. This makes the search more efficient and faster. Heuristic search is powerful because it can solve large, hard problems in affordable times.
Advantages of Heuristic Function : The heuristic function ranks alternative paths in various search algorithms, at each branching step, based on the available information, so that a better path is chosen. The main advantage of the heuristic function is that it guides the search towards which state to explore next, making use of problem-specific knowledge and constraints to check the goodness of a state. This drastically reduces the required search time.
Reason for Hill Climbing Getting Stuck : Hill climbing often gets stuck in local maxima, which are states that are higher than each of their neighbor states but lower than the global maximum. This is a dead end, and the search procedure is wasted.
Admissible Heuristic Function : An admissible heuristic function is one that never overestimates the cost to reach the goal state. It means that h(n) gives the true cost to reach the goal state 'n'. An admissible heuristic function for the Traveling Salesman Problem (TSP) is: a. Minimum spanning tree b. Straight-line distance between cities
Minimum Assignment Problem
A local maximum is the peak that is higher than each of its neighboring states, but lower than the global maximum. In other words, a local maximum is a small hill on the surface whose peak is not as high as the main peak, which is the optimal solution. Hill climbing, a search technique, fails to find the optimal solution when it encounters a local maximum. Any small move from the local maximum also makes the solution worse, temporarily. At a local maximum, all the search procedure turns out to be wasted, as it is a dead end.
Ridges and plateaus in hill climbing can be avoided using methods like backtracking and making big jumps. Backtracking and making big jumps help to avoid plateaus, whereas the application of multiple rules helps to avoid the problem of ridges.
| Parameter | Blind Search | Heuristic Search | | --- | --- | --- | | Known as | Uninformed Search | Informed Search | | Using Knowledge | It doesn't use knowledge for the searching process. | It uses knowledge for the searching process. | | Performance | It finds a solution slowly compared to an informed search. | It finds a solution more quickly. | | Completion | It is always complete. | It may or may not be complete. | | Cost Factor | Cost is high. | Cost is low. | | Time | It consumes moderate time because of slow searching. | It consumes less time because of quick searching. | | Direction | No suggestion is given regarding the solution. | There is a direction given about the solution. | | Implementation | It is lengthier while implemented. | It is less lengthy while implemented. | | Efficiency | It is comparatively less efficient as the incurred cost is more, and the speed of finding the Breadth- First solution is slow. | It is more efficient as efficiency takes into account cost and performance. The incurred cost is less, and the speed of finding solutions is quick. | | Computational Requirements | Comparatively higher computational requirements. | Computational requirements are lessened. | | Size of Search Problems | Solving a massive search task is challenging. | Having a wide scope in terms of handling large search problems. | | Examples of Algorithms | Breadth-first search, Uniform cost search, Depth- first Search, Depth limited search, Iterative deepening search, Bi-Directional Search | Best-first search, Greedy search, Hill Climbing Algorithm |
CSPs are problems whose state and goal test conform to a standard structure and very simple representation. CSPs are defined using a set of variables and a set of constraints on those variables. The variables have some allowed values from a specified domain. For example, the Graph Coloring problem is a CSP.
In a game of chance, we can add an extra level of chance nodes in the game search tree. These nodes have successors which are the outcomes of the random element. The minimax algorithm uses the probability P attached with the chance node di based on this value. The successor function S(N,di) gives the moves from position N for outcome di.
Part B
Examples:
Breadth-First Search (BFS) Depth-First Search (DFS) Uniform-Cost Search (UCS) Depth-Limited Search Iterative Deepening Search
Example for Breadth-First Search :
The 8-puzzle problem is an example where breadth-first search would work better than depth-first search. This is because the depth-first search can get stuck in long, fruitless paths, while the breadth-first search systematically explores all possible paths, ensuring that the optimal solution is found.
Steepest Hill Climbing Algorithm :
The steepest hill climbing algorithm starts at a given initial state and repeatedly moves to the neighboring state that has the highest value (i.e., the steepest uphill move). The algorithm continues this process until it reaches a local maximum, where all neighboring states have a lower value.
A Search Algorithm* :
A* is an informed search algorithm that uses a heuristic function to estimate the cost of reaching the goal from a given state. The algorithm selects the node with the lowest estimated total cost (the sum of the actual cost from the initial state to the current node and the estimated cost from the current node to the goal) and expands it.
Proof of Optimality: If the heuristic function is admissible (i.e., it never overestimates the actual cost to the goal), then A* is guaranteed to find the optimal solution.
AO Algorithm* :
AO* is an algorithm for solving AND-OR graphs, which are used to represent problems with AND and OR nodes. The algorithm uses a heuristic function to estimate the cost of reaching the goal from a given state.
Limitations:
The algorithm may not terminate if the AND-OR graph contains cycles. The algorithm may not find the optimal solution if the heuristic function is not admissible.
Nature of Heuristics :
Heuristics are rules of thumb or educated guesses that guide the search process towards the goal. They provide an estimate of the
cost or distance to the goal, which can be used to direct the search. The accuracy of the heuristic function has a significant effect on the performance of the search algorithm. If the heuristic function is admissible (i.e., it never overestimates the actual cost to the goal), the search algorithm is guaranteed to find the optimal solution.
Hill Climbing Search Techniques :
Local Hill Climbing: Moves to the neighboring state with the highest value. Steepest-Ascent Hill Climbing: Moves to the neighboring state with the highest value, even if it is lower than the current state. Random-Restart Hill Climbing: Restarts the search from a random initial state if the algorithm gets stuck in a local maximum. Stochastic Hill Climbing: Randomly selects a neighboring state, with a higher probability of selecting states with higher values.
Constraint Satisfaction Problem (CSP) and Crypt-arithmetic Problem :
CSP Algorithm for Solving Crypt-arithmetic Problem: Define the variables (letters) and their domains (digits 0-9). Define the constraints (e.g., no leading zeros, unique digits). Use a backtracking search algorithm to assign values to the variables while satisfying the constraints. If a solution is found, return it; otherwise, report that no solution exists.
Crypt-arithmetic Problem Solution :
The crypt-arithmetic problem can be solved using the CSP algorithm described in the previous question.
Alpha-Beta Pruning and Minimax Algorithm :
Alpha-Beta Pruning: An optimization technique for the Minimax algorithm that can significantly reduce the number of nodes that need to be evaluated in the game tree. Minimax Algorithm: A decision-making algorithm used in game theory to find the optimal move for a player in a two-player game. It assumes that the opponent will also play optimally. Example: In a game of tic-tac-toe, the Minimax algorithm would evaluate all possible moves and choose the one that maximizes the player's chances of winning, assuming the opponent also plays optimally.
Water Jug Problem Solution :
Operators: Fill the 4-gallon jug from the pump. Fill the 3-gallon jug from the pump.
The full joint probability distribution specifies the probability of each complete assignment of values to random variables. It is usually too large to create or use in its explicit form, but when it is available, it can be used to answer queries simply by adding up entries for the possible worlds corresponding to the query propositions.
Bayes' theorem, also known as Bayes' rule, Bayes' law, or Bayesian reasoning, determines the probability of an event with uncertain knowledge. It is a way to calculate the value of P(B|A) with the knowledge of P(A| B). Bayes' theorem allows updating the probability prediction of an event by observing new information of the real world. Example: If cancer corresponds to one's age, then by using Bayes' theorem, we can determine the probability of cancer more accurately with the help of age. P(A/B) = [P(A)*P(B/A)]/P(B)
A Bayesian network is a probabilistic graphical model that represents a set of variables and their conditional dependencies using a directed acyclic graph (DAG). It is also called a Bayes network, belief network, decision network, or Bayesian model. Bayesian networks are probabilistic because they are built from a probability distribution and use probability theory for prediction and anomaly detection. The full specification of a Bayesian network includes: Each node corresponds to a random variable, which may be discrete or continuous. A set of directed links or arrows connects pairs of nodes. If there is an arrow from node X to node Y, X is said to be a parent of Y. Each node Xi has a conditional probability distribution P(Xi| Parents(Xi)) that quantifies the effect of the parents on the node.
Part B
Exact Inference in Bayesian Networks :
Exact inference in Bayesian networks involves computing the posterior probability of a set of query variables given some evidence. This can be done using algorithms like variable elimination or junction tree.
Variable Elimination Algorithm for Bayesian Networks :
The variable elimination algorithm works by iteratively eliminating variables from the network, computing the necessary intermediate
probability distributions, and finally computing the desired posterior probability.
The algorithm works by first identifying the variables to be eliminated, then computing the necessary intermediate probability distributions, and finally computing the desired posterior probability.
Uncertain Knowledge, Prior Probability, and Conditional Probability :
Uncertain knowledge refers to the lack of complete information about the state of the world. Prior probability is the probability of an event before any evidence is taken into account. Conditional probability is the probability of an event given that another event has occurred.
Bayes' theorem is useful for decision making under uncertainty because it allows us to update our beliefs about the probability of an event based on new evidence.
Approximate Inference in Bayesian Networks :
Approximate inference techniques are used when exact inference is computationally intractable, such as in large or complex Bayesian networks.
Examples of approximate inference methods include Markov Chain Monte Carlo (MCMC) sampling, variational inference, and loopy belief propagation.
Applying Bayes' Rule to Tackle Uncertain Knowledge :
Bayes' rule can be used to update the probability of a hypothesis or event based on new evidence. This allows us to reason about uncertain knowledge and make more informed decisions.
The formula for Bayes' rule is: P(H|E) = (P(E|H) * P(H)) / P(E), where H is the hypothesis and E is the evidence.
Bayesian Theory and Bayesian Networks :
Bayesian theory provides a principled approach to reasoning under uncertainty, using probability distributions and Bayes' theorem.
Bayesian networks are a type of probabilistic graphical model that represent the conditional dependencies between variables in a compact and efficient way.
Bayesian Statistics and Reasoning Under Uncertainty :
Bayesian statistics provides a framework for reasoning under various kinds of uncertainty, such as parameter uncertainty, model uncertainty, and decision uncertainty.
The Different Techniques in Machine
Learning
In supervised learning, the algorithm is provided with labeled data, and the goal is to learn a function that maps the input to the output.
Unsupervised learning algorithms are used to find patterns and structure in data without any labeled outputs. The goal is to discover hidden patterns or groupings in the data.
Learning to learn, or meta-learning, is a field of machine learning that focuses on developing algorithms and systems that can efficiently acquire new knowledge and skills.
The Three Stages of Building Hypotheses or
Models in Machine Learning
This stage involves selecting an appropriate machine learning algorithm and training the model on the available data.
In this stage, the trained model is evaluated on a separate test dataset to assess its performance and generalization capabilities.
Once the model has been built and tested, it can be applied to new, unseen data to make predictions or decisions.
Supervised Learning Approach
The standard approach to supervised learning is to split the dataset into a training set and a test set. The training set is used to build the model, while the test set is used to evaluate its performance on unseen data.
Training Set and Test Set
The training set is the set of examples used to train the machine learning model, while the test set is the set of examples used to evaluate the accuracy of the trained model.
Artificial Learning vs. Machine Learning
Artificial Intelligence (AI) is a broader field that encompasses machine learning, as well as other aspects such as knowledge representation, natural language processing, planning, and robotics.
Machine Learning is a specific subset of AI that focuses on designing and developing algorithms that can learn from and make predictions on data.
Advantages of Naive Bayes
Naive Bayes classifiers converge quicker than discriminative models like logistic regression, requiring less training data. The main advantage of Naive Bayes is that it cannot learn interactions between features.
Supervised vs. Unsupervised Learning
The key difference between supervised and unsupervised learning is that supervised learning requires labeled data, while unsupervised learning does not.
Supervised learning techniques need labeled data to train the model, such as in classification problems where the data is labeled into specific categories.
Unsupervised learning does not require any labeled dataset. The algorithm tries to find patterns and structure in the data without any predefined labels or targets.
Linear Regression
Linear regression is a technique for modeling the relationship between a dependent variable (the response) and one or more independent variables (the predictors). In simple linear regression, there is one independent variable, while in multiple linear regression, there are multiple independent variables.
Principle of Least Squares
The Principle of Least Squares states that the most probable values of a system of unknown quantities, upon which observations have been made, are obtained by making the sum of the squares of the errors a minimum.
Advantages of Bayesian Linear Regression
The main advantage of Bayesian linear regression is that it recovers the whole range of inferential solutions, rather than just a point estimate and a confidence interval as in classical regression.
Bayesian Linear Regression
In Bayesian linear regression, the mean of one parameter is characterized by a weighted sum of other variables. This conditional modeling aims to determine the prior distribution of the regressors and other variables, which eventually permits the out-of-sample forecasting of the regress, conditional on observations of the regression coefficients.
Advantages of Bayesian Regression
Extremely efficient when the dataset is tiny. Well-suited for online learning, as Bayesian Regression can be used without having to save data. The Bayesian technique is strong mathematically and does not require additional prior knowledge of the dataset.
Disadvantages of Bayesian Regression
The model's inference process can take some time. The Bayesian approach is not as effective if there is a lot of data available, and the regular probability approach can do the task more efficiently.
Types of Classification Models
Naive Bayes K-Nearest Neighbors (KNN) Decision Trees Support Vector Machines (SVMs)
Random Forest vs. SVM
Random Forest is better suited for multi-class problems, as it can handle them intrinsically, while SVM requires a one-vs-rest approach, which is less scalable and more memory-intensive.
Linear Regression vs. Random Forest
Regression
Multiple linear regression can be superior to random forest regression, as linear regression makes fewer assumptions about the underlying data.
Linear vs. Tree-based Models
If there is a high non-linearity and complex relationship between the dependent and independent variables, a tree-based model will outperform a classical regression method. Tree-based models are also easier to explain to people.
Linear Discriminant Analysis
Linear Discriminant Analysis is a simple and effective classification method, with many extensions and variations available.
Discriminative vs. Generative Models
Discriminative models, such as SVMs, estimate the conditional probability P(y|x), while generative models estimate the probability of each class and the probability of the observation given the class.
Decision Trees
Decision trees are a type of supervised learning algorithm that creates a tree-like model of decisions and their possible consequences. They can handle both categorical and numerical data.
Pruning in Decision Trees
Pruning is a technique used to reduce the size of decision trees, which can improve predictive accuracy by reducing overfitting. Pruning can be done in a top-down or bottom-up fashion, and a popular algorithm is reduced error pruning.
Random Forests vs. Large Decision Trees
Random forests, which are an ensemble of many small decision trees, are generally more accurate, robust, and less prone to overfitting than a single large decision tree.
Gaussian Mixture Models can discover complex patterns and group them into cohesive, homogeneous components that are close representatives of real patterns within the data set.
Expectation maximization provides an iterative solution to maximum likelihood estimation with latent variables. Gaussian mixture models are an approach to density estimation where the parameters of the distributions are fit using the expectation-maximization algorithm.
Unsupervised Learning Algorithms
K-Means clustering is an unsupervised learning algorithm. There is no labeled data for this clustering, unlike in supervised learning. K-Means performs the division of objects into clusters that share similarities and are dissimilar to the objects belonging to another cluster. The term 'K' is a number.
KNN is a supervised learning algorithm mainly used for classification problems, whereas K-Means (aka K-means clustering) is an unsupervised learning algorithm. K in K-Means refers to the number of clusters, whereas K in KNN is the number of nearest neighbors (based on the chosen distance metric).
The EM algorithm is used to find (local) maximum likelihood parameters of a statistical model in cases where the equations cannot be solved directly. Typically these models involve latent variables in addition to unknown parameters and known data observations.
Gaussian processes are a powerful algorithm for both regression and classification. Their greatest practical advantage is that they can give a reliable estimate of their own uncertainty.
Some examples of unsupervised learning algorithms include K-Means Clustering, Principal Component Analysis, and Hierarchical Clustering.
The two steps of the EM algorithm are: 1. E-step: perform probabilistic assignments of each data point to some class based on the current hypothesis h for the distributional class parameters. 2. M-step: update the hypothesis h for the distributional class parameters based on the new data assignments.
The principle of maximum likelihood is a method of obtaining the optimum values of the parameters that define a model. And while doing so, you increase the likelihood of your model reaching the "true" model.
Neural Networks
A Perceptron is the simplest possible Neural Network, an Artificial Neuron. Multilayer perceptrons (MLP) are neural networks capable of handling both linearly separable and non-linearly separable data.
The Sigmoid Activation Function is commonly used in Multilayer Perceptron Neural Networks. In MLP and CNN neural network models, ReLU is the default activation function for hidden layers. In RNN neural network models, the sigmoid or tanh function is used for hidden layers.
Backpropagation is the training algorithm used in Multilayer Perceptrons. Stochastic Gradient Descent is an optimization technique used in the training of neural networks, which is faster and more suitable for large-scale datasets compared to regular Gradient Descent.
The vanishing gradient problem is caused by the derivative of the activation function used to create the neural network. The simplest solution is to replace the activation function, such as using ReLU instead of sigmoid.
The main advantage of using the ReLU function over other activation functions is that it does not activate all the neurons at the same time. However, a key limitation is the "dying ReLU" problem, where large weight updates can mean that the summed input to the activation function is always negative, causing the node to output an activation value of 0.0 forever.