Don't wanna be here? Send us removal request.
Text
Algorithm Implementation Assignment 2 Solution
You should submit the Java file `AutoComplete.java` to GradeScope (the link is on Canvas). You must also submit a writeup named `a2.md` and an Assignment Information Sheet `InfoSheet.md` as described below. Table of Contents – [Overview]( overview) – [Background]( background) – [Details]( Details) – [Testing and Debugging]( Testing-and-Debugging) – [Hints]( hints) – [Writeup]( writeup) –…
0 notes
Text
CS 5854: Networks, Crowds, and Markets Homework 3 Solution
Part 1: Matching Markets and Exchange Networks 1. Consider two sellers, a and b, each o ering a distinct house for sale, and a set of two buyers, x and y. x has a value of 2 for a’s house and 4 for b’s house, while y has a value of 3 for a’s house and 6 for b’s house, summarized in the following table. Buyer a’s house b’s house value for x 2 4 value for y 3 6 (a) Suppose that a charges…

View On WordPress
0 notes
Text
CS 513 HW Final Exam
Problem 1 – (20 points) The “AL_NJ_Income_pct” CSV dataset on CANVAS categorizes the tax returns of families in the states of Alabama and New Jersey into six categories (Returns_pct1 to Returns_pct6). Use these six categories and Euclidian distance, to perform the following analysis Use the kmeans clustering method to create two clusters for the “AL_NJ_Income_pct” dataset. Show the cross…

View On WordPress
0 notes
Text
The Connect 4 Board CS115 – Hw 13
Connect Four is a variation of tic-tac-toe played on a rectangular board. Typically there are 6 rows and 7 columns, although your code will work for any number of rows and columns. The game is played by two players, alternating turns, with each trying to place four checkers in a row vertically, horizontally, or diagonally. Because the board stands vertically and the checkers are subject to…

View On WordPress
0 notes
Text
CS115 How to get a Date!
This week’s homework will guide you through creating a class named Date which will allow you to do computations on dates. The Date class Grab the starting file date_template.py Save your copy as date.py (and change Hw 11 to Hw 12 if you like). Take a moment to look over this file as it stands so far… Notice that in this Date class there are three attributes, also known as data members: • A data…

View On WordPress
0 notes
Text
Image Compression CS 115 – Hw 6
Ultimately, all data in a computer is represented with 0’s and 1’s. We’ve explored how symbols can be represented as sequences of 0’s and 1’s; In this problem we’ll explore the representation of images using 0’s and 1’s. Let’s begin by considering just 8-by-8 black-and-white images such as the one below: Each cell in the image is called a “pixel”. A white pixel is represented by the digit 0 and…

View On WordPress
0 notes
Text
CS 115 – Hw 4 Pascal’s Triangle
Pascal’s Triangle was developed by a French mathematician named Blaise Pascal. The rows are numbered starting with 0 and go all the way to n, just like list indices in Python. The triangle always starts with a single term in the 0th row, which is a [1]. The nth row of the triangle has n+1 terms, and each term is found by adding the values of the two terms above it. For example, row number 2…

View On WordPress
0 notes
Text
CS 115 – Hw 2 Scrabble scoring -- Preliminary Functions
Write the following functions: letterScore(letter, scorelist) takes as input a single letter string called letter and a list where each element in that list is itself a list of the form [character, value] where character is a single letter and value is a number associated with that letter (e.g. it’s scrabble score). The letterScore function then returns a single number, namely the value…

View On WordPress
0 notes
Text
CS115 – Hw 1 Writing your own factorial function
• f r o m m a t h i m p o r t factorial • factorial(5) • 120 As shown above, we can use the factorial function from the math module. Here, you’ll write your own factorial function. First, we start with a simple function that returns the product of its two inputs: def mult(x, y): “””Returns the product of x and y””” return x * y Nothing too surprising here. Now, take a look at this: •…

View On WordPress
0 notes
Text
CS559-B HW3
Problem 1 (25pt): [K-means] Implement the K-means algorithm. Note that you cannot directly call the built-in kmeans functions. Figure 1: Scatter plot of datasets and the initialized centers of 3 clusters Given the matrix X whose rows represent different data points, you are asked to perform a k-means clustering on this dataset using the Euclidean distance as the distance function. Here k is…

View On WordPress
0 notes
Text
CS559-B HW2
Problem 1 (30pt): [Perceptron Algorithm] In this problem, we learn the linear discriminant function for boolean OR function. Suppose we have two dimensional x = (x1, x2), x1 and x2 can be either 0 (false) or 1 (true). The boolean OR function is defined as: f(x1, x2) = x1 OR x2. Specifically, f(0, 0) = false, f(1, 0) = true, f(0, 1) = true, and f(1, 1) = true where true can be treated as positive…

View On WordPress
0 notes
Text
CS559-B HW1
Problem 1 (5pt): Provide an intuitive example to show that P (A|B) and P (B|A) are in general not the same. Provide matrix examples to show AB ̸= BA. (No math derivation is needed). Problem 2 (10pt): Independence and un-correlation (5pt) Suppose X and Y are two continuous random variables, show that if X and Y are independent, then they are uncorrelated. (5pt) Suppose X and Y are uncorrelated,…

View On WordPress
0 notes
Text
Assignment--Right Threaded-BST
struct rightThreadedBSTNode struct rightThreadedBSTNode { { int key; int key; int size; // Total no of nodes in the subtree rooted at the node. int size; // Total no of nodes in the subtree rooted at the node. int rightThread; // 1, if right link is a thread to its inorder successor int rightThread; // 1, if right link is a thread to its inorder successor struct rightThreadedBSTNode *leftChild;…

View On WordPress
0 notes
Text
CS513 DS LAB 1 (6/AUG/22)
Q1.) Given a input file containing the characters ‘(‘, ‘)’, ‘{‘, ‘}’ , ‘[‘ , ‘]’ , and several other, read the input file (input.txt) and determine if the input file is having valid Parentheses or not. (40 points) (Note: read file name using command line argument ) An input file is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct…

View On WordPress
0 notes
Text
FE 513 Practical Aspects of Database Design Assignment I
Before starting this assignment, please go through the ’Google’s R coding style guide’ (available under Week 2 module on Canvas). Please submit R code as well as a pdf report le, containing results and the corresponding R code. Rmarkdown is highly recommended for generating the report. More guideline on using Rmarkdown please see help documentation under week 3 module. Part I 1.1 Vector Create…

View On WordPress
0 notes
Text
CS513 Final Exam
There are a total of 5 (five) multi-part questions, with point values noted for each question. Please show your calculations, or the details of your program(s), for each problem. Your program(s) should be commented so that each step is clearly explained. Combine all of your answers/files into a single zipped file and post the zipped file to CANVAS. Problems #1 and #2 Using an “Addiction”…

View On WordPress
0 notes
Text
CS3610 Project 5 Solution
Here in the great State of Ohio, each city is connected to at least one other city by at least one bi-directional road. In other words, Ohio is laid out as an undirected graph with some vertices sharing multiple (parallel) edges. Now the State is working to install recharging stations for electric cars in every city. Your job is to help nd the minimum battery range needed to travel between any…

View On WordPress
0 notes