Exam-3 Practice Exam
.pdf
keyboard_arrow_up
School
University of Southern California *
*We aren’t endorsed by this school
Course
561
Subject
Computer Science
Date
Feb 20, 2024
Type
Pages
19
Uploaded by MegaRam3541
Final Exam CSCI 561 Fall 2022: Foundation of Artificial Intelligence Instructions: 1. Maximum credits/points for this midterm: 100 points. 2. No books (or any other material) are allowed. 3. All the questions in this exam are going to be auto-graded. This means that you should exactly follow the instructions in entering your results. 4. You are allowed to use a calculator. 5. Some questions have hints. Be sure to check them before solving the problem. 6. Adhere to the Academic Integrity Code. 7. Please make sure that you write the answers in the format discussed. Problems 100 Percent Total 1-General Al Knowledge 18% 2 — Decision Trees 12% 3 - Neural Networks 15% 4 — Bayesian Networks 15% 5 — Probability Theory 15% 6 —HMM, Temporal Model 15% 7 — Naive Bayes 10%
1. True/False [18%] For each of the statements below, fill in the bubble T if the statement is always and unconditionally true, or fill in the bubble F if it is always false, sometimes false, or just does not make sense: 1. Both deductive and inductive learning agents learn new rules/facts from a dataset. 2. Learning is useful as a system construction method, because we only need to expose the agents to reality without any manual input. 3. Inthe ID3 algorithm, we need to choose the attribute that has the largest expected information gain. 4. Both perceptron and decision tree learning can learn majority function (output 1 if and only if more than half of n binary variables are 1) easily. It is representable within a perceptron and only needs a few branches in DTL (Decision Tree Learning). 5. The process of learning of a neural network happens in both the feed-forward (prediction) part and back-propagation part. 6. The basic principles of deep learning are similar to those of basic neural networks, but deep learning has newer methods for larger datasets. 7. Probabilities of propositions may change with new evidence. 8. A complete probability model specifies every entry in the joint distribution for all the variables. 9. When calculating a probability distribution, normalization will be needed in the end to make the distribution sum to 1. However, even if you use the inference rules properly, the normalization may not be preserved. 10. Probabilistically speaking, two coin tosses are conditionally independent. 11. The reward for a probabilistic decision making model can be given from states R(s), stats-action R(s, a), or transition R(s, a, s). 12. The principle of a MEU (Maximum Expected Utility) is that a rational agent should always choose the action that maximizes the utility. 13. The major difference between a POMDP (Partially Observed Markov Decision Process) and a general MDP (Markov Decision Process) is merely a sensor model P(e|s). 14. States transit randomly for Markov Chains and Hidden Markov Models. 15. In HMM (Hidden Markov Models), there are two important independence properties. The first is that the future depends only on the present; the second is that observations are independent of each other. 16. Forward procedure computes all at(si) on state trellis, while the Viterbi algorithm only computes the best for each step.
17. Discrete valued dynamic Bayes nets are not HMMs (Hidden Markov Models). 18. For Bayesian learning, we are given a set of new data D, background knowledge X, and are supposed to predict a concept C where P(C|DX) is the most probable.
2. Decision Trees [12%] Lyft wants to analyze if a student at USC gets a lyft depending on if it is raining around the university, if the destination is near or far and whether or not the ride was free. They have provided the training data below and they need your help to train a machine to decide whether a student gets a lyft. Note: (for calculations, always take digits up to 3 decimal places and drop the rest without rounding. Eg. 0.9737 becomes 0.973) For all the following questions, use log base 2 (Use Table 2.1 to answer Q1-3) (Table 2.1) # Rain Free? Near? Takes Lyft 1| Yes No Yes Yes 2| No No Yes No 3| Yes No No Yes 4| Yes No No Yes 5| No Yes Yes Yes 6| Yes Yes Yes Yes 7 | No Yes Yes No 8| Yes Yes No Yes 9 [ No Yes Yes No 10 | Yes Yes Yes Yes
Q1. Calculate the information conveyed by the distribution of the Takes Lyft column to 3 decimal places [2%] 1. 0.879 2. 0.933 3. 1 4. 0.325 Q2. Which would be the best attribute to split on? (Assume this attribute to be X for further questions) [4%] A. Rain B. Free C. Near Q3. What is the value of Remainder(Free) ? (Ans up to 3 decimal places) [2%] a. 0.423 b. 0.634 c. 0.875 d. 0 Q4. Assume that the Entropy and Remainder values of the given training data is: (Use Table 2.2 to answer questions Q4 a. and Q4 b.) Entropy = 0.910 Remainder(X) = 0.230 Remainder(Y) = 0.510 Remainer(Z) = 0.810 ( Table 2.2)
SrNo X Y z is Correct? 1 TRUE TRUE FALSE Yes 2 FALSE TRUE TRUE No 3 FALSE TRUE TRUE No 4 TRUE FALSE TRUE Yes 5 TRUE FALSE TRUE Yes 6 FALSE FALSE TRUE No 7 TRUE TRUE TRUE Yes 8 FALSE FALSE FALSE No 9 TRUE TRUE FALSE Yes a. Which would be the worst attribute to split on for the given data? [2%] 1. X 2. Y 3 z b. What output (IS Correct) would the machine give after being trained (assuming the calculations are correct for the root node) for the test data where X=False, Y= False and Z=True. [Hint: The decision tree learned uses only one attribute] [2%)] 1. Yes
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Simulation parameters:
• Define a step size h. Try something small like 0.001 seconds.
• Define a length for the simulation-perhaps 10 seconds for now, but feel free to adjust it as
you see fit.
• Create a list of times that begins at 0 and goes up to the simulation length in steps of h. The
actual simulation only cares about the step size, so we won't use this in the simulation but we'll
use it for plotting at the end.
• Calculate the length of the list created in the previous step and assign it to a variable n.
Data arrays:
• Create a list r of length n that is all zeros (np.zeros could come in handy here).
• Create a list s of length n that is all zeros.
Initial conditions:
• Set the first entry of r to be some initial height of your choosing.
• Set the first entry of s to be some initial velocity of your choosing.
First-order equations:
• We need to define a function that calculates the derivative of r. Since Eq. 2.14 says that r' s,
this is fairlv simply. We iust have to return c…
arrow_forward
Make Ice Cream
In this challenge activity, you will analyze the numbered steps to make vanilla ice cream and translate them
into inputs, actions, and outputs.
Instructions to make vanilla ice cream:
1. Stir white sugar, heavy cream, and milk in a saucepan. Heat the mixture using low heat until the
sugar is dissolved. Continue to heat until the mixture is hot, and a small ring of foam forms around the
edge.
2.
Transfer the mixture to a large container. Stir in vanilla extract. Chill the mixture for at least two hours.
3.
Pour the cold mixture into an ice cream making machine. Churn the ice cream according to the
machine directions.
4.
When ready, serve the ice cream.
Making Ice Cream
Input
Action
Output
arrow_forward
solve using paython language and take screenshot contains the code
arrow_forward
Flashback to Probability: Determine the odds of rolling TWO 6-sided dice, and getting a total between the two dice that is a multiple of three.
arrow_forward
should be done in processing language
arrow_forward
You're known as "explain" in IT because you inspire others.
arrow_forward
Identify three things to look out for when reading a test item.
arrow_forward
Four in a row is a game in which players take turns adding tokens to the columns on the game board.
Tokens fall to the lowest position in the chosen column that does not already have a token in it. Once one of the players has placed four of their tokens in a straight line (either vertically, horizontally, or diagonally), they win the game
If the board is full and no player has won, then the game ends in a draw.
TASK
Using the following class descriptions, create a UML diagram and a version of Four in a row game
The game must allow for a minimum of two and maximum of four players
The game must allow each player to enter their name(duplicate names should not be accepted)
The game should give the players the ability to choose how many rows (between four and ten), and how many columns (between four and ten) the game board should have.
The code uses several classes, including "Player", "Board","Game" and exceptions for handling errors such as invalid moves and full columns.…
arrow_forward
SOURCES OF MESSAGE
Messages in communication are sent in a form of sound waves or signals. This
is the job of the transmitter. It converts the message into signals to be transmitted or
sent through cables or other machines.
Once the message has already been converted, it will pass through a channel, the
medium used to send a message. Your answers in Item Number 3 are examples of
channels. Can you thìnk of another examples of channel you frequently used in sending
a message? Write them in the box below.
CHANNEL
inates ts
Wers in len
ssage
Since a message has been initiated, converted into a signal, and sent through a
medium, it will now reach its destination. But before that, the converted message should
be decoded first. This is the job of the receiver. It is the one that translates the message,
in a form of a signal or sound wave, into a form that can be understood by the destination
or recipient of the message.
sues f
esse wite
ses cv
The receiving end in this communication model is…
arrow_forward
please use google collab and screenshot
arrow_forward
Moon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of
Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your
weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is
6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg.
(a) Number
6.89
Units
percent
(b) Number
i
6.8713e-4
Units
percent
arrow_forward
A midterm exam has two parts. Part 1 consists of ten multiple choice questions. Each question hasfour choices, labeled (a), (b), (c), and (d), and one may pick any combination of responses on each ofthese questions. For example, one could choose just (a) alone on one question, or both (b) and (c),or all four possibilities, or none of them. In Part 2, one may choose either to answer eight true/falsequestions, or to select the proper definition of each of seven terms from a list of ten possible definitions.Every question must be answered on whichever portion (true/false or definition) of Part 2 is chosen,but one is not allowed to complete both the true/false and the definition portions. How many waysare there to complete the exam?
arrow_forward
1. Your objective is to guide a robot through a labyrinth. 1. Your objective is to guide a robot through a labyrinth. The robot begins at the maze's middle, looking north. You have the option of facing the robot north, east, south, or west. You may tell the robot to travel ahead a particular distance, but it will halt if it comes too close to a wall.
i. Create a problem statement for this situation. What is the size of the state space?
ii. The only location we need to turn while traversing a labyrinth is at the junction of two or more passageways. This remark may be used to reformulate the issue. What is the current size of the state space?
iii. We may go in any of the four directions from any point in the labyrinth until we reach a turning point, and that is the only action we need to do. Using these steps, rephrase the issue. Is it necessary to maintain track of the robot's orientation at this point?
iv. We already abstracted from the actual world in our original description…
arrow_forward
Q2-
Once you are doing a financial transaction through an ATM machine, there is
an authentication process that takes place to grant you the access to your bank
account, which has been demonstrated generally in this module. Using your
own words, describe the most common scenario involved in the authentication
process that takes place once you enter your payment card into ATM machine.
Provide your explanation with a suitable diagram that illustrates the basic steps
involved.
arrow_forward
Use your knowledge in probability theory, or do your own research to prove it - write a short essay to expound your thoughts. Now, there are many explanations offer by people on the web, but many aren't that good and made it overly complicated and even convoluted. I want you to use your own words to write your thesis and make it comprehensible to a non-math, non-statistic major.
Relaxed Documentation Requirements
This is a special Final Lab Project replacing the regular Final Exam, due to the emergency transition to online live stream classes and a shorten quarter - caused by the pandemic. So, the only documentation requirements for this lab are:
1. A brief File Header2. Adequate comments along the code3. No global variables allowed
arrow_forward
I need the answer as soon as possible
arrow_forward
Answer only if you are 100% sure . Correct and detailed answer will be Upvoted else downvoted. Thank you!
Nested loops are problematic areas for testers. Comment on this.
arrow_forward
METHOD:
Put on gloves and place one piece of bread in a re-sealable plastic bag using a gloved hand. Label this first bag “controlled”.
QUESTION:
What will be the result and write your conclusion
arrow_forward
Alert for not submit AI generated answer. I need unique and correct answer. Don't try to copy from anywhere.
arrow_forward
Rewrite the following paragraph with the proper punctuation marks where you see fit: Clarence the valedictorian for this school year decided he did not want to go to college and people were shocked. Everybody thought he would go to a prestigious university like Harvard or Princeton but he decided he wanted to join the Marine Corps. When he was asked why he did not want to go to college he said that he didn’t like school he always wanted to wear the uniform and he wants to be Marine Reconnaissance the special force unit of the Marine Corps. Upon this revelation no one doubted that Clarence could not be special force one day, he had this drive when he sets his mind on something he would give it his all and accomplish it.
arrow_forward
True or False.
You cannot have a focus in a one-dimensional system.
arrow_forward
Alert dont submit AI generated answer.
arrow_forward
Alert dont submit AI generated answer.
arrow_forward
Please look at attached photos. It needs to pass all of the simulations. Thanks in advance
Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the data for reading.
Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the alphabet with our pattern.
For example, if our shift number was 3, then A would be replaced with D, if we performed a right shift. As an example:
Text = "THE CAT IS VISIBLE AT MIDNIGHT" Ciphertext…
arrow_forward
What is the difference between the best-fit and the first-fit. It's a tough choice.
arrow_forward
Describe a time when you were caught in one of the decision-making traps. How did you realize you'd made the wrong decision?
arrow_forward
Which scenarios would cause an error ?
arrow_forward
In a classroom election, two presidential candidates, namely, Lisa and Teddy, both garnered the same number of total votes. As such, they decided to play a custom dice game to determine the winner of the election. In this game, a player needs to roll a pair of dice. Teddy will win the game if the sum is odd whereas Lisa will be declared winner if the sum results to even. However, prior to the start of the game, Teddy complained that the custom dice game is biased because according to him, the probability of an even result is 6/11, and for odd - only 5/11. Verify Teddy's claim and evaluate the fairness of the game.
CLEAR SOLUTION
arrow_forward
In a classroom election, two presidential candidates, namely, Lisa and Teddy, both garnered the same number of total votes. As such, they decided to play a custom dice game to determine the winner of the election. In this game, a player needs to roll a pair of dice. Teddy will win the game if the sum is odd whereas Lisa will be declared winner if the sum results to even. However, prior to the start of the game, Teddy complained that the custom dice game is biased because according to him, the probability of an even result is 6/11, and for odd - only 5/11. Verify Teddy's claim and evaluate the fairness of the game.
A. The game is fair.
B. The game is unfair to Lisa.
C. The game is unfair to Teddy.
D. More information is needed.
complete solution
arrow_forward
Computer Science
Javascript Question, Anything helps!
Make a playable version of the game"Lights Out" using JavaScript.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Related Questions
- Simulation parameters: • Define a step size h. Try something small like 0.001 seconds. • Define a length for the simulation-perhaps 10 seconds for now, but feel free to adjust it as you see fit. • Create a list of times that begins at 0 and goes up to the simulation length in steps of h. The actual simulation only cares about the step size, so we won't use this in the simulation but we'll use it for plotting at the end. • Calculate the length of the list created in the previous step and assign it to a variable n. Data arrays: • Create a list r of length n that is all zeros (np.zeros could come in handy here). • Create a list s of length n that is all zeros. Initial conditions: • Set the first entry of r to be some initial height of your choosing. • Set the first entry of s to be some initial velocity of your choosing. First-order equations: • We need to define a function that calculates the derivative of r. Since Eq. 2.14 says that r' s, this is fairlv simply. We iust have to return c…arrow_forwardMake Ice Cream In this challenge activity, you will analyze the numbered steps to make vanilla ice cream and translate them into inputs, actions, and outputs. Instructions to make vanilla ice cream: 1. Stir white sugar, heavy cream, and milk in a saucepan. Heat the mixture using low heat until the sugar is dissolved. Continue to heat until the mixture is hot, and a small ring of foam forms around the edge. 2. Transfer the mixture to a large container. Stir in vanilla extract. Chill the mixture for at least two hours. 3. Pour the cold mixture into an ice cream making machine. Churn the ice cream according to the machine directions. 4. When ready, serve the ice cream. Making Ice Cream Input Action Outputarrow_forwardsolve using paython language and take screenshot contains the codearrow_forward
- Identify three things to look out for when reading a test item.arrow_forwardFour in a row is a game in which players take turns adding tokens to the columns on the game board. Tokens fall to the lowest position in the chosen column that does not already have a token in it. Once one of the players has placed four of their tokens in a straight line (either vertically, horizontally, or diagonally), they win the game If the board is full and no player has won, then the game ends in a draw. TASK Using the following class descriptions, create a UML diagram and a version of Four in a row game The game must allow for a minimum of two and maximum of four players The game must allow each player to enter their name(duplicate names should not be accepted) The game should give the players the ability to choose how many rows (between four and ten), and how many columns (between four and ten) the game board should have. The code uses several classes, including "Player", "Board","Game" and exceptions for handling errors such as invalid moves and full columns.…arrow_forwardSOURCES OF MESSAGE Messages in communication are sent in a form of sound waves or signals. This is the job of the transmitter. It converts the message into signals to be transmitted or sent through cables or other machines. Once the message has already been converted, it will pass through a channel, the medium used to send a message. Your answers in Item Number 3 are examples of channels. Can you thìnk of another examples of channel you frequently used in sending a message? Write them in the box below. CHANNEL inates ts Wers in len ssage Since a message has been initiated, converted into a signal, and sent through a medium, it will now reach its destination. But before that, the converted message should be decoded first. This is the job of the receiver. It is the one that translates the message, in a form of a signal or sound wave, into a form that can be understood by the destination or recipient of the message. sues f esse wite ses cv The receiving end in this communication model is…arrow_forward
- please use google collab and screenshotarrow_forwardMoon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is 6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg. (a) Number 6.89 Units percent (b) Number i 6.8713e-4 Units percentarrow_forwardA midterm exam has two parts. Part 1 consists of ten multiple choice questions. Each question hasfour choices, labeled (a), (b), (c), and (d), and one may pick any combination of responses on each ofthese questions. For example, one could choose just (a) alone on one question, or both (b) and (c),or all four possibilities, or none of them. In Part 2, one may choose either to answer eight true/falsequestions, or to select the proper definition of each of seven terms from a list of ten possible definitions.Every question must be answered on whichever portion (true/false or definition) of Part 2 is chosen,but one is not allowed to complete both the true/false and the definition portions. How many waysare there to complete the exam?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole