Goal For this project you will need to write a complete Java program You do not need to submit a

Goal For this project, you will need to write a complete Java program. You do not need to submit a design document, but your code design will factor into your grade. Note: You do not need to build a Swing GUI for this program. Requirements 1) Must allow the user to enter the simulation's initial condition: the starting height of the billiard ball (yi). 2) Must simulate the billiard ball's descent from height yi to the ground (y=0). 3) The output CSV file must have columns for the following data... 3.1) Time (in seconds) starting from 0 3.2) Height (in meters) of the ball 3.3) Velocity (in meters per second) 4) The output CSV file must contain the ball's height and velocity at each second from the time the ball was dropped until the time the ball hits the ground. Usage Example User input is shown in bold, console output is shown in plain text. Please enter simulation parameters... Initial Height (in meters): 5 Simulating... t=0 t=1 t=2 t=3 t=4 Writing to simulationdata.csv... Done. Note: Given the small amount of user interaction in this project, you may include more detail in your console output as the simulation runs. I would recommend doing so to help debug. CSV File Format The data generated by the program must be saved to a file where each row represents one height measurement. The first row of the file should list the column (variable) names, in this case time, height, and velocity. On each row after the column names, the three numerical values should be separated by a comma (,). Example time, height, velocity 0,8.0,0.0 1,7.3,1.2 2,6.0,1.8 3,4.4,2.6 4,2.8,3.7 5,0.0,4.5 time, height, velocity 0,8.0,0.0 1,7.3,1.2 2,6.0,1.8 3,4.4,2.6 4,2.8,3.7 5,0.0,4.5 (Note: this example demonstrates the file format only, do not use it to verify the simulation data) Valid CSV files can be opened in Microsoft Excel, Google Sheets, etc Imagine you are collaborating with a physics lab on campus. They would like to compare data collected from real-world studies with simulated data. Several experiments were performed to study the effect of air resistance on a falling billiard ball. The team needs a program which can simulate the position of the billiard ball in free-fall under simple, idealized conditions and produce a CSV file of the ball's position over time. Our simulation will neglect air resistance, etc. Sphere falling from a height The position or height of the falling billiard ball can be simulated with the following equation: y(t) = yi - (1/2) * g * t^2 where.. y(t) is the height of the ball at time t yi is the starting (initial) height g is the acceleration due to gravity (9.81 m/s^2) t is the amount of time the ball has been falling

Goal For this project, you will need to write a complete Java program. You do not need to submit a design document, but your code design will factor into your grade. Note: You do not need to build a Swing GUI for this program. Requirements 1) Must allow the user to enter the simulation’s initial condition: the starting height of the billiard ball (yi). 2) Must simulate the billiard ball’s descent from height yi to the ground (y=0). 3) The output CSV file must have columns for the following

Read More

In PythonThe purpose of a graph is to represent various constructs in the real world Miles between

In PythonThe purpose of a graph is to represent various constructs in the real world. Miles between cities, a network of cables connecting switches, etc. A useful algorithm to help traverse a graph would be finding a minimum spanning tree. There are various algorithms available to us, including Kruskal’s Algorithm. Write a program that takes a graph representing a map between cities and use Kruskal’s Algorithm to find an MST for visiting subsets of the cities (vertices.)

Read More

2a Write a python program to perform supervised classification on the Iris and Indian Pines

2a. Write a Python program to perform supervised classification on the Iris and Indian Pines datasets using Naive Bayes, Support Vector Machines (with RBF kernel), and Multi-layer Perceptron (MLP) classifiers for training sizes ={10%,20%,30%,40%,50%} for each of the below cases: i) With dimensionality reduction - Reduce data based on your choice of 'K' dimensions from 1a using each of the dimensionality reduction methods (PCA) followed by supervised classification by the listed classifiers. ii) Without dimensionality reduction - Data is followed by supervised classification using the listed classifiers. iii) Provide the plots for overall training accuracy, and overall classification accuracy versus the training size for all methods (classification schemes). Tabulate the classwise classification accuracies (i.e. extension of the sensitivity and specificity values) only for 30% training size over all methods for each dataset for case ii) i.e. without dimensionality reduction. Please note that the point distribution is as follows: - Total 4 plots, i.e. 2 plots for each dataset [case i and ii, overall training, and testing accuracy] - 2 tables (classwise accuracy), i.e, 1 table per dataset - Total points available: 30 points (5 points per plot/table)

