CS446: Machine Learning Spring Problem Set 1

Size: px
Start display at page:

Download "CS446: Machine Learning Spring Problem Set 1"

Transcription

1 CS446: Machine Learning Spring 2017 Problem Set 1 Handed Out: Jan 25 th, 2017 Due: Feb 3 rd, 2017 Feel free to talk to other members of the class in doing the homework. I am more concerned that you learn how to solve the problem than that you demonstrate that you solved it entirely on your own. You should, however, write down your solution yourself. Please try to keep the solution brief and clear. Please use Piazza first if you have questions about the homework. Also feel free to send us s and come to office hours. Please, no handwritten solutions. You will submit your solution manuscript as a single pdf file. Please use L A TEXto typeset your solutions. We have provided resources to get you started including homework templates. In addition, you also have to submit two output files for question 3. Please present your algorithms in both pseudocode and English. That is, give a precise formulation of your algorithm as pseudocode and also explain in one or two concise paragraphs what your algorithm does. Be aware that pseudocode is much simpler and more abstract than real code. The homework is due at 11:59 PM on the due date. We will be using Compass for collecting the homework assignments. Please submit your solution manuscript as a pdf file via Compass ( Please do NOT hand in a hard copy of your write-up. Contact the TAs if you are having technical difficulties in submitting the assignment. 1. [Learning Conjunctions - 40 points] (Based on Mitchell, exercise 2.9) Consider a learning problem where each instance is a Boolean vector over n variables (x 1,..., x n ) and is labeled either positive (1) or negative (-1). Thus, a typical instance would be (1, 0,..., 1) = (x 1 = 1, x 2 = 0,..., x n = 1) Now consider a hypothesis space H consisting of all Conjunctions over these variables. For example, one hypothesis could be (x 1 = 1 x 5 = 0 x 7 = 1) (x 1 x 5 x 7 ) For example, an instance (1, 0, 1, 0, 0, 0, 1,..., 0) will be labeled as positive (1) and (0, 0, 1, 0, 1, 1, 0,..., 1) as negative (-1), according to the above hypothesis. a. Propose an algorithm that accepts a sequence of labeled training examples and outputs a hypothesis h H that is consistent with all the training examples, if one exists. If there are no consistent hypotheses, your algorithm should indicate as such and halt. [10 points] b. Prove the correctness of your algorithm. That is, argue that the hypothesis it produces labels all the training examples correctly. [10 points] c. Analyze the complexity of your algorithm as a function of the number of variables (n) and the number of training examples (m). Your algorithm should run in time polynomial in n and m (if it fails to, you should rethink your algorithm). [10 points] 1

2 d. Assume that there exists a conjunction in H that is consistent with all the data you will ever see. Now, you are given a new, unlabeled example that is not part of your training set. What can you say about the ability of the hypothesis derived by your algorithm in (a.) to produce the correct label for this example? [10 points] 2. [Linear Algebra Review - 10 points] Assume that w R n and θ is a scalar. R n, w T x + θ = 0}. A hyper-plane in R n is the set, { x : x a. [5 points] The distance between a point x 0 R n and the hyperplane w T x+θ = 0 can be described as the solution of the following optimization problem: 2 min x x 0 x subject to w T x + θ = 0 However, there is an analytical solution (i.e. closed form solution) to find the distance between the point x 0 and the hyperplane w T x + θ = 0. Derive the solution. b. [5 points] Assume that we have two hyper-planes, w T x+θ 1 = 0 and w T x+θ 2 = 0. What is the distance between these two hyper-planes? 3. [Finding a Linear Discriminant Function via Linear Programming - 50 points] The goal of this problem is to develop a different formulation for the problem of learning linear discriminant functions and use it to solve the problem of learning conjunctions and the badges problem discussed in class. Some subproblems to question 3 may ask you to compose multiple programs or respond to multiple issues. Anything you are expected to program, turn in, or write about in your report will be in boldface. Definition 1 (Linear Program) A linear program can be stated as follows: Let A be an m n real-valued matrix, b R m, and c R n. Find a t R n, that minimizes the linear function subject to z( t) = c T t A t b In the linear programming terminology, c is often referred to as the cost vector and z( t) is referred to as the objective function. 1 We can use this framework to define the problem of learning a linear discriminant function. 2 1 Note that you don t need to really know how to solve a linear program since we will use Matlab to obtain the solution (although you may wish to brush up on Linear Algebra). Also see the appendix for more information on linear programming. 2 This discussion closely parallels the linear programming representation found in Pattern Classification, by Duda, Hart, and Stork. 2

3 The Learning Problem: 3 Let x 1, x 2,..., x m represent m samples, where each sample x i R n is an n-dimensional vector, and y { 1, 1} m is an m 1 vector representing the respective labels of each of the m samples. Let w R n be an n 1 vector representing the weights of the linear discriminant function, and θ be the threshold value. We predict x i to be a positive example if w T x i + θ 0. On the other hand, we predict x i to be a negative example if w T x i + θ < 0. We hope that the learned linear function can separate the data set. That is, for the true labels we hope { 1 if w T x i + θ 0 y i = (1) 1 if w T x i + θ < 0. In order to find a good linear separator, we propose the following linear program: min w,θ,δ δ (2) subject to y i ( w T x i + θ) 1 δ, ( x i, y i ) D (3) where D is the data set of all training examples. a. Understanding linear separability [15 points] δ 0 (4) a.1 [8 points] A data set D = {( x i, y i )} m i=1 that satisfies condition (1) above is called linearly separable. Show that the data set D is linearly separable if and only if there exists a hyperplane ( w, θ ) that satisfies condition (3) with δ = 0 (Need a hint? 4 ). Conclude that D is linearly separable iff the optimal solution to the linear program [(2) to (4)] attains δ = 0. What can we say about the linear separability of the data set if there exists a hyperplane that satisfies condition (3) with δ > 0? a.2 [2 points] Show that there is a trivial optimal solution for the following linear program: min w,θ,δ δ subject to y i ( w T x i + θ) δ, (x i, y i ) D δ 0 Show the optimal solution and use it to (very briefly) explain why we chose to formulate the linear program as [(2) to (4)] instead. 3 Note that the notation used in the Learning Problem is unrelated to the one used in the Linear Program definition. You may want to figure out the correspondence. 4 Hint: Assume that D is linearly separable. D is a finite set, so it has a positive example that is closest to the hyperplane among all positive examples. Similarly, there is a negative example that is closest to the hyperplane among negative examples. Consider their distances and use them to show that condition (3) holds. Then show the other direction. 3

4 a.3 [5 points] Let x 1 R n, x 1 T = [ ] and y 1 = 1. Let x 2 R n, x 2 T = [ ] and y 2 = 1. The data set D is defined as D = {( x 1, y 1 ), ( x 2, y 2 )}. Consider the formulation in [(2) to (4)] applied to D. Show the set of all possible optimal solutions (solve this problem by hand). b. Solving linear programming problems [35 points] This problem requires developing some Matlab code. We have provided you a collection of Matlab files. You will need to edit some of these files to answer the following questions. In addition to your answers to the following questions, include as part of your solution manuscript the Matlab code you wrote in findlineardiscriminant.m computelabel.m plot2dseparator.m findlinearthreshold.m. Please do NOT submit these files separately. A summary of what to submit is listed in the end of this problem. b.1 [Writing LP - 5 points] Rewrite the linear program [(2) to (4)] into a standard form linear program (the form used in Definition 1). Now, implement a Matlab function called findlineardiscriminant (by editing findlineardiscriminant.m) to find a linear discriminant function that separates a given data set using the linear programming formulation described above (you can refer to the appendix for a primer on solving linear programs using Matlab). Your Matlab function must take data as input, and produce the linear separator, i.e., the weights w ( w), the threshold theta (θ), and the value of the objective at the minimum, i.e., delta (δ). We will read our data from files. A data file consists of lines that contain a sequence of binary values followed by either 1, indicating a positive label, or by -1, indicating a negative label. A sample line might be 0 1-1, which corresponds to x = [0, 1] T, y = 1. In order to read files in this format, we provided a Matlab function called readfeatures that takes a file name and the dimension of the feature vector x (denoted n) and returns an m (n + 1) matrix called data, where m is the number of data points. b.2 [Learning Conjunctions as an LP - 10 points] There are two parts in this question. First, generate a data set that represents a monotone conjunction 5 over two variables manually. Write this data set into hw1sample2d.txt. We provided a Matlab function called plot2ddata to plot the labeled data points given by data. Now, implement a Matlab 5 A conjunction with no negated variables. This file should be 4 lines with 3 numbers per line. 4

5 function called plot2dseparator (by editing plot2dseparator.m) that takes w and theta as input, and plots the corresponding separator line. For your dataset, find the linear separator and plot it together with your data, and include the figure in your solution. In addition, we provided a data set in hw1conjunction.txt that is consistent with a conjunctive concept with n = 10. Use your linear program to learn the target concept in hw1conjunction.txt. State the linear discriminant function returned and succinctly explain your results. For example, what conjunctive concept is represented by the hypothesis returned, and how can this be known from the resulting hyperplane from your function (or can this be known). What can be said about δ and θ? In addition to your explanations, you should also give the actual weights, δ and θ reported by your program. You can use the script learnconjunctions to run these two experiments and obtain the materials you need to submit in your answer. Note that this script outputs the model of the second experiment in a file named p3b2-model.txt. You also need to submit p3b2-model.txt. b.3 [Learning Badges - 10 points] You will solve the badges problem using your linear program. The input files badges.train, and badges.test contain the names of the participants and the badge labels. We will consider features of the following form. Let Σ be the set of characters of interest. Let D be the set of character positions of interest. For each (d, σ) D Σ, we have a binary variable x (d,σ) that is set to 1 if the d-th character of the name is the character σ (ignoring case), or to 0 otherwise. The feature vector x then has dimensions Σ D. Given Σ (alphabet) and D (positions), the Matlab function writebadgefeatures computes the feature vector and writes it to a file using the data file format. In this part, you will use the Matlab script learnbadges. It defines an alphabet consisting of 30 characters, and a position list containing the first ten positions. This script uses your findlineardiscriminant to obtain a linear separator. In order to evalute your result, we provided a code to compute the accuracy of this separator both in the training set and in the test set. The function computeaccuracy makes calls to the computelabel function, which should predict the label for the given feature vector using the linear separator represented by w, and θ. In order for accuracy computations to work, you need to implement the computelabel function. In addition to accuracy, learnbadges creates a figure to illustrate the weight vector returned by your linear program. The x axis shows the characters, the y axis shows the positions, and the pixel colors at location (σ, d) denote the weight corresponding to the feature x (d,σ). Now, run this script and explain δ, the accuracies, and the generated figure in your solution (Be sure to include the figure in your 5

6 solution). Next, experiment with different feature vectors by changing alphabet and/or positions in learnbadges script. Find one alphabet and positions such that the linear separator computed from the resulting feature vector has a perfect accuracy (= 1) in the training dataset, but has an imperfect accuracy (< 1) in the test dataset. Give the figure showing the weight vector for this linear separator. How does this figure compare to the figure you obtained before? b.4 [Learning Multiple Hyperplanes - 10 points] For this part, you will use the Matlab script learnmultiplehyperplanes. The script generates a data matrix that contains 20 two-dimensional real-valued examples with positive and negative labels. First, the script finds a linear separator using your linear program. Now, consider that you are given the weights, but not the threshold, and the goal is to solve the linear program to find the threshold that minimizes δ. Your job is to implement the function findlinearthreshold that takes the data and w, and returns θ, and δ. The script has three different weight vectors, and for each of them it calls your function and then plots the resulting linear function using plot2dseparator. It also generates a text file p3b4-model.txt which stores the four different models. Run this script, and explain the results (Be sure to include the generated figures in your solution and upload p3b4-model.txt). Which hyperplanes separated the data exactly? What δ values have you obtained, and what does they tell us? Is one hyperplane better than another for classification? From these examples, can we infer whether or not the solution to the linear program ([(2) to (4)]) is unique? What to Submit A pdf file which contains your answers to each question, the code snippets of findlineardiscriminant.m, computelabel.m, plot2dseparator.m, and findlinearthreshold.m, figures generated by learnconjunctions.m, learnbadges.m, and learnmultiplehyperplanes.m. p3b2-model.txt and p3b4-model.txt. You will generate these two files while executing learnconjunctions.m and learnmultiplehyperplanes.m. Please upload the above three files on Compass. ( 6

7 Appendix: Linear Programming In this appendix, we will walk through a simple linear programming example. If you want to read more on the topic, a good reference is Linear Programming: Foundations and Extensions by Vanderbei. Some classic texts include Linear Programming by Chvatal; and Combinatorial Optimization: Algorithms and Complexity by Papadimitrou and Steiglitz (in particular, the beginning of chapter 2 may be helpful). A widely available (albeit incomplete) reference is Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein. Example: Consider the following problem. 6 You are given a choice of three foods, namely eggs at a cost of $0.10 an egg, pasta at a cost of $0.05 a bowl, and yogurt at a cost of $0.25 a cup. An egg (t 1 ) provides 3 portions of protein, 1 portion of carbohydrates, and 2 portions of fat. A bowl of pasta (t 2 ) provides 1 portion of protein, 3 portions of carbohydrates, and no portions of fat. A cup of yogurt (t 3 ) provides 2 portions of protein, 2 portions of carbohydrates, and 1 portion of fat. You are required to consume at least 7 portions of protein and 9 portions of carbohydrates per day and are not allowed to consume more than 4 portions of fat. In addition, you obviously may not consume a negative amount of any food. The objective now is to find the cheapest combination of foods that still meet your daily nutritional requirements. This can be written as the following linear program: z = 0.1t t t 3 min (5) 3t 1 + t 2 + 2t 3 7 (6) t 1 + 3t 2 + 2t 3 9 (7) 2t 1 t 3 4 (8) t i 0 i (9) Note that inequality (8) of the LP is equivalent to 2t 1 + t 3 < 4. This corresponds to: t 1 A = b = 9 c = 0.05 t = t t 3 To solve this program using Matlab: c = [0.1; 0.05; 0.25]; A = [3 1 2; 1 3 2; ]; b = [7; 9; -4]; lowerbound = zeros(3, 1); % this constrains t >= 0 [t, z] = linprog(c, -A, -b, [], [], lowerbound) The results of this linear program show that to meet your nutritional requirements at a minimum cost, you should eat 1.5 eggs, 2.5 bowls of pasta, and no cups of yogurt, and the cost for such a diet is $ The problem closely resembles an instantiation of the diet problem by G. J. Stigler, The Cost of Subsistence,

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w CS446: Machine Learning Fall 2013 Problem Set 4 Handed Out: October 17, 2013 Due: October 31 th, 2013 Feel free to talk to other members of the class in doing the homework. I am more concerned that you

More information

Online Algorithm Comparison points

Online Algorithm Comparison points CS446: Machine Learning Spring 2017 Problem Set 3 Handed Out: February 15 th, 2017 Due: February 27 th, 2017 Feel free to talk to other members of the class in doing the homework. I am more concerned that

More information

Homework 1 (a and b) Convex Sets and Convex Functions

Homework 1 (a and b) Convex Sets and Convex Functions Homework 1 (a and b) Convex Sets and Convex Functions CMU 10-725/36-725: Convex Optimization (Fall 2017) OUT: Sep 1 DUE: Prob 1-3 Sep 11, 5:00 PM; Prob 4 Sep 15, 5:00 PM START HERE: Instructions Collaboration

More information

Programming Exercise 3: Multi-class Classification and Neural Networks

Programming Exercise 3: Multi-class Classification and Neural Networks Programming Exercise 3: Multi-class Classification and Neural Networks Machine Learning Introduction In this exercise, you will implement one-vs-all logistic regression and neural networks to recognize

More information

Chapter 15 Introduction to Linear Programming

Chapter 15 Introduction to Linear Programming Chapter 15 Introduction to Linear Programming An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Brief History of Linear Programming The goal of linear programming is to determine the values of

More information

CS 224d: Assignment #1

CS 224d: Assignment #1 Due date: assignment) 4/19 11:59 PM PST (You are allowed to use three (3) late days maximum for this These questions require thought, but do not require long answers. Please be as concise as possible.

More information

CS 224N: Assignment #1

CS 224N: Assignment #1 Due date: assignment) 1/25 11:59 PM PST (You are allowed to use three (3) late days maximum for this These questions require thought, but do not require long answers. Please be as concise as possible.

More information

Matlab and Coordinate Systems

Matlab and Coordinate Systems Matlab and Coordinate Systems Math 45 Linear Algebra David Arnold David-Arnold@Eureka.redwoods.cc.ca.us Abstract In this exercise we will introduce the concept of a coordinate system for a vector space.

More information

Lecture 3: Linear Classification

Lecture 3: Linear Classification Lecture 3: Linear Classification Roger Grosse 1 Introduction Last week, we saw an example of a learning task called regression. There, the goal was to predict a scalar-valued target from a set of features.

More information

CS 224N: Assignment #1

CS 224N: Assignment #1 Due date: assignment) 1/25 11:59 PM PST (You are allowed to use three (3) late days maximum for this These questions require thought, but do not require long answers. Please be as concise as possible.

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

CS40-S13: Functional Completeness

CS40-S13: Functional Completeness CS40-S13: Functional Completeness Victor Amelkin victor@cs.ucsb.edu April 12, 2013 In class, we have briefly discussed what functional completeness means and how to prove that a certain system (a set)

More information

Homework 1 Due Tuesday, January 30, 2018 at 8pm

Homework 1 Due Tuesday, January 30, 2018 at 8pm CSECE 374 A Spring 2018 Homework 1 Due Tuesday, January 30, 2018 at 8pm Starting with this homework, groups of up to three people can submit joint solutions. Each problem should be submitted by exactly

More information

Programming Exercise 1: Linear Regression

Programming Exercise 1: Linear Regression Programming Exercise 1: Linear Regression Machine Learning Introduction In this exercise, you will implement linear regression and get to see it work on data. Before starting on this programming exercise,

More information

CS195H Homework 1 Grid homotopies and free groups. Due: February 5, 2015, before class

CS195H Homework 1 Grid homotopies and free groups. Due: February 5, 2015, before class CS195H Homework 1 Grid homotopies and free groups This second homework is almost all about grid homotopies and grid curves, but with a little math in the middle. This homework, last year, took people about

More information

Computational Intelligence (CS) SS15 Homework 1 Linear Regression and Logistic Regression

Computational Intelligence (CS) SS15 Homework 1 Linear Regression and Logistic Regression Computational Intelligence (CS) SS15 Homework 1 Linear Regression and Logistic Regression Anand Subramoney Points to achieve: 17 pts Extra points: 5* pts Info hour: 28.04.2015 14:00-15:00, HS i12 (ICK1130H)

More information

Matlab and Coordinate Systems

Matlab and Coordinate Systems Math 45 Linear Algebra David Arnold David-Arnold@Eureka.redwoods.cc.ca.us Abstract In this exercise we will introduce the concept of a coordinate system for a vector space. The map from the vector space

More information

CS 374 Fall 2014 Homework 2 Due Tuesday, September 16, 2014 at noon

CS 374 Fall 2014 Homework 2 Due Tuesday, September 16, 2014 at noon CS 374 Fall 2014 Homework 2 Due Tuesday, September 16, 2014 at noon Groups of up to three students may submit common solutions for each problem in this homework and in all future homeworks You are responsible

More information

Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions. 1. Use your ruler and compass to construct a line perpendicular to the line below:

Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions. 1. Use your ruler and compass to construct a line perpendicular to the line below: Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions Name: 1. Use your ruler and compass to construct a line perpendicular to the line below: 2. Suppose the following two points are spaced

More information

Programming Exercise 4: Neural Networks Learning

Programming Exercise 4: Neural Networks Learning Programming Exercise 4: Neural Networks Learning Machine Learning Introduction In this exercise, you will implement the backpropagation algorithm for neural networks and apply it to the task of hand-written

More information

Fall 2017: Numerical Methods I Assignment 1 (due Sep. 21, 2017)

Fall 2017: Numerical Methods I Assignment 1 (due Sep. 21, 2017) MATH-GA 2010.001/CSCI-GA 2420.001, Georg Stadler (NYU Courant) Fall 2017: Numerical Methods I Assignment 1 (due Sep. 21, 2017) Objectives. This class is for you and you should try to get the most out of

More information

6 Randomized rounding of semidefinite programs

6 Randomized rounding of semidefinite programs 6 Randomized rounding of semidefinite programs We now turn to a new tool which gives substantially improved performance guarantees for some problems We now show how nonlinear programming relaxations can

More information

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2017 CS 6820: Algorithms Lecture notes on the simplex method September 2017 1 The Simplex Method We will present an algorithm to solve linear programs of the form maximize subject

More information

Lab 2: Support vector machines

Lab 2: Support vector machines Artificial neural networks, advanced course, 2D1433 Lab 2: Support vector machines Martin Rehn For the course given in 2006 All files referenced below may be found in the following directory: /info/annfk06/labs/lab2

More information

CS2223: Algorithms D-Term, Assignment 5

CS2223: Algorithms D-Term, Assignment 5 CS2223: Algorithms D-Term, 2015 Assignment 5 Teams: To be done individually Due date: 05/01/2015 (1:50 PM) Note: no late submission of HW5 will be accepted; we will talk about the solution of HW5 during

More information

Exam in Algorithms & Data Structures 3 (1DL481)

Exam in Algorithms & Data Structures 3 (1DL481) Exam in Algorithms & Data Structures 3 (1DL481) Prepared by Pierre Flener Tuesday 15 March 2016 from 08:00 to 13:00, in Polacksbacken Materials: This is a closed-book exam, drawing from the book Introduction

More information

Machine Problem 8 - Mean Field Inference on Boltzman Machine

Machine Problem 8 - Mean Field Inference on Boltzman Machine CS498: Applied Machine Learning Spring 2018 Machine Problem 8 - Mean Field Inference on Boltzman Machine Professor David A. Forsyth Auto-graded assignment Introduction Mean-Field Approximation is a useful

More information

CSE 547: Machine Learning for Big Data Spring Problem Set 2. Please read the homework submission policies.

CSE 547: Machine Learning for Big Data Spring Problem Set 2. Please read the homework submission policies. CSE 547: Machine Learning for Big Data Spring 2019 Problem Set 2 Please read the homework submission policies. 1 Principal Component Analysis and Reconstruction (25 points) Let s do PCA and reconstruct

More information

CIS 520, Machine Learning, Fall 2015: Assignment 7 Due: Mon, Nov 16, :59pm, PDF to Canvas [100 points]

CIS 520, Machine Learning, Fall 2015: Assignment 7 Due: Mon, Nov 16, :59pm, PDF to Canvas [100 points] CIS 520, Machine Learning, Fall 2015: Assignment 7 Due: Mon, Nov 16, 2015. 11:59pm, PDF to Canvas [100 points] Instructions. Please write up your responses to the following problems clearly and concisely.

More information

Week 3: Perceptron and Multi-layer Perceptron

Week 3: Perceptron and Multi-layer Perceptron Week 3: Perceptron and Multi-layer Perceptron Phong Le, Willem Zuidema November 12, 2013 Last week we studied two famous biological neuron models, Fitzhugh-Nagumo model and Izhikevich model. This week,

More information

Lab 2: Support Vector Machines

Lab 2: Support Vector Machines Articial neural networks, advanced course, 2D1433 Lab 2: Support Vector Machines March 13, 2007 1 Background Support vector machines, when used for classication, nd a hyperplane w, x + b = 0 that separates

More information

CS/ECE 374 Fall Homework 1. Due Tuesday, September 6, 2016 at 8pm

CS/ECE 374 Fall Homework 1. Due Tuesday, September 6, 2016 at 8pm CSECE 374 Fall 2016 Homework 1 Due Tuesday, September 6, 2016 at 8pm Starting with this homework, groups of up to three people can submit joint solutions. Each problem should be submitted by exactly one

More information

Discrete Optimization. Lecture Notes 2

Discrete Optimization. Lecture Notes 2 Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The

More information

COMP combinational logic 1 Jan. 18, 2016

COMP combinational logic 1 Jan. 18, 2016 In lectures 1 and 2, we looked at representations of numbers. For the case of integers, we saw that we could perform addition of two numbers using a binary representation and using the same algorithm that

More information

Advanced Algorithms and Data Structures

Advanced Algorithms and Data Structures Advanced Algorithms and Data Structures Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Prerequisites A seven credit unit course Replaced OHJ-2156 Analysis of Algorithms We take things a bit further than

More information

General Instructions. Questions

General Instructions. Questions CS246: Mining Massive Data Sets Winter 2018 Problem Set 2 Due 11:59pm February 8, 2018 Only one late period is allowed for this homework (11:59pm 2/13). General Instructions Submission instructions: These

More information

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets? Diagonalization Cardinalities The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets? We say that a set S has at least as great cardinality as set T, written S T, if

More information

Equation to LaTeX. Abhinav Rastogi, Sevy Harris. I. Introduction. Segmentation.

Equation to LaTeX. Abhinav Rastogi, Sevy Harris. I. Introduction. Segmentation. Equation to LaTeX Abhinav Rastogi, Sevy Harris {arastogi,sharris5}@stanford.edu I. Introduction Copying equations from a pdf file to a LaTeX document can be time consuming because there is no easy way

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

1 Case study of SVM (Rob)

1 Case study of SVM (Rob) DRAFT a final version will be posted shortly COS 424: Interacting with Data Lecturer: Rob Schapire and David Blei Lecture # 8 Scribe: Indraneel Mukherjee March 1, 2007 In the previous lecture we saw how

More information

15-780: Problem Set #2

15-780: Problem Set #2 15-780: Problem Set #2 February 19, 2014 1. Constraint satisfaction problem (CSP) [20pts] A common problem at universities is to schedule rooms for exams. The basic structure of this problem is to divide

More information

CS 170 Algorithms Spring 2009 David Wagner MT2

CS 170 Algorithms Spring 2009 David Wagner MT2 CS 170 Algorithms Spring 2009 David Wagner MT2 PRINT your name:, (last) SIGN your name: (first) PRINT your Unix account login: Your TA s name: Discussion section time: Name of the person sitting to your

More information

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007 ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007 This examination is a three hour exam. All questions carry the same weight. Answer all of the following six questions.

More information

A novel supervised learning algorithm and its use for Spam Detection in Social Bookmarking Systems

A novel supervised learning algorithm and its use for Spam Detection in Social Bookmarking Systems A novel supervised learning algorithm and its use for Spam Detection in Social Bookmarking Systems Anestis Gkanogiannis and Theodore Kalamboukis Department of Informatics Athens University of Economics

More information

All lecture slides will be available at CSC2515_Winter15.html

All lecture slides will be available at  CSC2515_Winter15.html CSC2515 Fall 2015 Introduc3on to Machine Learning Lecture 9: Support Vector Machines All lecture slides will be available at http://www.cs.toronto.edu/~urtasun/courses/csc2515/ CSC2515_Winter15.html Many

More information

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability theory,

More information

Homework 2. Due: March 2, 2018 at 7:00PM. p = 1 m. (x i ). i=1

Homework 2. Due: March 2, 2018 at 7:00PM. p = 1 m. (x i ). i=1 Homework 2 Due: March 2, 2018 at 7:00PM Written Questions Problem 1: Estimator (5 points) Let x 1, x 2,..., x m be an i.i.d. (independent and identically distributed) sample drawn from distribution B(p)

More information

To illustrate what is intended the following are three write ups by students. Diagonalization

To illustrate what is intended the following are three write ups by students. Diagonalization General guidelines: You may work with other people, as long as you write up your solution in your own words and understand everything you turn in. Make sure to justify your answers they should be clear

More information

CS 231A Computer Vision (Autumn 2012) Problem Set 1

CS 231A Computer Vision (Autumn 2012) Problem Set 1 CS 231A Computer Vision (Autumn 2012) Problem Set 1 Due: Oct. 9 th, 2012 (2:15 pm) 1 Finding an Approximate Image asis EigenFaces (25 points) In this problem you will implement a solution to a facial recognition

More information

Boolean Functions (Formulas) and Propositional Logic

Boolean Functions (Formulas) and Propositional Logic EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving Part I: Basics Sanjit A. Seshia EECS, UC Berkeley Boolean Functions (Formulas) and Propositional Logic Variables: x 1, x 2, x 3,, x

More information

Convex Optimization / Homework 2, due Oct 3

Convex Optimization / Homework 2, due Oct 3 Convex Optimization 0-725/36-725 Homework 2, due Oct 3 Instructions: You must complete Problems 3 and either Problem 4 or Problem 5 (your choice between the two) When you submit the homework, upload a

More information

Program Verification & Testing; Review of Propositional Logic

Program Verification & Testing; Review of Propositional Logic 8/24: p.1, solved; 9/20: p.5 Program Verification & Testing; Review of Propositional Logic CS 536: Science of Programming, Fall 2018 A. Why Course guidelines are important. Active learning is the style

More information

Advanced Algorithms and Data Structures

Advanced Algorithms and Data Structures Advanced Algorithms and Data Structures Prof. Tapio Elomaa Course Basics A new 7 credit unit course Replaces OHJ-2156 Analysis of Algorithms We take things a bit further than OHJ-2156 We will assume familiarity

More information

CS246: Mining Massive Datasets Jure Leskovec, Stanford University

CS246: Mining Massive Datasets Jure Leskovec, Stanford University CS246: Mining Massive Datasets Jure Leskovec, Stanford University http://cs246.stanford.edu [Kumar et al. 99] 2/13/2013 Jure Leskovec, Stanford CS246: Mining Massive Datasets, http://cs246.stanford.edu

More information

Meeting14:Denotations

Meeting14:Denotations Meeting14:Denotations Announcements Homework 3 due next week Friday at 6:00pm Reminder: 5-minute feedback discussion with Sean is part of the assignment ("interview light") Talk (with me, with the class

More information

CIS 580, Machine Perception, Spring 2014: Assignment 4 Due: Wednesday, April 10th, 10:30am (use turnin)

CIS 580, Machine Perception, Spring 2014: Assignment 4 Due: Wednesday, April 10th, 10:30am (use turnin) CIS 580, Machine Perception, Spring 2014: Assignment 4 Due: Wednesday, April 10th, 10:30am (use turnin) Solutions (hand calculations, plots) have to be submitted electronically as a single pdf file using

More information

AMS : Combinatorial Optimization Homework Problems - Week V

AMS : Combinatorial Optimization Homework Problems - Week V AMS 553.766: Combinatorial Optimization Homework Problems - Week V For the following problems, A R m n will be m n matrices, and b R m. An affine subspace is the set of solutions to a a system of linear

More information

Support Vector Machines.

Support Vector Machines. Support Vector Machines srihari@buffalo.edu SVM Discussion Overview 1. Overview of SVMs 2. Margin Geometry 3. SVM Optimization 4. Overlapping Distributions 5. Relationship to Logistic Regression 6. Dealing

More information

CSE547: Machine Learning for Big Data Spring Problem Set 1. Please read the homework submission policies.

CSE547: Machine Learning for Big Data Spring Problem Set 1. Please read the homework submission policies. CSE547: Machine Learning for Big Data Spring 2019 Problem Set 1 Please read the homework submission policies. 1 Spark (25 pts) Write a Spark program that implements a simple People You Might Know social

More information

LP-Modelling. dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven. January 30, 2008

LP-Modelling. dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven. January 30, 2008 LP-Modelling dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven January 30, 2008 1 Linear and Integer Programming After a brief check with the backgrounds of the participants it seems that the following

More information

CS 170 Algorithms Fall 2014 David Wagner HW12. Due Dec. 5, 6:00pm

CS 170 Algorithms Fall 2014 David Wagner HW12. Due Dec. 5, 6:00pm CS 170 Algorithms Fall 2014 David Wagner HW12 Due Dec. 5, 6:00pm Instructions. This homework is due Friday, December 5, at 6:00pm electronically via glookup. This homework assignment is a programming assignment

More information

COMP108 Algorithmic Foundations

COMP108 Algorithmic Foundations Algorithmic Foundations Basics Prudence Wong http://www.csc.liv.ac.uk/~pwong/teaching/comp108/201617 Crossing Bridge @ Night 1 min each time, 2 persons share a torch they walk @ speed of slower person

More information

11.1 Facility Location

11.1 Facility Location CS787: Advanced Algorithms Scribe: Amanda Burton, Leah Kluegel Lecturer: Shuchi Chawla Topic: Facility Location ctd., Linear Programming Date: October 8, 2007 Today we conclude the discussion of local

More information

Excel for Algebra 1 Lesson 5: The Solver

Excel for Algebra 1 Lesson 5: The Solver Excel for Algebra 1 Lesson 5: The Solver OK, what s The Solver? Speaking very informally, the Solver is like Goal Seek on steroids. It s a lot more powerful, but it s also more challenging to control.

More information

Exercise 2. AMTH/CPSC 445a/545a - Fall Semester September 21, 2017

Exercise 2. AMTH/CPSC 445a/545a - Fall Semester September 21, 2017 Exercise 2 AMTH/CPSC 445a/545a - Fall Semester 2016 September 21, 2017 Problem 1 Compress your solutions into a single zip file titled assignment2.zip, e.g. for a student named

More information

CS103 Handout 14 Winter February 8, 2013 Problem Set 5

CS103 Handout 14 Winter February 8, 2013 Problem Set 5 CS103 Handout 14 Winter 2012-2013 February 8, 2013 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability

More information

Efficient Sequential Algorithms, Comp309. Problems. Part 1: Algorithmic Paradigms

Efficient Sequential Algorithms, Comp309. Problems. Part 1: Algorithmic Paradigms Efficient Sequential Algorithms, Comp309 Part 1: Algorithmic Paradigms University of Liverpool References: T. H. Cormen, C. E. Leiserson, R. L. Rivest Introduction to Algorithms, Second Edition. MIT Press

More information

CS264: Homework #1. Due by midnight on Thursday, January 19, 2017

CS264: Homework #1. Due by midnight on Thursday, January 19, 2017 CS264: Homework #1 Due by midnight on Thursday, January 19, 2017 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. See the course site for submission

More information

CS 125 Section #4 RAMs and TMs 9/27/16

CS 125 Section #4 RAMs and TMs 9/27/16 CS 125 Section #4 RAMs and TMs 9/27/16 1 RAM A word-ram consists of: A fixed set of instructions P 1,..., P q. Allowed instructions are: Modular arithmetic and integer division on registers; the standard

More information

The Simplex Algorithm

The Simplex Algorithm The Simplex Algorithm Uri Feige November 2011 1 The simplex algorithm The simplex algorithm was designed by Danzig in 1947. This write-up presents the main ideas involved. It is a slight update (mostly

More information

Homework 4: Clustering, Recommenders, Dim. Reduction, ML and Graph Mining (due November 19 th, 2014, 2:30pm, in class hard-copy please)

Homework 4: Clustering, Recommenders, Dim. Reduction, ML and Graph Mining (due November 19 th, 2014, 2:30pm, in class hard-copy please) Virginia Tech. Computer Science CS 5614 (Big) Data Management Systems Fall 2014, Prakash Homework 4: Clustering, Recommenders, Dim. Reduction, ML and Graph Mining (due November 19 th, 2014, 2:30pm, in

More information

Supervised Learning with Neural Networks. We now look at how an agent might learn to solve a general problem by seeing examples.

Supervised Learning with Neural Networks. We now look at how an agent might learn to solve a general problem by seeing examples. Supervised Learning with Neural Networks We now look at how an agent might learn to solve a general problem by seeing examples. Aims: to present an outline of supervised learning as part of AI; to introduce

More information

MATLAB TUTORIAL WORKSHEET

MATLAB TUTORIAL WORKSHEET MATLAB TUTORIAL WORKSHEET What is MATLAB? Software package used for computation High-level programming language with easy to use interactive environment Access MATLAB at Tufts here: https://it.tufts.edu/sw-matlabstudent

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

CS 4349 Lecture August 21st, 2017

CS 4349 Lecture August 21st, 2017 CS 4349 Lecture August 21st, 2017 Main topics for #lecture include #administrivia, #algorithms, #asymptotic_notation. Welcome and Administrivia Hi, I m Kyle! Welcome to CS 4349. This a class about algorithms.

More information

Inverse and Implicit functions

Inverse and Implicit functions CHAPTER 3 Inverse and Implicit functions. Inverse Functions and Coordinate Changes Let U R d be a domain. Theorem. (Inverse function theorem). If ϕ : U R d is differentiable at a and Dϕ a is invertible,

More information

W13:Homework:H07. CS40 Foundations of Computer Science W13. From 40wiki

W13:Homework:H07. CS40 Foundations of Computer Science W13. From 40wiki W13:Homework:H07 From 40wiki CS40 Foundations of Computer Science W13 W13:Exams W13:Homework in Class and Web Work W13:Calendar W13:Syllabus and Lecture Notes UCSB-CS40-W13 on Facebook (https://www.facebook.com/groups/ucsb.cs40.w13/)

More information

Meeting 1 Introduction to Functions. Part 1 Graphing Points on a Plane (REVIEW) Part 2 What is a function?

Meeting 1 Introduction to Functions. Part 1 Graphing Points on a Plane (REVIEW) Part 2 What is a function? Meeting 1 Introduction to Functions Part 1 Graphing Points on a Plane (REVIEW) A plane is a flat, two-dimensional surface. We describe particular locations, or points, on a plane relative to two number

More information

Lecture 22 Tuesday, April 10

Lecture 22 Tuesday, April 10 CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,

More information

Machine Learning and Computational Statistics, Spring 2016 Homework 1: Ridge Regression and SGD

Machine Learning and Computational Statistics, Spring 2016 Homework 1: Ridge Regression and SGD Machine Learning and Computational Statistics, Spring 2016 Homework 1: Ridge Regression and SGD Due: Friday, February 5, 2015, at 6pm (Submit via NYU Classes) Instructions: Your answers to the questions

More information

Lecture 2 - Introduction to Polytopes

Lecture 2 - Introduction to Polytopes Lecture 2 - Introduction to Polytopes Optimization and Approximation - ENS M1 Nicolas Bousquet 1 Reminder of Linear Algebra definitions Let x 1,..., x m be points in R n and λ 1,..., λ m be real numbers.

More information

Perceptron Introduction to Machine Learning. Matt Gormley Lecture 5 Jan. 31, 2018

Perceptron Introduction to Machine Learning. Matt Gormley Lecture 5 Jan. 31, 2018 10-601 Introduction to Machine Learning Machine Learning Department School of Computer Science Carnegie Mellon University Perceptron Matt Gormley Lecture 5 Jan. 31, 2018 1 Q&A Q: We pick the best hyperparameters

More information

Introduction to Machine Learning

Introduction to Machine Learning Introduction to Machine Learning Maximum Margin Methods Varun Chandola Computer Science & Engineering State University of New York at Buffalo Buffalo, NY, USA chandola@buffalo.edu Chandola@UB CSE 474/574

More information

PRACTICE FINAL EXAM: SPRING 2012 CS 6375 INSTRUCTOR: VIBHAV GOGATE

PRACTICE FINAL EXAM: SPRING 2012 CS 6375 INSTRUCTOR: VIBHAV GOGATE PRACTICE FINAL EXAM: SPRING 0 CS 675 INSTRUCTOR: VIBHAV GOGATE May 4, 0 The exam is closed book. You are allowed four pages of double sided cheat sheets. Answer the questions in the spaces provided on

More information

I211: Information infrastructure II

I211: Information infrastructure II Data Mining: Classifier Evaluation I211: Information infrastructure II 3-nearest neighbor labeled data find class labels for the 4 data points 1 0 0 6 0 0 0 5 17 1.7 1 1 4 1 7.1 1 1 1 0.4 1 2 1 3.0 0 0.1

More information

6.867 Machine Learning

6.867 Machine Learning 6.867 Machine Learning Problem set 3 Due Tuesday, October 22, in class What and how to turn in? Turn in short written answers to the questions explicitly stated, and when requested to explain or prove.

More information

Graduate Topics in Biophysical Chemistry CH Assignment 0 (Programming Assignment) Due Monday, March 19

Graduate Topics in Biophysical Chemistry CH Assignment 0 (Programming Assignment) Due Monday, March 19 Introduction and Goals Graduate Topics in Biophysical Chemistry CH 8990 03 Assignment 0 (Programming Assignment) Due Monday, March 19 It is virtually impossible to be a successful scientist today without

More information

1. Lecture notes on bipartite matching

1. Lecture notes on bipartite matching Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans February 5, 2017 1. Lecture notes on bipartite matching Matching problems are among the fundamental problems in

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

CS 125 Section #10 Midterm 2 Review 11/5/14

CS 125 Section #10 Midterm 2 Review 11/5/14 CS 125 Section #10 Midterm 2 Review 11/5/14 1 Topics Covered This midterm covers up through NP-completeness; countability, decidability, and recognizability will not appear on this midterm. Disclaimer:

More information

6 Further... Programming

6 Further... Programming 6 Further... Programming In this chapter we ll get some (more) practice building programs and crafting (often) bite-sized chunks of code that solve a specific, normally computational or numerical (rather

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information

Advanced Algorithms Linear Programming

Advanced Algorithms Linear Programming Reading: Advanced Algorithms Linear Programming CLRS, Chapter29 (2 nd ed. onward). Linear Algebra and Its Applications, by Gilbert Strang, chapter 8 Linear Programming, by Vasek Chvatal Introduction to

More information

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}. Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 7 This lecture returns to the topic of propositional logic. Whereas in Lecture Notes 1 we studied this topic as a way of understanding

More information

APPM 2360 Lab #2: Facial Recognition

APPM 2360 Lab #2: Facial Recognition APPM 2360 Lab #2: Facial Recognition Instructions Labs may be done in groups of 3 or less. You may use any program; but the TAs will only answer coding questions in MATLAB. One report must be turned in

More information

Similarity Templates or Schemata. CS 571 Evolutionary Computation

Similarity Templates or Schemata. CS 571 Evolutionary Computation Similarity Templates or Schemata CS 571 Evolutionary Computation Similarities among Strings in a Population A GA has a population of strings (solutions) that change from generation to generation. What

More information

CS 231A Computer Vision (Winter 2014) Problem Set 3

CS 231A Computer Vision (Winter 2014) Problem Set 3 CS 231A Computer Vision (Winter 2014) Problem Set 3 Due: Feb. 18 th, 2015 (11:59pm) 1 Single Object Recognition Via SIFT (45 points) In his 2004 SIFT paper, David Lowe demonstrates impressive object recognition

More information

CS/COE 1501

CS/COE 1501 CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ Introduction Meta-notes These notes are intended for use by students in CS1501 at the University of Pittsburgh. They are provided free of charge and may not be

More information