You are on page 1of 12

CPSC-6560 Fa22 FINAL

Name: __________________________________________

1. Explain State Spaces and how they are used in problem solving.

State Space: The set of all feasible states in which challenge might be called as the
state space. Given specified contexts, it is generally possible to relocate from one state
to another.

This provides for the development of a graph where every other vertex represents a
state and where, if a transition between the first and the second vertex is possible, we
draw a directed edges from one vertex to the other.
This is applied in competitive made more effective where it is necessary to figure out the
least money, the shortest path, etc., to go from 1 state to the other. The solution is
determined by traversing the state space search graph. For brute force issues, in which
every possible state must typically be examined by the program, state space search
graphs are often the most effective solution.
Here's an instance: What is the least amount of steps needed to organize a stack of n
number, which each represents the size of a pancake, in such a manner that the
dimensions of the pancakes are increasing from the top? (A move includes "flipping" the
top k pancakes; k varies from 1 to n.) 

In this case, the state refers to the way the pancakes are stacked. Flipping the top
pancake, the top 2 pancakes, etc. will permit you to quit the current state and start
another one.
CPSC-6560 Fa22 FINAL

2. Explain the use of Agents in AI. Discuss their use as individual and

elementary elements of a system.

Anything that can be termed an agent is:


1. Utilizing sensors to observe its environment and
2. Actuators to implement adjustments to it
A map between both the percept sequential manner history of anything and
everything an agent since has perceived—to an action is known as an agent
function.
A map between the percept sequences -the history of everything an agent has
always perceived—to an action is termed an agent function.

Agent = Architecture +Agent Program

Types of Agents
Agents can be sorted basically into 5 types based on their action and commands
they perform
 Simple Reflex Agents- it ignore the percept action history of the previous action
and only work based on current command rule, where it work based on current
condition based on the same it perform the action. If True action is performed
else action is ignored as condition rule. Issue with limited intelligence and no
knowledge of non-perceptional parts of the state. Also, if any changes in the
environment then the changes in rules need to update too accordingly based on
the same.
 Model-Based Reflex Agents- partially observable to the environments, by the
use of the model of the world. It works using the rule whose condition matching
to the current situation. This kind of agent keep track of the internal agents
where adjustments and changes are done to every individual percept and
situation in the percept history, along with the current state.
 Goal-Based Agents- This agents take actions based on how far they are
currently from their target/goal which need to be reached with reduced time
frame. Every action of the agent is to reduce its distance from the goal. This
allows the agent a way to choose among multiple possibilities.
 Utility-Based Agents- are those developed with their end objectives in mind as
building blocks. This are used to decide which option is best when there are
multiple reasonable alternatives. Based on a preference (utility) for each state,
they choose appropriate actions to do.
 Learning Agent- is a unique type of agent that can learn from its past
experiences and it start with basic knowledge and then adapts accordingly
through the learning.
CPSC-6560 Fa22 FINAL

3. Explain in general how searches can be utilized to solve problems. Then,

give specific explanations using Breadth-First Search, Depth-First Search,

and Heuristic Search.

Search is the process of finding for a set of steps that will lead you where you would like
to go. An action sequence describing the solution is delivered by a search algorithm in
reaction to an input problem.
A problem can be basically defined and sorted in 5 steps:
1. Initial state
2. Possible actions
3. Transition model
4. Goal test
5. Path cost function
Based on the search problems, we can classify the search algorithm as

1. Uninformed search
2. Informed search

a. Breadth-First Search (BFS): It is one the of the most common search strategies.
It start from the node and then go for the next node. It follows the principle of first-
in first-out strategy as it gives the shortest path to achieving the solution. BFS is
used where given space is small and space complexity is not considered much.
b. Depth-first Search (DFS): This uses Last-in First-out strategy which is hence
used in stack. DFS uses backtracking. That is it starts from the initial state and
explores each path to its greatest depth before it moves to next path.
c. Heuristic Search: also called as informed search algorithms. Informative search
algorithms, as contrast to uninformed search algorithms, need knowledge such
as the distance from the target, the steps to reach the goal, and the cost of the
paths, allowing this algorithm more efficient. In this case, the heuristic function
can be used to obtain the desired state. To reach the objective state at the lowest
cost, the heuristic function is employed. How near a state is to the objective is
estimated by this function. Some of the types of Heuristic Search algorithms are:
Greedy best- first search algorithm.
A* Search algorithm
CPSC-6560 Fa22 FINAL

4. Describe problem solving using reasoning with constraints. Be sure to

distinguish between hard and soft constraints. Give a practical example

according to your explanation.

The components of a constraint satisfaction problem (CSP) include

A set of constraints, a domain for each variable, and a number of variables.


Each variable in a finite CSP has a finite domain and a finite collection of variables.
Despite the fact that some of the approaches discussed in this chapter are intended for
infinite or even continuous domains, others only work for finite CSPs.
A hard constraint in an optimization method is a requirement that must be fulfilled by
every feasible model solution. A soft constraint, on the other hand, cannot be ignored,
while doing so resulting in a liability for the optimal solution (often, the greater the
amount by which the constraint is violated, the greater the penalty). Hence, evaluating
constraints that have accompanying penalty terms in the optimization problem is a good
place to begin when looking at soft constraints in models.

For example, suppose you are a manager, and you are planning one of your salaried
employee’s schedule for the next week. Suppose that x≥0 is the total number of hours
the employee is to work Monday through Friday, and y≥0 is the total number of hours
the employee is to work on Saturday and Sunday.
A hard constraint in this scenario might be - “by her contract, this salaried employee is
allowed to work no more than 40 hours per week”: x+y≤40. A similar soft constraint
might be - “this employee should work no more than 40 hours per week, but must be
paid £150 per hour for every hour she works over 40”: x+y−z≤40, where z≥0 is the
number of hours over 40 the employee is scheduled to work. Then, in the model’s
objective function, you would include a term “+150z” (assuming some type of cost
minimization objective).
CPSC-6560 Fa22 FINAL

5. Explain the approach to problem solving using Bayes’ Theorem and why is

it useful.

Bayes Theorem is a mathematic model, based in statistics and probability that


aims to calculate the probability of one scenario based on its relationship with
another scenario.
Largely defined, conditional probability is the likelihood of an event transpiring,
due to its association with another scenario. For instance, your likelihood of
playing a round of golf within four hours depends on the time of previous rounds
played, the time of day, the course you're playing, how many other people you're
golfing with, and where and how often you hit your golf ball.
By adding fresh data, Bayes' Theorem enables you to revise the expected odds
of an occurrence.
It is frequently used in finance to compute or update risk assessments.
The theorem is now a practical component of machine learning implementation.
Due of the extensive computation needed to carry out the theorem's
transactions, it was ignored for two centuries.

The most popular and pervasive formula used for Bayes' Theorem is as follows:

P(A ∣ B) = P(B ∣ A)P(A) / P(B)

For instance, consider drawing a single card from a complete deck of 52 cards.

The chances to get a king is four divided by 52, which means 1/13 or a total of
7.69%. Note that we have 4 kings in the same deck. For instance it is revealed
that the card which is selected is a face card. The probability chances of the
selected card is a king, given it is a face card then it is four divided by 12, or
approximately 33.3%, as we have12 face cards in a deck.
CPSC-6560 Fa22 FINAL

6. Describe the issues faced with Knowledge Representation.

Knowledge representation's main objective is to make it easier to draw inferences from knowledge.

There are numerous difficulties with KR approaches. The following explains a few of these.

1. Important Attribute: Are there any properties of objects that are so fundamental and
important that they appear in practically all issue domains?

There are two credited terms of wide significance: "instance" and "isa." Due to the fact that they
enable property inheritance, these traits are very crucial.

2. Relations between properties: Are there really any preparedness between the attributes of an
object?
The entities that we represent are the qualities that we utilize to characterize things.
Independent of the clear information they encode, the relationship between an object's
characteristics may have properties like:
a. Inverse: This is about consistency check, while a value is added to one attribute. The
entities are related to each other in many different ways and may effect each other.

b. Existence in an isa hierarchy: This is about generalization-specification, like, classes of


objects and specialized subsets of those classes, there are attributes and specialization of
attributes. These generalization-specialization relationships are important for attributes
because they support inheritance. For example, the attribute weight is a specialization of
general attribute physical-size which is, in turn, a specialization of physical-attribute.

c. Technique for reasoning about values: This is about reasoning values of attributes not
given explicitly. These values are mostly undeniable facts about the attributes. Several
kinds of information are used in reasoning, like, height: must be in a unit of length, Age:
of a person cannot be greater than the age of person’s parents. The values are often
specified when a knowledge base is created.

d. Single valued attributes: This is about a specific attribute that is guaranteed to take a
unique value. For example, a baseball player can at time have only a single height and be
a member of only one team.

3. Finding Right structure: Given a large amount of knowledge stored in a database, how can
relevant parts be accessed when they are needed? This is about access to right structure for
describing a particular situation. This requires, selecting an initial structure and then revising
the choice. While doing so, it is necessary to solve following problems:
a. How to perform an initial selection of the most appropriate structure.
b. How to find a better structure if the one chosen initially turns out not to be
appropriate.
c. What to do if none of the available structures is appropriate.
d. When to create and remember a new structure.
There is no-good, general-purpose method for solving all these problems. Some knowledge
representation techniques solve some of these issues.
CPSC-6560 Fa22 FINAL
CPSC-6560 Fa22 FINAL

7. Contrast the planning approach when dealing with data certainty verses

The organizational aim will be to sustain in the market, and to increase the profitability status of the company. The company's main target will be to run the
business smoothly. All the important decisions will be taken by the top management, and it will be properly communicated to the employees for smooth
flow of business.
The business environment is becoming more competitive, and the business needs to compete with each other. For this, the business needs to compare with
one another to know about their growth rate in the competitive market. It will give a proper guideline for the organization to be on the growth path.
Explanation :
Planning approach is used in the organization to plan for the current and future process of the business. A business process should be formally planned, and
executed, then only the business can be successful one. The planning will be made with the help of available data and resources. Planning will help in
mitigating the risks that can arise in future for the organization, there are four approaches to planning they are as follows,
• Reactive- It will refer to the past data to have a view over the future business process. The past data will be utilized to plan the future of the organization.
• Inactive- This planning will help in attempting to preserve the present scenario. It will be helpful for both past and future business process of the
organization. It will analyze the present scenario whether the scenario is more hard than past or not. If the present scenario is more problematic, then it will
be depicted that the future will be more problematic.
• Preactive- In this planning, the planning will be made by predicting the future of the business process. After predicting the future, the planning will be
implemented.
• Proactive- It will involve designing the own future of the organization. The future of the organization will be created through planning with the available
resources and data.

Planning approach with data certainty:


In this scenario, the management will know about the data, and the current scenario they are dealing with. The person who are making the planning will
know about the consequences of each alternative. Each strategy or course of action that the person will make will know about the consequences too. Hence
it will help the person to make sound strategy or planning. It will help in maximizing the usage of resources, and will help creating better objectives, and
strategies. Since the manager will know about the consequences of risks, the person will make plan by creating strategies to mitigate the risks that will arise
for the organization.

Planning approach with data uncertainty:


If there is no certain data available, the planning will be vague, and will not have a constructive solution. The planning can be done only with
approximation of past events, and past data. The person making the decision will not know about the consequences of the planning that he/she makes. The
decision making will be very complicated since the past events and data will be unknown. There will be many uncontrollable events, and variables.

Final Answer
The organizational aim will be to sustain in the market, and to increase the profitability status of the company. The company's main target will be to run the
business smoothly. All the important decisions will be taken by the top management, and it will be properly communicated to the employees for smooth
flow of business.

The business environment is becoming more competitive, and the business needs to compete with each other. For this, the business needs to compare with
one another to know about their growth rate in the competitive market. It will give a proper guideline for the organization to be on the growth path.

Planning approach is used in the organization to plan for the current and future process of the business. A business process should be formally planned, and
executed, then only the business can be successful one. The planning will be made with the help of available data and resources. Planning will help in
mitigating the risks that can arise in future for the organization, there are four approaches to planning they are as follows,

• Reactive- It will refer to the past data to have a view over the future business process. The past data will be utilized to plan the future of the organization.

• Inactive- This planning will help in attempting to preserve the present scenario. It will be helpful for both past and future business process of the
organization. It will analyze the present scenario whether the scenario is more hard than past or not. If the present scenario is more problematic, then it will
be depicted that the future will be more problematic.

• Preactive- In this planning, the planning will be made by predicting the future of the business process. After predicting the future, the planning will be
implemented.

• Proactive- It will involve designing the own future of the organization. The future of the organization will be created through planning with the available
resources and data.

uncertainty.

8. Describe two methods of performing reasoning with uncertainty.

1. Naïve Bayes:
The oldest method applied in uncertain reasoning is probability theory. Probabilistic reasoning concentrates on
computing the posterior probability of the variables of interest given the available evidence.

