Documents Found!
As seen in
Less Work, Better Grades
Join
Course Hero
Access
best resources
Ace
your classes
Ace your courses with Course Hero!
|
|
|
Limited, unformatted preview (showing 64 of 2093 words):
...478 CS Machine Learning: Homework 4 Suggested Solutions 1 The Na Bayes Independence Assumption ve P (X = (0, 1, 1, 1, 1) | Y = +1) P (X1 = 0, X2 = 1, X3 = 1, X4 = 1, X5 = 1 | Y = +1) P (X1 = 0, X2 = 1 | Y = +1) P (X1 = 0 | Y = +1)P (X2 = 1 | Y = +1) 0.2 0.6 0.12 (a) For case (i) = = = = = For case (ii) (1) P (X = (0, 1, 1, 1, 1) | Y = +1) = P (X1 = 0, X2 = 1, X3 = 1, X4 = 1, X5 = 1 | Y = +1) = P (X1 = 0 | Y = +1)P (X2 = 1 | Y = +1)P (X3 = 1 | Y = +1)P (X4 = 1 | Y = +1)P (X5 = 1 | Y...
Study Smarter, Score Higher
Here are the top 5 related documents
...CS 498 JH: Introduction to NLP (Fall 08)
Previous key concepts
NLP tasks dealing with words.
Lecture 7: Formal Grammars of English
- POS-tagging, morphological analysis - Finite-State Automata and Finite-State Transducers - Probabilistic FSAs and ...
...Twitter Sources and Sinks
Nathan Matthews nmatthe2@illinois.edu
1
Purpose
Some people who use the Twitter microblogging service are quite prolific, posting dozens of status updates per day. Often these posters go beyond simple status updates to re...
...Cryptography
CS461 - Spring 2007 Nikita Borisov
Research Opportunities
Information Trust Institute undergraduate research internship program
http:/www.iti.uiuc.edu/iti_funding_opportunities.html
Apply by March 5
Overview
Introduction to crypt...
...Access Control Matrix and Safety Results
CS498IA Information Assurance, Spring 2007 Susan Hinrichs
Based on slides provided by Matt Bishop for use with Computer Security: Art and Science Plus HRU examples from Ravi Sandhu
Slide #2-1
Reading
Chapter...
Document Content (unformatted)
Course Hero has millions of student submitted documents similar to the one
below including study guides, homework solutions, papers, exam answer keys and textbook solutions.
478 CS Machine Learning: Homework 4 Suggested Solutions 1 The Na Bayes Independence Assumption ve P (X = (0, 1, 1, 1, 1) | Y = +1) P (X1 = 0, X2 = 1, X3 = 1, X4 = 1, X5 = 1 | Y = +1) P (X1 = 0, X2 = 1 | Y = +1) P (X1 = 0 | Y = +1)P (X2 = 1 | Y = +1) 0.2 0.6 0.12 (a) For case (i) = = = = = For case (ii) (1) P (X = (0, 1, 1, 1, 1) | Y = +1) = P (X1 = 0, X2 = 1, X3 = 1, X4 = 1, X5 = 1 | Y = +1) = P (X1 = 0 | Y = +1)P (X2 = 1 | Y = +1)P (X3 = 1 | Y = +1)P (X4 = 1 | Y = +1)P (X5 = 1 | Y = +1) = 0.2 0.64 = 0.02592 (2) (b) Due to the Naive Bayes assumption, the multivaraite Naive Bayes estimate of the probability is the same as the computation of case (ii) in part (a) above, and is 0.02592. So the two cases cannot be distinguished. (c) For case (i), using the true probability, we have P (X = (0, 1, 1, 1, 1), Y = +1) = P (X = (0, 1, 1, 1, 1) | Y = +1)P (Y = +1) = 0.12 0.5 = 0.06 And P (X = (0, 1, 1, 1, 1), Y = 1) = P (X = (0, 1, 1, 1, 1) | Y = 1)P (Y = 1) = 0.8 0.4 0.5 = 0.16 Therefore by Bayes rule the example X = (0, 1, 1, 1, 1) will be classi ed as 1. 1 (3) (4) For case (ii) using the true probability, we have P (X = (0, 1, 1, 1, 1), Y = +1) = P (X = (0, 1, 1, 1, 1) | Y = +1)P (Y = +1) = 0.02592 0.5 = 0.01296 And P (X = (0, 1, 1, 1, 1), Y = 1) = P (X = (0, 1, 1, 1, 1) | Y = 1)P (Y = 1) = 0.8 0.44 0.5 = 0.01024 By Bayes rule the example X = (0, 1, 1, 1, 1) will be classi ed as +1. Now since the Naive Bayes assumption is true in case (ii), the multivariate Naive Bayes algorithm will classify X as +1 for both case (ii) and also case (i) (in which it makes a wrong independence assumption). So the Naive Bayes classi er gives a classi cation that is di erent from that arise from the true probabilities in case (i). (d) For case (i) where X2 , X3 , X4 , X5 are completely dependent, after splitting using of these attributes it becomes pointless to split using any of the remaining three since they give zero information gain (since the attributes always have same values). So the decision tree would split using X1 and only one of X2 , X3 , X4 , X5 and then stop. For case (ii) where X2 , X3 , X4 , X5 are independent, we obtain some positive information gain by splitting on each of these attributes due to independence. Since we assume that the decision tree algorithm does not do early stopping, a full tree will be grown using all 5 attributes. Thus we can see that the decision tree algorithm can distinguish between case (i) and case (ii) by considering the information gain of di erent attributes. Indeed it is not hard to see that the decision trees produced in each of the two cases gives the best decision rule possible, i.e., acheiving the Bayes error. Comment: Most of you have no trouble with this question, except some small careless mistakes while manipulating the probabilities. (5) (6) 2 Na Bayes for Text Classi cation ve (a) The rst assumption is the Naive Bayes assumption that the conditional probability of observing a document given the class is the product of the conditional probability of observing each individual word given the class. The second simplifying assumption is that the conditional probability of a word given the class is independent of the position of the word in the document. 2 (b) The multinomial Naive Bayes model take into account the length of the document in its probabilities, while the multivariate model is only concerned with whether the word appears in the document (so that the representation of a single-word document oil is the same as a ten-word document with the word oil repeated 10 times, with same probability). On the other hand, the multivariate model explicits take into account the probability of the absence of di erent words in its probability model, while the multinomial model does not. (c) crude oil: multivariate: train: 0.9132 test: 0.9139 multinomial: train: 0.9816 test: 0.9738 mac: multivariate: train: 0.8366 test: 0.8092 multinomial: train: 0.9618 test: 0.8827 An example python script for the program is appended at the end of this solutions. (d) Top ten 254 286 955 1678 2937 1282 3144 1734 1426 1372 words from bpd opec bbl herrington pdvsa api saudis aegean texaco re neries the multinomial model: 835.784508254 445.829340754 370.166397806 363.182126149 342.229311179 314.292224552 293.339409582 279.370866269 279.370866269 251.433779642 Top ten words from the multivariate model: 3 955 254 1372 731 1395 1282 1868 2064 1678 1426 bbl bpd re neries distillate postings api petroleos wti herrington texaco 468.0 442.0 358.8 327.6 312.0 296.4 280.8 249.6 249.6 249.6 (e) using default parameters for C and linear kernel crude train: 0.9841 crude test: 0.9755 mac train: 0.8975 mac test: 0.8504 Comment: In part (c) we accept accuracies within 1 to 2 percent as correct, and points are deducted by how far o the accuracies are. In part (d) most of you did the estimation correctly and obtain the right words. In part (e) since the question did not specify what parameters to use for the SVM, using the default parameters or some careful selection of C will both result in full credit. 3 Linear Discriminant Analysis P (Y = +1)e 2 1 (a) According to Bayes rule, we classify an example as +1 if x + 2 > P (Y = 1)e 2 2 1 x 2 log P (Y = +1) 1 x + 2 > log P (Y = 1) 1 x 2 2 1 P (Y = +1) [ x + 2 x 2 ] + log( )>0 2 P (Y = 1) 1 P (Y = +1) [x x 2 + x + + + x x + 2 x ] + log >0 2 P (Y = 1) + 2 2 P (Y = +1) ( + ) x + log >0 2 P (Y = 1) (7) Therefore we can see that the LDA classi cation rule can be rewritten in the form of 2 2 P (Y =+1) sign(w x + b), with w = + and b = + + log P (Y = 1) 2 (b) In this particular case + = 1, = 1, so w = 2. As the positive class is twice as likely as the negative class, we have P (Y = +1)/P (Y = 1) = 2, so b = log 2. Therefore the decision rule is sign(2x + log 2) = sign(x + 1/2 log 2). An positive example becomes an error if it lies to the left of 1/2 log 2, and likewise a negative 4 example becomes an error if it lies to the right of the 1/2 log 2. Therefore the error rate of this decision rule is: 1 2 log 2 P (Y = +1) 1 (x 1)2 e 2 dx + P (Y = 1) 2 1 log 2 2 1 2 1 2 log 2 1 (x+1)2 e 2 dx 2 = = = 2 3 2 3 1 2 1 2 1 log 2 1 (x 1)2 1 e 2 dx + 3 2 1 (x 1)2 1 e 2 dx + 3 2 1 (x+1)2 e 2 dx 2 1 (x 1)2 e 2 dx 2 1 x2 e 2 dx 2 (8) log 2 log 2 1 2 2 2 log 2 1 1 x2 1 e 2 dx + 3 3 2 2 1 = (0.0891) + (0.2567) 3 3 = 0.1450 log 2 1 Therefore the error rate is 0.1450 for the LDA. (c) Suppose a xed b is given. For yi = 1, we have i = 1 b xi for xi < 1 b, and 0 otherwise. For yi = 1, we have i = 1 + b + xi for xi > 1 b, and 0 otherwise. (All these can be checked by looking at the constraints). Therefore the objective can be expressed as: n i i=1 (9) (1 b xi ) + (1 + b + x) 1 i n,yi = 1,xi > 1 b = 1 i n,yi =1,xi <1 Since b the examples xi , yi are generated according to the LDA model, in the large sample limit, we can replace the sum with integral and obtaint the following expression for the objective (actually, the objective divided by the sample size n): 1 b P (Y = 1) 1 (x 1)2 (1 b x) exp( )dx + P (Y = 1) 2 2 1+b (x + 1)2 1 )dx (1 + b + x) exp( 2 2 1 b 2 = 3 = 2 3 1 b b 1 (x 1)2 1 (1 b x) exp( )dx + 2 3 2 2 b 1 (x 1)2 (1 + b x) exp( )dx 2 2 1 y 1 ( b y) exp( )dy + 2 3 2 1 y2 (b y) exp( )dy 2 2 (10) To nd out the minimizer, we can di erentiate the objective with respect to b and set it to zero. For the rst term, using the product rule for di erentiation and di erentiation 5 under the integral sign, the derivative is: d db = 1 y2 ( b y) exp( )dy 2 2 b b y2 b2 b2 1 1 1 exp( )dy b exp( ) ( b) exp( ) 2 2 2 2 2 2 = ( b) (11) where is the cumulative distribution function of the standard normal distribution. Similarly we have derivative of the second term to be (b). Setting the derivative to zero, we have 1 2 ( b) + (b) = 0 3 3 2 ( b) = (b) (12) Since the standard normal distribution is symmetric, we have ( b) = 1 (b), and the above equation reduces to (b) = 2/3. Looking up the normal distribution table we have b = 0.43. Using similar calculations as in part (b), we can nd out the error rate of this decision boundary is 0.1457, which is greater than the LDA decision boundary. Thus the SVM is not Bayes optimal in this case. Comment: Most of you have no problem with part (a) and (b). The work in part (c) is more complex than what this course required and was intended as a challenge type of question. Many of you do come up with good solutions, either through hand calculations or by solving the problem numerically. 4 4.1 Appendix Multinomial Naive Bayes # 24 March 2008 # naive bayes classifier import math import sys SIZE_VOCAB = 27658 category = "crude" in_file = open(category+".train","r") count = {} 6 count[-1]=0 count[1]=0 # initialize the word count array word_count = {} word_count[-1] = map(lambda x:0, range(SIZE_VOCAB+1)) word_count[1] = map(lambda x:0, range(SIZE_VOCAB+1)) class_word_count={} class_word_count[-1]=0 class_word_count[1]=0 for line in in_file.readlines(): vector = line.split() label = int(vector[0]) count[label]+=1 words = vector[1:] for word in words: (feature_num, freq) = word.split(":") feature_num = int(feature_num) freq = int(freq) word_count[label][feature_num]+=freq class_word_count[label]+=freq in_file.close() # conditional probabilities, with Laplacian smoothing # binary-valued cond_prob = {} cond_prob[-1] = map(lambda x:0, range(SIZE_VOCAB+1)) cond_prob[1] = map(lambda x:0, range(SIZE_VOCAB+1)) for feature_num in range(1,SIZE_VOCAB+1): cond_prob[-1][feature_num] = (word_count[-1][feature_num]+1.0)\ /(class_word_count[-1]+SIZE_VOCAB) cond_prob[1][feature_num] = (word_count[1][feature_num]+1.0)\ /(class_word_count[1]+SIZE_VOCAB) # training set accuracy in_file = open(category+".train","r") num_error = 0 7 num_examples = 0 for line in in_file.readlines()[1:]: vector = line.split() label = int(vector[0]) words = vector[1:] pos_log_lr = math.log(count[1]) neg_log_lr = math.log(count[-1]) for word in words: feature_num = int(word.split(":")[0]) pos_log_lr += math.log(cond_prob[1][feature_num]) neg_log_lr += math.log(cond_prob[-1][feature_num]) if pos_log_lr-neg_log_lr>0: prediction = 1 else: prediction = -1 if prediction!=label: num_error+=1 # to avoid division by zero # exponeitate the log-likelihood ratio if prediction==1: # compute P(X,Y=1)/(P(X,Y=1)+P(X,Y=-1)) by # 1/(1+exp(log(P(X,Y=-1)/P(X,Y=+1)))) print "incorrectly predict +1" print 1/(1+math.exp(neg_log_lr-pos_log_lr)) else: print "incorrectly predict -1" print 1/(1+math.exp(pos_log_lr-neg_log_lr)) num_examples+=1 print print print print "Total number of errors:" num_error "Accuracy:" float(num_examples-num_error)/num_examples in_file.close() # find top 10 most predictive words ratio_list = zip(cond_prob[1],cond_prob[-1]) ratio_list = map(lambda x: x[0]/x[1], ratio_list[1:]) rankings = zip(ratio_list, range(1,SIZE_VOCAB+1)) rankings.sort() 8 # load list of words in_file = open("words.train.top","r") vocab_list = in_file.readlines() in_file.close() vocab_list = map(lambda x: x.strip(), vocab_list) topten = rankings[-20:] topten.reverse() for pair in topten: out_str = str(pair[1])+" "+vocab_list[pair[1]-1]+" "+str(pair[0]) print out_str 4.2 Multivariate Naive Bayes # 26 March 2008 # naive bayes classifier import math SIZE_VOCAB = 27658 category = "crude" in_file = open(category+".train","r") count = {} count[-1]=0 count[1]=0 # initialize the word count array word_count = {} word_count[-1] = map(lambda x:0, range(SIZE_VOCAB+1)) word_count[1] = map(lambda x:0, range(SIZE_VOCAB+1)) for line in in_file.readlines(): vector = line.split() label = int(vector[0]) count[label]+=1 words = vector[1:] for word in words: feature_num = int(word.split(":")[0]) word_count[label][feature_num]+=1 in_file.close() 9 # conditional probabilities, with Laplacian smoothing # binary-valued cond_prob = {} cond_prob[-1] = {} cond_prob[1] = {} cond_prob[-1][0] = map(lambda x:0, range(SIZE_VOCAB+1)) cond_prob[-1][1] = map(lambda x:0, range(SIZE_VOCAB+1)) cond_prob[1][0] = map(lambda x:0, range(SIZE_VOCAB+1)) cond_prob[1][1] = map(lambda x:0, range(SIZE_VOCAB+1)) for feature_num in range(1,SIZE_VOCAB+1): cond_prob[-1][1][feature_num] = (word_count[-1][feature_num]+1.0)/(count[-1]+2) cond_prob[-1][0][feature_num] = ((count[-1]-word_count[-1][feature_num])+1.0)/(count[-1]+2) cond_prob[1][1][feature_num] = (word_count[1][feature_num]+1.0)/(count[1]+2) cond_prob[1][0][feature_num] = ((count[1]-word_count[1][feature_num])+1.0)/(count[1]+2) # training set accuracy in_file = open(category+".test","r") num_error = 0 num_examples = 0 print count[1] print count[-1] base_lr = math.log(float(count[1])/count[-1]) for i in range(1, SIZE_VOCAB+1): base_lr += (math.log(cond_prob[1][0][i]) - math.log(cond_prob[-1][0][i])) for line in in_file.readlines(): vector = line.split() label = int(vector[0]) words = vector[1:] log_lr = base_lr for word in words: feature_num = int(word.split(":")[0]) log_lr += (math.log(cond_prob[1][1][feature_num])-math.log(cond_prob[-1][1][feature_num]) - math.log(cond_prob[1][0][feature_num]) + math.log(cond_prob[-1][0][feature_num])) if log_lr>0: prediction = 1 else: prediction = -1 10 if prediction!=label: num_error+=1 print num_error num_examples+=1 in_file.close() print float(num_examples-num_error)/num_examples # find top 10 most predictive words ratio_list = zip(cond_prob[1][1],cond_prob[-1][1]) ratio_list = map(lambda x: x[0]/x[1], ratio_list[1:]) rankings = zip(ratio_list, range(1,SIZE_VOCAB+1)) rankings.sort() # load list of words in_file = open("words.train.top","r") vocab_list = in_file.readlines() in_file.close() vocab_list = map(lambda x: x.strip(), vocab_list) topten = rankings[-20:] topten.reverse() for pair in topten: out_str = str(pair[1])+" "+vocab_list[pair[1]-1]+" "+str(pair[0]) print out_str 11
Textbooks related to the document above:
Find millions of documents here - Study Guides, Homework Solutions, Papers, Exam Answer Keys and more.
Course Hero has millions of course related materials that will enable you to learn better,
faster and get an A in all your courses.
Below is a small sample set of documents:
Below is a small sample set of documents:
Cornell >> CS >> 478 (Spring, 2008)
CS 478 Machine Learning: Homework 5 Suggested Solutions 1 The Viterbi Algorithm is (rain, rain, snow). skiing 0.00144 0.000432 0.000288 0.00216 (a) The most likely sequence of weather running programming sunny 0.12 0.0108 0.18 0.0108 rain cloudy ...
Cornell >> CS >> 482 (Spring, 2008)
4 1/23/08 - Stable Matching, part 2. Lecture: Stable matching, part 2. Gale-Shapley Algorithm /* Init. */ All men and women are free. /* main loop */ while a free man m Assert: there exists a woman w that m hasnt proposed to. Let w be the highest-r...
Cornell >> CS >> 478 (Spring, 2008)
CS 478 Machine Learning: Homework 3 Suggested Solutions 1 SVM inside-out, the Primal (15 points) (a) It is easy to check that for the soft margin SVM, w = 0, = 1 is always a feasible solution. All the constraints are satised. (b) Consider the it...
Cornell >> CS >> 482 (Spring, 2008)
20 2/29/08 - The preow-push algorithm. The Preow-Push Algorithm Def. A preow in a ow network is a function f: E -> + s.t. (i) 0 f(e) ce (ii) v s eIn(v)f(e) - eOut(v)f(e) =: ef(v) 0 excess at v Def. A labeling is a function h: V -> 0 . It is com...
Cornell >> CS >> 482 (Spring, 2008)
26 3/14/08 - The Cook-Levin Theorem Today: The Cook-Levin Theorem (3SAT is NP-complete) Step 1: 4SAT p 3SAT p? 2SAT (no reduction to 2SAT) <- p Given 4SAT instance (x1 x2 x3 x4) (x2 x4 x5 x6) (x1 x2 z1) (z1 x3 x4) (x2 x4 z2) (z2 x5...
Cornell >> CS >> 482 (Spring, 2008)
27 3/24/08 - NP-complete sequencing pro. NP: problems whose solution can be eficiently (poly-time) veried. Ex: Compositeness: Given n-bit number x, in x composite? Hint: a pair y,z > 1 such that yz = x. NP-Complete: a problem X which is in NP and ev...
Cornell >> CS >> 482 (Spring, 2008)
28 3/26/08 - NP-complete partitioning pro. Reduction from 3SAT to HAM. CYCLE Theorem. HAM CYCLE is NP-Complete Proof. (1) Its in NP. Show me the cycle, and I can verify it in O(n) time. (2) The reduction runs in poly(n) time. Let b = length of each ...
Cornell >> CS >> 482 (Spring, 2008)
29 3/28/08 - NP-complete coloring proble. NP-complete problems 3SAT, k-SAT (k > 3) IND. SET CLIQUE VERTEX COVER HAMILTONIAN PATH/CYCLE TRAV. SALES. PROB. Reduce FROM . TO (e.g. set cover) if you could use set cover to solve trav salesman in poly tim...
Cornell >> CS >> 482 (Spring, 2008)
11 2/8/08 - Divide and conquer algorithms. Lecture: Divide and conquer algorithms in computational geometry: nding the closest pair of points Reading: Chapter 5.4 cs482-02-08-08-Audio.mp4 Closest pair of points Given n numbers x1, x2, . , xn Find i,...
Cornell >> CS >> 478 (Spring, 2008)
CS 478 Machine Learning: Homework 2 Suggested Solutions 1 Separable or Not? (a) See the following tree: (b) If we draw a large enough sample, there would be at least two points on each of the four positions. Since there is no noise in the label,...
Cornell >> CS >> 478 (Spring, 2008)
CS 478 Machine Learning: Homework 1 Suggested Solutions 1 kNN Decision Boundaries (a) (b) (c) It would be classied as circle. Adding one point is enough, say a cross at exactly (1,-1). (d) It would be classied as circle. The ve closest points ar...
Cornell >> CS >> 482 (Spring, 2008)
13 2/13/08 - Computing RNA secondary str. RNA: a single-stranded molecule made up of {A, C, G, U} Secondary structure: certain base pairs on same molecule match up Constraints: (i) A pairs only with U C pairs only with G U pairs only with A G pairs ...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 9 (1) Let T be the number of trucks used by the algorithm, and suppose the trucks are labeled 1, 2, . . . , T in the order that the algorithm loads them up. Observe that for i = 1, 2, . . ...
Cornell >> CS >> 482 (Spring, 2008)
30 3/31/08 - NP-complete numerical probl. NP-Complete Problems 3SAT Vtx Cover Indep. Set (even in deg 3) Clique Hamiltonian Path Set cover/packing Traveling salesman 3D matching Subset Sum. 3-D Matching Given sets X, Y, Z, with n elts each. Given 3...
Cornell >> LING >> 404 (Spring, 2008)
4 1/23/08 - Case Theory; distribution of PRO 4 levels of structure D structure move S-structure move LF PF For next week: read rst 2 chapters Londau D-Structure and S-structure connected by move-alpha Passive: _ was arrested John Johni was arrest...
Cornell >> LING >> 404 (Spring, 2008)
5 1/28/08 - Binding Theory The binding theory divides into three types of things anaphors, pronouns, R-expressions The binding theory has three conditions. A. An anaphor must be bound in its governing category. C-Command condition: *Himselfi pinche...
Cornell >> LING >> 404 (Spring, 2008)
6 1/30/08 - PRO Reformulated the Case Filter as Visibility Condition New problem: It is still the case that it is not possible for PRO to occur in a nonCase position. Just restating the Case Filter doesnt entirely solve the problems, because we stil...
Cornell >> LING >> 404 (Spring, 2008)
8 2/11/08 - pro ling404-02-11-08-Audio.mp4 PRO [-a, +p] John spoke. He spoke. *spoke. Italian: (Gianni) ha parlato. Empty pronominal element. Johni said [that hei spoke.] Giannii ha detto che ei parlato pro <Gianni,pro> cannot form a chain. wh-trace...
Cornell >> LING >> 404 (Spring, 2008)
9 2/13/08 - more pro What can we do about languages where there is no morphology to tell us about pro? e.g. Chinese ability to drop subject in presence of rich morphology. BUT in Chinese etc. no morphology at all - what licenses dropping subject? Yo...
Cornell >> LING >> 404 (Spring, 2008)
10 2/18/08 - A-Movement We have been mainly talking so far about A-movement movement of subjects and objects into the subject position. A movement exemplied by wh-movement I wonder [who John talked to _ ] embedded clause - the who winds up to the le...
Cornell >> LING >> 404 (Spring, 2008)
11 2/20/08 - Subjacency Homework back on Monday - also new hw due Ross Island Constraint Want to derive binding constraints from a more general principle Chomsky: Subjacency attempts to unify a subset of the constraints allows us to dispense with th...
Cornell >> LING >> 404 (Spring, 2008)
12 3/3/08 - Relativized Minimality Trace eect you cant extract out of a subject position when there is an overt complementizer Chomsky introduces new barrier Minimality barrier X can sometimes be barriers Who did you say [t [C that t read the book ...
Cornell >> CS >> 482 (Spring, 2008)
Solution Set for CS 482, Prelim 2 April 8, 2008 Questions in red, solutions in black. PROBLEM 1 (20 points) PART A (15 points) Find a maximum flow and minimum s-t cut in the flow network G shown here. The source and sink are s and t, respectively. Th...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 2 (1) The algorithm restores the websites in decreasing order of ci /ti , where ci is the rate of lost dollars per hour for site i, and ti is the number of hours to nish the job. Analysis ...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 3 (1) We describe an algorithm Test(S) whose input is a set S of bank cards and whose output is: a bank card x S such that more than half the elements of S are equivalent to x, if any su...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 3 (1) (a) Heres a counterexample in which n = 3. Week 1 Week 2 Week 3 1 1 1 0 3 10 i hi The optimal solution picks the low-stress job in week 1 and the high-stress job in week 3. The gr...
Cornell >> CS >> 482 (Spring, 2008)
38 4/21/08 - Randomized algorithms Randomized Algorithms Review Ch. 13.12, read 13.1 - 6. A probability space consists of a sample set (nite in CS 482) and a probability 0 Pr(x) 1 for every x , s.t. x(x) = 1. Examples. Flipping coin n times = {...
Cornell >> CS >> 482 (Spring, 2008)
CS 482 FINAL EXAM SOLUTION SET (1) (10 points) Each of the following statements is false. Give a counterexample to each of them. (1a) (5 points) If G is any graph with non-negative edge costs, and e is any edge such that every minimum-cost spanning...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 7 (1) First, we prove that Party Invitation is in NP. There is a polynomial-time verier that takes an instance I of Party Invitation consisting of numbers n, k, lists Pi (1 i k), and va...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 5 (1) (a) If e is contained in a min-cut (A, B), let C be the capacity of this cut. Every max-ow f has value v(f ) = C, and such a ow must saturate every edge of the min-cut, including edg...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 6 (1) (a) To compute whether the blood on hand meets the projected demand, one can construct a ow network with 10 vertices. A super-source s. For each blood type x, a pair of vertices ux...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 8 (1) The algorithm resembles the Greedy-Balance algorithm given in Section 11.1. For each machine Mi , we maintain a variable Ti which keeps tracks of the total amount of time required fo...
Cornell >> CS >> 4410 (Fall, 2008)
CS4410 - Fall 2008 Assignment 1 Solution Q1. Give three examples of an explicit hardware mechanism that is motivated by specific OS services. Answer: Atomic operations for synchronization. Kernel/user mode, base/limit registers, protected instruction...
Cornell >> CS >> 4410 (Fall, 2008)
CS4410 - Fall 2008 Homework 2 Solution Due September 23, 11:59PM Q1. Explain what goes wrong in the following version of Dekkers Algorithm: CSEnter(int i) { inside[i] = true; while(inside[j]) { inside[i] = false; while(turn = j) continue; inside[i] =...
Cornell >> CS >> 482 (Spring, 2008)
17 2/22/08 - Introduction to network ow Network Flow Def: A ow network is a directed graph G = (V, E) with edge capacities ce (e E), ce 0 (usually integers) vertices s (source), t (sink) Notations: A vertex v s, t is an internal node. In(v) = {e...
Cornell >> CS >> 482 (Spring, 2008)
16 2/20/08 - Review of dynamic programm. Chapter 6, Problems 4, 5, 11 Prelim tomorrow 7:30-9, Upson B17 Chapter 1, 4, 5, 6 Design techniques Greedy, Divide and Conquer, Dynamic Programming Key algorithms Gale-Shapley, Kruskal, Prim, Bellman-Ford Key...
Cornell >> CS >> 482 (Spring, 2008)
60 2/22 - Chapter 7.1 - The Maximum-Flo. Graphs to model transportation networks - networks whose edges carry some sort of trafic and whose nodes act as switches passing trafic between dierent edges a highway system - edges are highways, nodes are i...
Cornell >> CS >> 482 (Spring, 2008)
15 2/18/08 - Bellman-Ford shortest path al. Shortest Paths with Negative Edge Lengths (Bellman-Ford) Example: Dijkstra can go wrong. Can you add a constant to every edge length and then run Dijkstra? 15-1 You cant have negative cycles Examples C...
Cornell >> CS >> 482 (Spring, 2008)
14 2/15/08 - Edit distance Homework 2 in Upson 360 by 2pm today Prelim next week, Thursday evening - 2 algorithm questions, questions about lectures Dynamic programming review questions Techniques: (1) Greedy (2) Div. + Conq (3) Dyn. Prog. Ch. 4-6 I...
Cornell >> CS >> 482 (Spring, 2008)
3 1/21/08 - Stable Matching, part 1 Lecture: Stable matching, part 1. Reading: Chapter 1.1; Chapters 2,3 (1) Formulating algorithmic problems as mathematically wellpoised questions (2) Distinguishing easy from hard (3) General techniques for designi...
Cornell >> CS >> 482 (Spring, 2008)
Introduction to Algorithms CS 482, Spring 2008 Solution Set 9 (1) There are many correct solutions; here is one. The graph has two vertices s, t and n triples of vertices (ui , vi , wi )n , for a total of 3n + 2 vertices. There are 5n edges, specie...
Cornell >> CS >> 482 (Spring, 2008)
12 2/11/08 - Introduction to dynamic progr. Lecture: Introduction to dynamic programming; weighted interval scheduling Reading: Chapter 6.1 Chapter 6: Dynamic Programming First example: Weighted Interval Scheduling Goal: nd a set of non-overlapping ...
Cornell >> CS >> 482 (Spring, 2008)
9 2/4/08 - Divide and conquer algorithms:. Lecture: Divide and conquer algorithms: Multiplying polynomials and integers (Karatsuba\'s algorithm) Reading: Chapter 5.1, 5.2, 5.5 Divide & Conquer Mergesort Binary search Quicksort Algebra + Geometry Poly...
Cornell >> CS >> 482 (Spring, 2008)
8 2/1/08 - Implementing Kruskals algorit. Lecture: Implementing Kruskal\'s algorithm using union-nd. Reading: Chapter 4.6 Kruskals Algorithm Sort edges by increasing cost O(mlogn) T< For each edge (u, v) in this order if u, v are not in same componen...
Cornell >> CS >> 482 (Spring, 2008)
7 1/30/08 - Minimum spanning tree; Krus. Lecture: Minimum spanning tree; Kruskal\'s algorithm. Reading: Chapter 4.5 cs482-01-30-08-Audio.mp4 Minimum spanning tree Given G = (V,E) undirected, connected Costs ce > 0 for every e E. Goal: output connect...
Cornell >> CS >> 482 (Spring, 2008)
6 1/28/08 - Five Representative Problems Lecture: Five representative problems Reading: Chapter 1.2 Earliest Start Time with Pre-emption (1) Preprocess the input to remove jobs whose interval contains another jobs interval (2) Sort the remaining job...
Cornell >> CS >> 482 (Spring, 2008)
5 1/25/08 - Greedy Scheduling Algorithms Lecture: Greedy scheduling algorithms Reading: Chapter 4.1, 4.2 Interval Scheduling (jobs) Input: A set of pairs (si, ti)Ti=1 0 si ti T, si, ti N Output: A feasible schedule: a subset of the pairs, s.t. t...
USC >> REL >> 121G (Spring, 2008)
*Women at age 7, remain in women quarter. Food preparation, salad bread, but not meat. Learn skills of spinning and weaving(clothes). *Weaving: peplos(dress), piece of cloth, 5 to 6 feet. 2 steps: 1)Talasiourgein: working with allotment.cleaning, com...
USC >> MKT >> buad307 (Spring, 2008)
Budget: I think the ideal allocation strategy for advertising, promotion, and marketing research is 30% from gross profit. Huggies is under Kimberly-Clark corp. (note: gaz, I couldnt find the specific financial statement for huggies, so the statement...
USC >> MKT >> buad307 (Spring, 2008)
Focus group ...
USC >> MKT >> buad307 (Spring, 2008)
1.What is Integrated Marketing Communications? Give examples to support your answer. A concept of marketing communications planning that recognizes the added value of a comprehensive plan that evaluates the strategic roles of a variety of communicati...
USC >> REL >> 121g (Fall, 2008)
1)Literary ethnography: Historical writings. Provide descriptive study of human societies. 2)Independent peasant: 3)Chora: 4)Kyrios: 5)Gorgias: 6)Mageiros: 7)Dorkon: 8)Lycainion: 9)Syntrophos: 10)Aristocratic household: 11)Eros: 12)Kottalos: 13)Prima...
Texas College >> HIST >> 106 (Spring, 2008)
Theodore Roosevelt (Teddy) - TR became president in 1901. - He led an endlessly fascinating life, advocated the strenuous life, and largely created the modern presidency: he had many carriers, politician, cattle rancher, mountain climber, soldier, go...
Texas College >> HIST >> 106 (Spring, 2008)
National Origins Act: It was an anti immigration legislation. Hostility against immigration had been growing since the late 19th century. Many people felt that US was bring swapped by undesirable immigrants. The opstition to immigration had been gro...
Texas College >> HIST >> 106 (Spring, 2008)
- The Open Door Notes: The US interest grew in the eastern Asia and China. Chinas government was very weak, and it was unable to control its borders. As a result, empyreal powers moved in like Germany, France, Russia, Japan, England. The empyreal pow...
Texas College >> HIST >> 106 (Spring, 2008)
Woodrow Wilson: He believed in a strong activist government. He also believed that the government should do things and the president should do things. He believed that he should be Americas president and to be Americas destiny. He didnt like to compr...
Texas College >> HIST >> 106 (Spring, 2008)
Threats to the system: Rise of Germany Nationalism in the Balkans Security By 1914, the continent had bound itself into two competing blocks: a. Entente They were France, Russia and Britain. There were smaller forces involved. b. Central Powers They ...
Texas College >> HIST >> 106 (Spring, 2008)
Origins: Muckrakers: Who and what they did: They helped to make progressivism a national movement. Journalists and novelists who investigated and revealed the seamy details of corporate wrong doing, corruption in politics and the harsh realities of s...
Texas College >> HIST >> 106 (Spring, 2008)
The treaty of Versailles: As part of the treaty several new nations were created in Europe and the middle east. Ugoslavia, Chekoslovakia, Poland, finland. The League of Nations: Wilson essentially scarified the rest of the 14 points for this point. T...
Texas College >> HIST >> 106 (Spring, 2008)
Major industries that had fuels the American economy were weakening. Thus didnt have the power to stimulate the economy as before. New industries such as chemicals, appliances, food processing werent yet strong enough to prevent depression or to ease...
Texas College >> HIST >> 106 (Spring, 2008)
Loans and Peace: American opinion: Many Americans of German and Irish ancestors favored Germany in the war. The most officials in the government favored France due to common language, economic ties and culture. They viewed Britain and France as those...
Texas College >> HIST >> 106 (Spring, 2008)
Results of Prohibition: Positive: - Alcohol consumption declined as did - arrest for public drunkness and - death caused by alcohol. Negative: -millions of Americans broke the law - Strenghthened organized crime - Undermined public morality by encour...
Texas College >> HIST >> 106 (Spring, 2008)
Progressivism: By the 1890, people are fed up and they realize that something should be done for all the problems in America. Progressivism was the solution. However there was not a unified movement which agreed upon a set of goals. It was diverse mo...
Virginia Tech >> ENGE >> 1024 (Fall, 2006)
Math Review Worksheet ENGE 1024 Fall 2006 Instructions This is to be completed in 30 minutes using a scientific calculator and no reference material. Conversions 12 inches = 1 foot 3 feet = 1 yard 1 meter = 3.281 feet 1 mile = 5,280 feet Questions 1...
Virginia Tech >> STAT >> 2004 (Fall, 2006)
...
Virginia Tech >> STAT >> 2004 (Fall, 2006)
Stat 2004 Practice Exam 1. In 1798 the English scientist Henry Cavendish measured the density of the earth with great care. It is common practice to repeat careful measurements several times and use the mean as the final result. Cavendish repeated hi...
Virginia Tech >> CHEM >> 1035 (Fall, 2006)
Chemistry 1035 Fall-06 Test 2 Name_ Form A 1. Which of the following salts is Insoluble in water? a) Sodium sulfate b) Potassium acetate c) Lithium carbonate d) All of these are soluble in water 2. Given the following pairs of solutions, which one w...
Virginia Tech >> CHEM >> 1035 (Fall, 2006)
General Chemistry 1035 Test 1 Form A Name_ 1. A wooden cube has density 0.27 g/cm3 and a mass of 39 g. Find the length of its sides. a. b. c. d. 140 cm 5.2 cm 42 cm 2.6 cm 2. Find the temperature on the Kelvin scale which is exactly 5 times its equi...
Virginia Tech >> ENGE >> 1024 (Fall, 2006)
Engineering Exploration ENGE1024 Workshop#7 Fall 2006 1. Problem Solving Part (individual and group work) Show that the volume of a solid pool noodle that has a cross section matching a regular polygon is given by: V= a 2 nL 360 4 tan 2n (Equati...
Virginia Tech >> ENGE >> 1024 (Fall, 2006)
Department of Engineering Education Virginia Polytechnic Institute and State University Copyright: J. C. Malzahn Kampe, 2004, 2005 Fall 2005 Page 1 of 6 Significant Figures Supplement EngE 1024 First, lets look at the definitions of four basic te...
What are you waiting for?