2a. Write a Python program to perform supervised classification on the Iris and Indian Pines datasets using Naive Bayes, Support Vector Machines (with RBF kernel), and Multi-layer Perceptron (MLP) classifiers for training sizes ={10%,20%,30%,40%,50%} for each of the below cases: i) With dimensionality reduction – Reduce data based on your choice of ‘K’ dimensions from 1a using each of the dimensionality reduction methods (PCA) followed by supervised classification by the listed classifiers. ii

Read More

Problem Requirements Write a C program that takes a 1D array of integers as input and outputs the

Problem Requirements: Write a C++ program that takes a 1D array of integers as input and outputs the longest sequence of consecutive numbers in the array. For example, given the array {1, 2, 3, 4, 5, 7, 8, 9, 10}, the program should output "Longest sequence of consecutive numbers: 12345 ". Problem Requirements: To solve this problem, your program should perform the following steps: - Ask the user to input the size of the array. - Allocate memory for the array using dynamic memory allocation. - Ask the user to input the elements of the array. - Pass the array to a function that finds the longest sequence of consecutive numbers in the array. - Output the longest sequence of consecutive numbers found. Your program should handle edge cases, such as when the array is empty or when there are multiple sequences of the same length.

Problem Requirements: Write a C++ program that takes a 1D array of integers as input and outputs the longest sequence of consecutive numbers in the array. For example, given the array {1, 2, 3, 4, 5, 7, 8, 9, 10}, the program should output “Longest sequence of consecutive numbers: 12345 “. Problem Requirements: To solve this problem, your program should perform the following steps: – Ask the user to input the size of the array. – Allocate memory for the array using dynamic memory allocation. – A

Read More

Option 6 Update an evaluation grade for one student The program asks the user to enter the ID of

Option 6: Update an evaluation grade for one student The program asks the user to enter the ID of the student and then the evaluation code: (T1, T2, L1, L2, L3 or PR). The program then asks the user to enter the new grade. The program updates the student's record (total grade and letter grade) based on the new grade. Enter the student's ID: 123456 Which grade to update: T1 The current T1 grade is 20 Enter the new T1 grade: 24 The program prints: T1 updated for Lea Smith The updated record is then printed in the same format as option 4. Testing Your Program: The program does not store any data between runs. It is a good idea that you create a few sets of data that you can use to test your program and always use the same data. You can store your data in a comment at the beginning or end of your program such that you can copy and paste the data for input rather than typing each time. The more records you use to test, the better. The records I used for my tests are provided below for you. Feel free to add more. # Lea Smith,123456,HH,20,24,10,9,9,18 # Bob Green,234567,HP,22,24,10,8,10,19 # Ben Johns,345678,B2,24,20,9 # Ben Johns,345678,B2,25,22,10,8,8,18

Option 6: Update an evaluation grade for one student The program asks the user to enter the ID of the student and then the evaluation code: (T1, T2, L1, L2, L3 or PR). The program then asks the user to enter the new grade. The program updates the student’s record (total grade and letter grade) based on the new grade. Enter the student’s ID: 123456 Which grade to update: T1 The current T1 grade is 20 Enter the new T1 grade: 24 The program prints: T1 updated for Lea Smith The updated record is the

Read More

Here we have a vacuumcleaning agent that can sense the environmen and perform actions to move

Here we have a vacuum cleaning agent that can sense the environment and perform actions to move around and vacuum clean dirty squares. We assume a 5 by 5 grid world known to the agent. The environment is fully observable: the percepts give complete information about the Dirty/Clean status of every square and the agent's location. The environment is deterministic: A clean square remains clean and a dirty square remains dirty unless the agent cleans it up. The actions available for the agent are: Left, Right, Up, Down, Suck. Each action takes place in one time step. The actions and percepts are perfectly reliable. Each of the actions will incur a cost of 1. At the end of each time step, each remaining dirty square will incur a cost of 2. The agent's performance is measured by the total cost received from start state to reaching a state with all squares being "Clean". As usual, a rational agent should maximize its performance score and thus minimize the total cost. Assume the agent is in square (x, y) at time t, and the square was "dirty" at time t1. Suppose the agent performs the "Suck" action at time t, then square (x, y) will NOT incur cost due to dirtiness at step t (because at the end of this time step, square (x, y) is already clean). Formulate the vacuum cleaning problem as a search problem. In this sub-problem, you would define the states, actions, the successor function, and the goal test. You can assume the initial state has the top 5 squares all dirty, and the agent is located at the bottom left square. You can index each square in the 5x5 grid world by (x, y) with the bottom left square = (1, 1) and the top right square = (5, 5). How do you represent a state? Hint: A state S should specify two things: (a) The dirty/clean status for all 25 squares, AND (b) the current location (x, y) of the agent. Dirty/Clean Status: 11111 (top 5 squares dirty), 0000000000 (bottom 20 squares clean) State S = (Dirty/Clean Status for Each Square, Agent's Location (x, y)) Write (or adapt from open-source implementation) a Python program to implement the A* algorithm (tree search) for the vacuum cleaning agent's problem (defined in Question 5 of Homework 2). Your agent should utilize the admissible heuristic function h1(n) defined in your answer to Q(5.3) in Homework 2 (or a corrected h1(n) in case your h1(n) answer to Q(5.3) was not correct). Run the program for the 5 by 5 grid world with the top 5 squares dirty, and the agent located in the lower left corner square (coordinate (1, 1)) as the initial state. Print out the sequence of actions in the optimal path returned by the program. In addition, print out the f(n) values for every node n on the optimal solution path (including the node for the initial state and the node for the final goal state). Print out the number of nodes expanded by the algorithm using h1(n). Part (B) (25%) Run your A* algorithm for the same problem, using the alternative heuristic function h2(n) defined in your answer to Question (5,4) in Homework 2 (or a corrected h2(n) in case your h2(n) answer to Q(5.4) was not correct). Print out the sequence of actions in the optimal path returned by the program. In addition, print out the f(n) values for every node n on the optimal solution path (including the node for the initial state and the node for the final goal state). Print out the number of nodes expanded by the algorithm using h2(n). Program documentation (5%) Please provide reasonable documentation to your program to make it easy for understanding. If you are submitting multiple files, please zip them and then submit ONE .zip file. If you are submitting a Jupyter notebook, please use the first cell to include your name and indicate any packages (other than aima-python master - which I assume by default) that would be needed to run your notebook. If you are submitting a Python program instead of a Jupyter notebook, you should either include in your submission a 'readme' file or use comments at the beginning of your Python file to indicate your name and any packages needed to run your program (same as the Jupyter notebook case). Try to name your submission with YOUR NAME (for example: Chen_Astar.ipynb or Chen_Astar.py or Chen_Astar.zip) to make identification of your submission easier. Use of comments is strongly encouraged to help better understanding of your program logic.

Here we have a vacuum cleaning agent that can sense the environment and perform actions to move around and vacuum clean dirty squares. We assume a 5 by 5 grid world known to the agent. The environment is fully observable: the percepts give complete information about the Dirty/Clean status of every square and the agent’s location. The environment is deterministic: A clean square remains clean and a dirty square remains dirty unless the agent cleans it up. The actions available for the agent are:

Read More

Write a program in JAVA that displays a menu as shown in the sample run and asks user to two

Write a program in JAVA that displays a menu as shown in the sample run and asks the user for two numbers. You can enter 1, 2, 3, 4, 5, 6 to choose addition, subtraction, multiplication, division, integer division, or remainder. Depending on the operation type, you will evaluate the result of the operation. For a division operation such as number1/number2, you should check number2 so that it is not zero. Your program should be inside a loop and exit the loop whenever you enter 7. Select Operation: 1: Addition 2: Subtraction 3: Multiplication 4: Division 5: Integer Division 6: Remainder 7: Exit Enter a choice: 3 Please enter the first number: 20 Please enter the second number: 10 Result of 20 * 10 = 200 Select Operation: 1: Addition 2: Subtraction 3: Multiplication 4: Division 5: Integer Division 6: Remainder 7: Exit Enter a choice: 1 Please enter the first number: 21 Please enter the second number: 11 Result of 21 + 11 = 32

Write a program in JAVA that displays a menu as shown in the sample run and asks the user for two numbers. You can enter 1, 2, 3, 4, 5, 6 to choose addition, subtraction, multiplication, division, integer division, or remainder. Depending on the operation type, you will evaluate the result of the operation. For a division operation such as number1/number2, you should check number2 so that it is not zero. Your program should be inside a loop and exit the loop whenever you enter 7. Select

Read More