In medicine, for example, the evidence consists of symptoms, signs and laboratory tests. The doctor (or the person who
CPSC-6560 Fa22 FINAL

9. Briefly describe three methods that support supervised machine learning.

1. Linear Regression: It is a statistical method that is used for predictive analysis. Linear regression makes predictions for continuous/real
or numeric variables such as sales, salary, age, product price, etc.

Linear regression algorithm shows a linear relationship between a dependent (y) and one or more independent (y) variables, hence
called as linear regression. Since linear regression shows the linear relationship, which means it finds how the value of the dependent
variable is changing according to the value of the independent variable.

The linear regression model provides a sloped straight line representing the relationship between the variables.
There are some assumptions that are assumed in linear regression, they are:
1. Linear relationship between the features and target
2. Small or no multicollinearity between the features: It is difficult to determine which predictor variable is affecting the target
variable and which is not. So, the model assumes either little or no multicollinearity between the features or independent
variables.
3. Homoscedasticity Assumption: Homoscedasticity is a situation when the error term is the same for all the values of independent
variables. With homoscedasticity, there should be no clear pattern distribution of data in the scatter plot.
4. Normal distribution of error terms: Linear regression assumes that the error term should follow the normal distribution pattern. If
error terms are not normally distributed, then confidence intervals will become either too wide or too narrow, which may cause
difficulties in finding coefficients.
5. No autocorrelations: The linear regression model assumes no autocorrelation in error terms. If there will be any correlation in the
error term, then it will drastically reduce the accuracy of the model. Autocorrelation usually occurs if there is a dependency
between residual errors.

2. Decision Tree is the most powerful and popular tool for classification and prediction. A Decision tree is a flowchart-like tree structure,
where each internal node denotes a test on an attribute, each branch represents an outcome of the test, and each leaf node (terminal
node) holds a class label.
Strengths and Weaknesses of the Decision Tree approach
The strengths of decision tree methods are:
a. Decision trees are able to generate understandable rules.
b. Decision trees perform classification without requiring much computation.
c. Decision trees are able to handle both continuous and categorical variables.
d. Decision trees provide a clear indication of which fields are most important for prediction or classification.
The weaknesses of decision tree methods :
a. Decision trees are less appropriate for estimation tasks where the goal is to predict the value of a continuous attribute.
b. Decision trees are prone to errors in classification problems with many classes and a relatively small number of training
examples.
c. Decision tree can be computationally expensive to train. The process of growing a decision tree is computationally
expensive. At each node, each candidate splitting field must be sorted before its best split can be found. In some
algorithms, combinations of fields are used and a search must be made for optimal combining weights. Pruning algorithms
can also be expensive since many candidate sub-trees must be formed and compared.
3. Random Forest: It can be used for both Classification and Regression problems in ML. It is based on the concept of ensemble learning,
which is a process of combining multiple classifiers to solve a complex problem and to improve the performance of the model. As the
name suggests, "Random Forest is a classifier that contains a number of decision trees on various subsets of the given dataset and
takes the average to improve the predictive accuracy of that dataset." Instead of relying on one decision tree, the random forest takes
the prediction from each tree and based on the majority votes of predictions, and it predicts the final output. The greater number of
trees in the forest leads to higher accuracy and prevents the problem of overfitting.
In random forest we assume that there should be some actual values in the feature variable of the dataset so that the classifier can
predict accurate results rather than a guessed result. And the predictions from each tree must have very low correlations. We use
Random Forest because 1.It takes less training time as compared to other algorithms. 2.It predicts output with high accuracy, even for
the large dataset it runs efficiently. 3.It can also maintain accuracy when a large proportion of data is missing.
CPSC-6560 Fa22 FINAL

10. Explain the difference between stochastic and deterministic models.

Deterministic
Deterministic (from determinism, which means lack of free will) is the opposite of random.
A Deterministic Model allows you to calculate a future event exactly, without the involvement of randomness. If something is
deterministic, you have all of the data necessary to predict (determine) the outcome with certainty.
Deterministic models are typically used by product providers to illustrate statutory future projections of long-term investments (such as
pensions). If the same projection rates are used, these forecasts can then be used to compare different providers, particularly around
charges.
However, deterministic models do not make any allowance for the fact that markets are complex, irregular and ever-changing. As such,
any model that is based on long-term average returns can be easily upset by the unexpected implications of sequencing risk, which can
have a huge impact on a retiree’s income and lifestyle in retirement.
Pros
1. Deterministic models have the benefit of simplicity. They rely on single assumptions about long-term average returns and
inflation.
2. Deterministic is easier to understand and hence may be more appropriate for some customers.
Cons
1. Cash flow modelling tools that use deterministic or over-simplistic stochastic projections are fundamentally flawed when
making financial planning decisions because they are unable to consider ongoing variables that will affect the plan over time.
2. Deterministic tools tend to overestimate the level of sustainable income (on a like for like basis) because they are unable to
take into account market volatility, which causes ‘pound cost ravaging' and sequencing risk, both of which have a significant
negative effect on sustainable income.
3. The choice of future increase assumption is critical and puts the responsibility of the final outcome on the provider of the tool
All of which renders deterministic models inadequate and potentially misleading.
Stochastic
Having a random probability distribution or pattern that may be analysed statistically but may not be predicted precisely.
A Stochastic Model has the capacity to handle uncertainties in the inputs applied. Stochastic models possess some inherent randomness -
the same set of parameter values and initial conditions will lead to an ensemble of different outputs.
Pros
1. Stochastic models can reflect real-world economic scenarios that provide a range of possible outcomes your customer may
experience and the relative likelihood of each.
2. By running thousands of calculations, using many different estimates of future economic conditions, stochastic models predict
a range of possible future investment results showing the potential upside and downsides of each.
3. A stochastic model also has the ability to avoid the significant shortfalls inherent in deterministic models, which gives it the
edge.

Cons
1. Managing drawdown effectively and choosing suitable investment strategies requires the ability to model investment risk and
return realistically. The problem is that nearly all strategies and solutions are currently designed using an assumed fixed rate of
investment return throughout retirement. This is obviously unrealistic and ignores the important effect that the sequence of
returns and volatility has on drawdown outcomes.
2. The problem of ignoring specific risk factors not only applies with deterministic modellers, but also with a commonly used
type of simple stochastic model - mean, variance, co-variance (MVC) models. For instance, MVC models provide time-
independent forecasts, which means that they ignore the fact that specific investment risks change over time depending on the
combination of assets held within the customer’s portfolio.
CPSC-6560 Fa22 FINAL

11.How is Bayes’ Theorem useful to and applied in A.I.?

Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian reasoning, which determines the probability of
an event with uncertain knowledge.

In probability theory, it relates the conditional probability and marginal probabilities of two random events.

Bayes' theorem was named after the British mathematician Thomas Bayes. The Bayesian inference is an application
of Bayes' theorem, which is fundamental to Bayesian statistics.

It is a way to calculate the value of P(B|A) with the knowledge of P(A|B).


The above equation (a) is called as Bayes' rule or Bayes' theorem. This equation is basic of most modern AI systems
for probabilistic inference.

It shows the simple relationship between joint and conditional probabilities. Here,

P(A|B) is known as posterior, which we need to calculate, and it will be read as Probability of hypothesis A when we
have occurred an evidence B.

P(B|A) is called the likelihood, in which we consider that hypothesis is true, then we calculate the probability of
evidence.

P(A) is called the prior probability, probability of hypothesis before considering the evidence

P(B) is called marginal probability, pure probability of an evidence.

In the equation (a), in general, we can write P (B) = P(A)*P(B|Ai), hence the Bayes' rule can be written as:

Following are some applications of Bayes' theorem:

It is used to calculate the next step of the robot when the already executed step is given.
Bayes' theorem is helpful in weather forecasting.
It can solve the Monty Hall problem.
CPSC-6560 Fa22 FINAL

12. What is the difference between A.I. and Machine Learning?

1. Artificial intelligence is a technology which enables a machine to simulate human behavior


Machine learning is a subset of AI which allows a machine to automatically learn from past
data without programming explicitly.
2. The goal of AI is to make a smart computer system like humans to solve complex problems.
The goal of ML is to allow machines to learn from data so that they can give accurate output.
3. In AI, we make intelligent systems to perform any task like a human. In ML, we teach
machines with data to perform a particular task and give an accurate result.
4. Machine learning and deep learning are the two main subsets of AI. Deep learning is a
main subset of machine learning.
5. AI has a very wide range of scope. comparatively Machine learning has a limited scope.
6. AI is working to create an intelligent system which can perform various complex tasks.
Machine learning is working to create machines that can perform only those specific tasks for
which they are trained.
7. AI system is concerned about maximizing the chances of success. Machine learning is
mainly concerned about accuracy and patterns.
8. The main applications of AI are Siri, customer support using catboats, Expert System, Online
game playing, intelligent humanoid robot, etc. The main applications of machine learning are
Online recommender system, Google search algorithms, Facebook auto friend tagging
suggestions, etc.
9. On the basis of capabilities, AI can be divided into three types, which are, Weak AI, General
AI, and Strong AI. Machine learning can also be divided into mainly three types that are
Supervised learning, Unsupervised learning, and Reinforcement learning.
10. AI includes learning, reasoning, and self-correction. Machine Learning includes learning and
self-correction when introduced with new data.
11. Machine learning deals with Structured and semi-structured data. Where as AI completely
deals with Structured, semi-structured, and unstructured data.

You might also like