Categories
Algorithms

You can use any programming language you prefer. You have to use the Minfinder a

You can use any programming language you prefer.
You have to use the Minfinder algorithm to sort a given array. The Pseudocode/ algorithm is provided in the file attached.
.zip file has the assignment screenshot.
You have to use all the input files provided in the code.
The output should print the time taken for all the input files. Example attached.
Make sure to take the screenshotshots of the output.
Comment the code so I can understand what you did.

Categories
Algorithms

-web software used: Jupyter Notebook (anaconda3) -request: save as .ipynb file a

-web software used: Jupyter Notebook (anaconda3)
-request: save as .ipynb file and attach AChristmasCarol.png
-Instructions contain 3 short practice problems

Categories
Algorithms

Review the Sample Dragon Text Game Storyboard in the Supporting Materials sectio

Review the Sample Dragon Text Game Storyboard in the Supporting Materials section to see a sample storyboard for a dragon-themed game. You will begin by creating a storyboard to plan out your game. Using one of the templates located in the What to Submit section, write a short paragraph that describes the theme of your game by answering all of the following questions:
What is your theme? What is the basic storyline?
What rooms will you have? (Note: You need a minimum of eight.)
What items will you have? (Note: You need a minimum of six.)
Who is your villain?
Next, you will complete your storyboard by designing a map that organizes the required elements of the game (rooms, items, and villain). Using the blank map in your template, organize the different rooms and the items in each room. The following requirements must be met:
There must be a minimum of eight rooms.
Each room must contain one item, with the exception of the “start” room and the room containing the villain.
The “start” room is where players will begin their moves and should not contain any items.
The room containing the villain should not contain any items.
Remember, to win the game, the player must move through the rooms, collect all the items, and avoid the room with the villain until all of the items have been collected. Make sure that it is possible for the player to win the game. For example, the room with the villain should not block a room containing an item.
Note: The blank map in the template is provided as a guide. You may add more rooms or change the locations of rooms to suit your needs. This map is for your planning purposes; the player will not have access to this map in the game. You will be able to use your map later when creating and testing your code as a part of Project Two.
Carefully review the Sample Dragon Text Game Walkthrough video and Sample Dragon Text Game Output reading, located in the Supporting Materials section. These will give you an understanding of how the text-based game should work. As you read, consider the following questions:
What are the different steps needed in this program? How might you outline them in a way that a computer can understand?
What information would you need from the player at each point (inputs)? What information would you output to the player at each point?
When might it be a good idea to use “IF” and “IF ELSE” statements?
When might it be a good idea to use loops?
When might it be a good idea to use functions (optional)?
Note: You are not required to turn in anything for this step. However, this step is important to prepare you to design your code in Steps #4 and 5.
Create pseudocode or a flowchart that logically outlines the steps that will allow the player to move between rooms using commands to go North, South, East, and West. Use your notes from Step #3 to help you design this section of code. Be sure to address the following:
What input do you need from the player? How will you prompt the player for that input? How will you validate the input?
What should the program do if the player enters a valid direction? What output should result?
What should the program do if the player enters an invalid direction? What output should result?
How will you control the program flow with decision branching and loops?
Create pseudocode or a flowchart that logically outlines the steps that will allow the player to get the item from the room they are in and add it to their inventory. Use your notes from Step #3 to help you design this section of code. Be sure to address the following:
What input do you need from the player? How will you prompt the player for that input? How will you validate the input?
What should the program do if the player enters a valid item (the item in their current room)? What output should result?
What should the program do if the player enters an invalid item (an item not in their current room)? What output should result?
How will you control the program flow with decision branching or loops?
What to Submit
To complete this project, you must submit the following:
Design Document or Design Presentation
Submit your completed Design Document Template Word Document or Design Presentation Template PPT, which should contain all of the designs for your program. Be sure that you have completed the following pieces of the template:
Storyboard (Theme Description and Map)
Include a paragraph (if using Word) or a slide (if using PowerPoint) that describes the theme, the basic storyline, the rooms, the items, and the villain. Submit your completed map with the layout of the different rooms and the items in each room. Your map should be on one page of the Word document or one slide of the PowerPoint presentation. You completed these items in Steps #1 and 2.
Pseudocode or Flowcharts
Include the pseudocode or flowcharts showing how the player will move between rooms and get the item from each room. Input, output, and the decision branching and loops that control the program flow should be clear. You completed these designs in Steps #4 and 5.

Categories
Algorithms

This assignment involves writing a discrete event simulation to test various sch

This assignment involves writing a discrete event simulation to test various scheduling algorithms. The exact instructions and necessary specification details can be found in the attached PDF instructions/guidelines.
The simulation will be driven by events such as processes arriving, a process performing IO, etc., and will make use of discrete time. It will be a single program with two arguments. The first will be the name of a file specifying the scheduling algorithm to use and the second the name of a file that specifies the processes to run. The program will simulate the execution of the processes on a single processor. Once the last simulated process is complete the program will print out statistics about the run.
This assignment should STRICTLY follow the instructions/guidelines document, including the source code, a readme, and a write-up as specified.
There are 3 files attached for the additional materials:
– The guideline/instructions in the form of a PDF
– The example skeleton source code to be used as a reference or template
– A .Zip file containing the sample runs for various testing purposes
Design this project assignment in Python to conform to the document specifications exactly while utilizing these materials.

Categories
Algorithms

We ask you to implement three small and separate machine learning models. We pro

We ask you to implement three small and separate machine learning models. We provide sample input/output file pairs for your reference. The file plot_db.py contains two functions for plotting data which you may choose to use, modify, reference and steal ideas from at will.
1. Perceptron
2. Linear Regression
Note: The Python Pandas library helps simplify a lot of the intermediate steps we ask from you below. Key functions includereading and writing to CSVs, matrix operations, and visualizing data. Examples are provided in plot_db.py.
1. Perceptron
Implement the perceptron learning algorithm (PLA) for a linearly separable dataset. Your starter code includes data1.csv , where each line contains feature_1, feature-2, label. All values are numeric with labels 1 or -1. Take a look at the data input file. We suggest using matplotlib or pandas.DataFrame.plot (in plot_db.py) to view data, and pandas. DataFrame. describe to see stats.
Write your PLA in pla.py in Python 3. Yom program takes a csv of input data and a location to write the output csv with the weights from each iteration of your PLA, written as weight_1, weight_2, b. The weights in the last line of your output csv defines the decision boundary computed for the given dataset. Formatting is shown in results1. csv.
NOTE: results1. csvvalues are pmely filler and not representative of the values you should get. Feel free to visualize and include a screenshot of your final decision boundary in your README, like the one below:
30
20
10
0
-10
-20
-300 2 4 6 8 10 12 14 16
We will execute your code as follows: $ python pla.py datal.csvresultsl.csv
2. Linear Regression
Use gradient descent to build a linear regression model for predicting height (m) using age (yr) and weight (kg), using data derived from CDC growth charts data.
1
Data Preparation and Normalization Load and understand the data from data2.csv[age(years), weight(kg), height(m)] remembering to add a vector column for the intercept at the front of your matrix. You’ll notice the features are not on the same scale. What is the mean and standard deviation of each feature? Scale each feature (i.e. age and weight) by its standard deyjation, so each scaled feature has a mean of zero. You do not need to scale the intercept. For each feature column, x, use the following formula:
x-µ(x)
Xscaled = O”(x)
Gradient Descent Implement gradient descent to find a regression model in lr.py. Initialize your (3s to zero. Recall the empirical risk and gradient descent rule as follows:
You will run gradient descent with these nine learning rates: a E 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 exactly 100 iterations per a-value, plus a tenth rate and number of iterations of your choice. To pick the tenth rate and loop count, observe how a affects the rate of convergence for the nine rates listed, then pick a rate and loop count you believe will perform well. Briefly explain your choice in your README.
The program should generate an output file containing ten lines, one for each (a, numjters) hyperparameter pair. Each line contains: a, num_i ters, bias, b_age, b_weight, expressed to your choice of decimal places (sec exampleresults2. csvin your starter code). Each line of this file defines the regression model your gradient descent method computed on the given data and hyperparameters.
We will execute your code as follows: $ python lr. py data2. csvresul ts2. csv
Optional: Visualize the result of each linear regression model in three-dimensional space. You can plot each feature on the xy-plane, and plot the regression equation as a plane in xyz-space. Include these visualizations in your README file and label each one appropriately. Ex:
1.5
1.4
1.2}
l.l
1.-i0
0.9 :r::
0.8
0.7
4045
35 ‘ii
30 (Ii
25•:-_O
20
15

Categories
Algorithms

Explain each answer properly.

Please answer all question as per the instructions. explain each answer properly.
Question 5, 6, 7, 8 all have two screen shots of the question each. please provide answer for all the answer boxes in the question.
Please do not copy any answer from other websites like chegg.com

Categories
Algorithms

A pdf called java_style_guide for styling reference

This is a binary tree project and report
This follows a tree pattern for the game “Twenty Questions”. We are supposed to create our own binary tree using IntelliJ in JAVA
(it will take algorithms, a file, and a bit of game logic for a simple game. The goal here is to represent the binary tree)
This professor WILL check for plagiarism, so please, please, please don’t copy any code/reports etc.
FOR THE FULL INSTRUCTIONS PLEASE READ THE ATTACHED DOCUMENT
I have included in the file:
A word document called Project3 -> this is the full instruction
A pdf called Java_Style_Guide for styling Reference
a folder called ch07, the code here SHOULD NOT be used, is there as a reference of styling and for you to see what we have been working on in class.
Basic instructions:
Use a linked Binary Tree to model the program as discussed above – make your own tree, the BST from the book will not work
Build the tree using file input.
Save the tree using file output
Load the tree from file at program start.
Save the tree each time it is changed
You must traverse the tree to print the file – do not use serialize – any traversal is ok. You will need to design your own representation of the tree in the file.
for example – each line in a file denotes a node and each line has a string (the node data) and a special character signifying if if is a leaf node
If the program get the guess wrong, search the tree using a recursive traversal method to see if the guess is somewhere else in the tree. If it is in the tree, alert the user that another path to their answer exists.
Please provide the code and answer to all questions in the assignment.
Thank you for your help!

Categories
Algorithms

Basic instructions:

This is a binary tree project and report
This follows a tree pattern for the game “Twenty Questions”. We are supposed to create our own binary tree using IntelliJ in JAVA
(it will take algorithms, a file, and a bit of game logic for a simple game. The goal here is to represent the binary tree)
This professor WILL check for plagiarism, so please, please, please don’t copy any code/reports etc.
FOR THE FULL INSTRUCTIONS PLEASE READ THE ATTACHED DOCUMENT
I have included in the file:
A word document called Project3 -> this is the full instruction
A pdf called Java_Style_Guide for styling Reference
a folder called ch07, the code here SHOULD NOT be used, is there as a reference of styling and for you to see what we have been working on in class.
Basic instructions:
Use a linked Binary Tree to model the program as discussed above – make your own tree, the BST from the book will not work
Build the tree using file input.
Save the tree using file output
Load the tree from file at program start.
Save the tree each time it is changed
You must traverse the tree to print the file – do not use serialize – any traversal is ok. You will need to design your own representation of the tree in the file.
for example – each line in a file denotes a node and each line has a string (the node data) and a special character signifying if if is a leaf node
If the program get the guess wrong, search the tree using a recursive traversal method to see if the guess is somewhere else in the tree. If it is in the tree, alert the user that another path to their answer exists.
Please provide the code and answer to all questions in the assignment.
Thank you for your help!

Categories
Algorithms

Given list of bank locations, how much money each one holds and the time it would take to rob each one, you need to apply your hard-won algorithm knowledge to make as much profit as possible!

Given list of bank locations, how much money each one holds and the time it would take to rob each one, you need to apply your hard-won algorithm knowledge to make as much profit as possible! I bet you didn’t think that data science could be this profitable!
You will design and write a solution to an NP-Had algorithm to this problem
You will need to apply all the knowledge learned up to now to get the best possible result at this task given a large list of banks and 3 minutes to run your algorithm.
The list of banks is in data/bank_data.csv. This is what the data looks like.
id, x_coordinate, y_coordinate, money, time (hr)
0, 11.4, 3.3, 5000, 0.6
1, 6.9, 7.1, 15000, 0.3
2, 1.4, 13.2, 900, 1.1
You have 24 hours to make as much money as possible and then escape.
Rules
Your run can start anywhere on the map but it has to end at the helicopter escape zone: coordinates (0,0)
If you try to rob too many banks and can’t get to the helicopter in 24 hours, you get caught and go to jail.
Your solution is a list or array of integers (eg. [580, 433, 24, 998]) where the numbers are the IDs of each banks. The ID of each bank is their index (their row index).
You travel between banks at 30 km/h. You have to travel from one bank to the next!
Remember the formula to calculate the distance between two points.
The coordinates are in kilometers.
So (1, 1) and (1, 2) are one kilometer apart.
This would take 1 / 30 hour = 2 minutes to travel
Your solution should be an approximative/heuristic algorithm
This problem is NP-Hard, you won’t find a fast enough algorithm that has the perfect solution
It doesn’t need to find the best solution
Find the best solution you can!
Your solution has to run on a common laptop in under 3 minutes for the 10,000 cities dataset
You can use everything you want to achieve this:
Use numpy, pandas, functions, algorithms
You can use parallelism
Use optimied libraries (pandas, numba, scipy, etc.)
Test your code on small subsets of the data so they run fast
Then scale your code up to bigger chunks of the data
Your input is a pandas dataframe with the bank data. Your output is a list of bank IDs in order that you rob them:
# example
df = pd.read_csv(‘bank_data.csv’)
robber_algorithm(df)
# Output is a list of bank IDs
[OUTPUT] –> [664, 2341, 26, 998, 9583, 24, 1, 444, 6783]
Check Your Solution
You can use the check_solution function from utils/check_solution.py to test the validity of your solution and obtain a score.
Hints
Most of the design paradigms we saw in class will work for this. Start with something that’s easier (brute-force or greedy algorithm) and then work towards a better design once it works.
Divide-and-conquer
Brute Force
Greedy Algorithm
Dynamic Programming
Backtracking
Breadth-first & Depth-first search
Some we haven’t seen:
Branch & Bound
Prune & Search
Because there are too many banks at each step, you will need to select only some candidates to explore.
If you find yourself doing many Nearest neighbors type queries, consider using a KD-Tree or a Ball Tree to speed it up.
There are good implementations of KD-Trees and nearest neighbours in scipy, sklearn and this library
You can work your algorithm backwards (starting at the end and backing up to the starting point) or forwards (finding a starting point and looping until there is no time left). They will lead to different designs however

Categories
Algorithms

Given list of bank locations, how much money each one holds and the time it would take to rob each one, you need to apply your hard-won algorithm knowledge to make as much profit as possible!

Given list of bank locations, how much money each one holds and the time it would take to rob each one, you need to apply your hard-won algorithm knowledge to make as much profit as possible! I bet you didn’t think that data science could be this profitable!
You will design and write a solution to an NP-Had algorithm to this problem
You will need to apply all the knowledge learned up to now to get the best possible result at this task given a large list of banks and 3 minutes to run your algorithm.
The list of banks is in data/bank_data.csv. This is what the data looks like.
id, x_coordinate, y_coordinate, money, time (hr)
0, 11.4, 3.3, 5000, 0.6
1, 6.9, 7.1, 15000, 0.3
2, 1.4, 13.2, 900, 1.1
You have 24 hours to make as much money as possible and then escape.
Rules
Your run can start anywhere on the map but it has to end at the helicopter escape zone: coordinates (0,0)
If you try to rob too many banks and can’t get to the helicopter in 24 hours, you get caught and go to jail.
Your solution is a list or array of integers (eg. [580, 433, 24, 998]) where the numbers are the IDs of each banks. The ID of each bank is their index (their row index).
You travel between banks at 30 km/h. You have to travel from one bank to the next!
Remember the formula to calculate the distance between two points.
The coordinates are in kilometers.
So (1, 1) and (1, 2) are one kilometer apart.
This would take 1 / 30 hour = 2 minutes to travel
Your solution should be an approximative/heuristic algorithm
This problem is NP-Hard, you won’t find a fast enough algorithm that has the perfect solution
It doesn’t need to find the best solution
Find the best solution you can!
Your solution has to run on a common laptop in under 3 minutes for the 10,000 cities dataset
You can use everything you want to achieve this:
Use numpy, pandas, functions, algorithms
You can use parallelism
Use optimied libraries (pandas, numba, scipy, etc.)
Test your code on small subsets of the data so they run fast
Then scale your code up to bigger chunks of the data
Your input is a pandas dataframe with the bank data. Your output is a list of bank IDs in order that you rob them:
# example
df = pd.read_csv(‘bank_data.csv’)
robber_algorithm(df)
# Output is a list of bank IDs
[OUTPUT] –> [664, 2341, 26, 998, 9583, 24, 1, 444, 6783]
Check Your Solution
You can use the check_solution function from utils/check_solution.py to test the validity of your solution and obtain a score.
Hints
Most of the design paradigms we saw in class will work for this. Start with something that’s easier (brute-force or greedy algorithm) and then work towards a better design once it works.
Divide-and-conquer
Brute Force
Greedy Algorithm
Dynamic Programming
Backtracking
Breadth-first & Depth-first search
Some we haven’t seen:
Branch & Bound
Prune & Search
Because there are too many banks at each step, you will need to select only some candidates to explore.
If you find yourself doing many Nearest neighbors type queries, consider using a KD-Tree or a Ball Tree to speed it up.
There are good implementations of KD-Trees and nearest neighbours in scipy, sklearn and this library
You can work your algorithm backwards (starting at the end and backing up to the starting point) or forwards (finding a starting point and looping until there is no time left). They will lead to different designs however