Homework : Data Mining SOLUTIONS

Size: px
Start display at page:

Download "Homework : Data Mining SOLUTIONS"

Transcription

1 Homework : Data Mining SOLUTIONS I loaded the data and transposed it thus: library(elemstatlearn) data(nci) nci.t = t(nci) This means that rownames(nci.t) contains the cell classes, or equivalently colnames(nci). I ll use that a lot, so I ll abbreviate it: nci.classes=rownames(nci.t). 1. Similarity searching for cells (a) How many features are there in the raw data? Are they discrete or continuous? (If there are some of each, which is which?) If some are continuous, are they necessarily positive? Answer: This depends on whether the cell classes are counted as features or not; you could defend either answer. If you don t count the cell class, there are 6830 continuous features. Since they are logarithms, they do not have to be positive, and indeed they are not. If you do count the class, there are 6831 features, one of which is discrete (the class). I am inclined not to count the clas as really being a feature, since when we get new data it may not have the label. (b) Describe a method for finding the k cells whose expression profiles are most similar to that of a given cell. Carefully explain what you mean by similar. How could you evaluate the success of the search algorithm? Answer: The simplest thing is to call two cells similar if their vectors of expression levels have a small Euclidean distance. The most similar cells are the ones whose expression-profile vectors are closest, geometrically, to the target expression profile vector. There are several ways the search could be evaluated. One would be to use the given cell labels as an indication of whether the search results are relevant. That is, one would look at the k closest matches and see (a) what fraction of them are of the same type as the target, which is the precision, and (b) what fraction of cells of that type 1

2 are in the search results (the recall). Plotting the precision and recall against k gives an indication of how efficient the search is. This could then be averaged over all the labeled cells. Normalizing the vectors by the Euclidean length is possible here, though a little tricky because the features are the logarithms of the concentration levels, so some of them can be negative numbers, meaning that very little of that gene is being expressed. Also, the reason for normalizing bag-of-words vectors by length was the idea that two documents might have similar meanings or subjects even if they had different sizes. A cell which is expressing all the genes at a low level, however, might well be very different from one which is expressing the same genes at a high level. (c) Would it make sense to weight genes by inverse cell frequency? Explain. Answer: No; or at least, I don t see how. Every gene is expressed to some degree by every cell (otherwise the logarithm of its concentration would be ), so every gene would have an inverse cell frequency of zero. You could fix a threshold and just count whether the expression level is over the threshold, but this would be pretty arbitrary. However, a related idea would be to scale genes expression levels by something which indicates how much they vary across cells, such as the range or the variance. Since we have labeled cell types here, we could even compute the average expression level for each type and then scale genes by the variance of these type-averages. That is, genes with a small variance (or range, etc.) should get small weights, since they are presumably uninformative, and genes with a large variance in epxression level should get larger weights. 2

3 2. k-means clustering Use the kmeans function in R to cluster the cells, with k = 14 (to match the number of true classes). Repeat this three times to get three different clusterings. Answer: clusters.1 = kmeans(nci.t,centers=14)$cluster clusters.2 = kmeans(nci.t,centers=14)$cluster clusters.3 = kmeans(nci.t,centers=14)$cluster I m only keping the cluster assignments, because that s all this problem calls for. (a) Say that k-means makes a lumping error whenever it assigns two cells of different classes to the same cluster, and a splitting error when it puts two cells of the same class in different clusters. Each pair of cells can give an error. (With n objects, there are n(n 1)/2 distinct pairs.) i. Write a function which takes as inputs a vector of classes and a vector of clusters, and gives as output the number of lumping errors. Test your function by verifying that when the classes are (1, 2, 2), the three clusterings (1, 2, 2), (2, 1, 1) and (4, 5, 6) all give zero lumping errors, but the clustering (1, 1, 1) gives two lumping errors. Answer: The most brute-force way (Code 1) uses nested for loops. This works, but it s not the nicest approach. (1) for loops, let alone nested loops, are extra slow and inefficient in R. (2) We only care about pairs which are in the same cluster, waste time checking all pairs. (3) It s a bit obscure what we re really doing. Code 2 is faster, cleaner, and more R-ish, using the utility function outer, which (rapidly!) applies a function to pairs of objects constructed from its first two arguments, returning a matrix. Here we re seeing which pairs of objects belong to different class, and which to the same clusters. (The solutions to the first homework include a version of this trick.) We restrict ourselves to pairs in the same cluster and count how many are of different classes. We divided by two because outer produces rectangular matrices and works with ordered pairs, so (i, j) (j, i), but the problem asks for unordered pairs. > count.lumping.errors(c(1,2,2),c(1,2,2)) [1] 0 > count.lumping.errors(c(1,2,2),c(2,1,1)) [1] 0 > count.lumping.errors(c(1,2,2),c(4,5,6)) [1] 0 3

4 # Count number of errors made by lumping different classes into # one cluster # Uses explicit, nested iteration # Input: vector of true classes, vector of guessed clusters # Output: number of distinct pairs belonging to different classes # lumped into one cluster count.lumping.errors.1 <- function(true.class,guessed.cluster) { n = length(true.class) # Check that the two vectors have the same length! stopifnot(n == length(guessed.cluster)) # Note: don t require them to have same data type # Initialize counter num.lumping.errors = 0 # check all distinct pairs for (i in 1:(n-1)) { # think of above-diagonal entries in a matrix for (j in (i+1):n) { if ((true.class[i]!= true.class[j]) & (guessed.cluster[i] == guessed.cluster[j])) { # lumping error: really different but put in same cluster num.lumping.errors = num.lumping.errors +1 } } } return(num.lumping.errors) } Code Example 1: The first way to count lumping errors. # Count number of errors made by lumping different classes into # one cluster # Vectorized # Input: vector of true classes, vector of guessed clusters # Output: number of distinct pairs belonging to different classes # lumped into one cluster count.lumping.errors <- function(true.class,guessed.cluster) { n = length(true.class) stopifnot(n == length(guessed.cluster)) different.classes = outer(true.class, true.class, "!=") same.clusters = outer(guessed.cluster, guessed.cluster, "==") num.lumping.errors = sum(different.classes[same.clusters])/2 return(num.lumping.errors) } Code Example 2: Second approach to counting lumping errors. 4

5 # Count number of errors made by splitting a single classes into # clusters # Input: vector of true classes, vector of guessed clusters # Output: number of distinct pairs belonging to the same class # split into different clusters count.splitting.errors <- function(true.class,guessed.cluster) { n = length(true.class) stopifnot(n == length(guessed.cluster)) same.classes = outer(true.class, true.class, "==") different.clusters = outer(guessed.cluster, guessed.cluster, "!=") num.splitting.errors = sum(different.clusters[same.classes])/2 return(num.splitting.errors) } Code Example 3: Counting splitting errors. > count.lumping.errors(c(1,2,2),c(1,1,1)) [1] 2 ii. Write a function, with the same inputs as the previous one, that calculates the number of splitting errors. Test it on the same inputs. (What should the outputs be?) Answer: A simple modification of the code from the last part. Before we can test this, we need to know what the test results are. The classes (1, 2, 2) and clustering (1, 2, 2) are identical, so obviously there will be no splitting errors. Likewise for comparing (1, 2, 2) and (2, 1, 1). Comparing (1, 2, 2) and (4, 5, 6), the pair of the second and third items are in the same class but split into two clusters one splitting error. On the other hand, comparing (1, 2, 2) and (1, 1, 1), there are no splitting errors, because everything is put in the same cluster. > count.splitting.errors(c(1,2,2),c(1,2,2)) [1] 0 > count.splitting.errors(c(1,2,2),c(2,1,1)) [1] 0 > count.splitting.errors(c(1,2,2),c(4,5,6)) [1] 1 > count.splitting.errors(c(1,2,2),c(1,1,1)) [1] 0 iii. How many lumping errors does k-means make on each of your three runs? How many splitting errors? > count.lumping.errors(nci.classes,clusters.1) [1] 79 > count.lumping.errors(nci.classes,clusters.2) [1] 96 > count.lumping.errors(nci.classes,clusters.3) 5

6 [1] 110 > count.splitting.errors(nci.classes,clusters.1) [1] 97 > count.splitting.errors(nci.classes,clusters.2) [1] 97 > count.splitting.errors(nci.classes,clusters.3) [1] 106 For comparison, there are 64 63/2 = 2016 pairs, so the error rate here is pretty good. (b) Are there any classes which seem particularly hard for k-means to pick up? Answer: Well-argued qualitative answers are fine, but there are ways of being quantitative. One is the entropy of the cluster assignments for the classes. Start with a confusion matrix: > confusion = table(nci.classes,clusters.1) > confusion clusters K562A-repro K562B-repro MCF7A-repro MCF7D-repro PROSTATE UNKNOWN > signif(apply(confusion,1,entropy),2) K562A-repro K562B-repro MCF7A-repro MCF7D-repro PROSTATE UNKNOWN Of course that s just one k-means run. Here are a few more. > signif(apply(table(nci.classes,clusters.2),1,entropy),2) K562A-repro K562B-repro MCF7A-repro MCF7D-repro PROSTATE 6

7 UNKNOWN > signif(apply(table(nci.classes,clusters.3),1,entropy),2) K562A-repro K562B-repro MCF7A-repro MCF7D-repro PROSTATE UNKNOWN and have consistently high cluster entropy, indicating that cells of these types tend not to be clustered together. (c) Are there any pairs of cells which are always clustered together, and if so, are they of the same class? Answer: Cells number 1 and 2 are always clustered together in my three runs, and are tumors. However, cells 3 and 4 are always clustered together, too, and one is and one is. (d) Variation-of-information metric i. Calculate, by hand, the variation-of-information distance between the partition (1, 2, 2) and (2, 1, 1); between (1, 2, 2) and (2, 2, 1); and between (1, 2, 2) and (5, 8, 11). Answer: Write X for the cell of the first partition in each pair and Y for the second. In the first case, when X = 1, Y = 2 and vice versa. So H[X Y ] = 0, H[Y X] = 0 and the distance between the partitions is also zero. (The two partitions are the same, they ve just swapped the labels on the cells.) For the second pair, we have Y = 2 when X = 1, so H[Y X = 1] = 0, but Y = 1 or 2 equally often when X = 2, so H[Y X = 2] = 1. Thus H[Y X] = (0)(1/3) + (1)(2/3) = 2/3. Symmetrically, X = 2 when Y = 1, H[X Y = 1] = 0, but X = 1 or 2 equiprobably when Y = 2, so again H[X Y ] = 2/3, and the distance is 4/3. In the final case, H[X Y ] = 0, because for each Y there is a single value of X, but H[Y X] = 2/3, as in the previous case. So the distance is 2/3. ii. Write a function which takes as inputs two vectors of class or cluster assignments, and returns as output the variation-of-information distance for the two partitions. Test the function by checking that it matches your answers in the previous part. Answer: The most straight-forward way is to make the contingency table or confusion matrix for the two assignment vectors, calculate the two conditional entropies from that, and add them. But I already have a function to calculate mutual information, 7

8 # Variation-of-information distance between two partitions # Input: two vectors of partition-cell assignments of equal length # Calls: entropy, word.mutual.info from lecture-05.r # Output: variation of information distance variation.of.info <- function(clustering1, clustering2) { # Check that we re comparing equal numbers of objects stopifnot(length(clustering1) == length(clustering2)) # How much information do the partitions give about each other? mi = word.mutual.info(table(clustering1, clustering2)) # Marginal entropies # entropy function takes a vector of counts, not assignments, # so call table first h1 = entropy(table(clustering1)) h2 = entropy(table(clustering2)) v.o.i. = h1 + h2-2*mi return(v.o.i.) } Code Example 4: Calculating variation-of-information distance between partitions, based on vectors of partition-cell assignments. so I ll re-use that via a little algebra: I[X; Y ] H[X] H[X Y ] H[X Y ] = H[X] I[X; Y ] H[X Y ] + H[Y X] = H[X] + H[Y ] 2I[X; Y ] implemented in Code 4. Let s check this out on the test cases. > variation.of.info(c(1,2,2),c(2,1,1)) [1] 0 > variation.of.info(c(1,2,2),c(2,2,1)) [1] > variation.of.info(c(1,2,2),c(5,8,11)) [1] > variation.of.info(c(5,8,11),c(1,2,2)) [1] I threw in the last one to make sure the function is symmetric in its two arguments, as it should be. iii. Calculate the distances between the k-means clusterings and the true classes, and between the k-means clusterings and each other. Answer: > variation.of.info(nci.classes,clusters.1) [1] > variation.of.info(nci.classes,clusters.2) 8

9 [1] > variation.of.info(nci.classes,clusters.3) [1] > variation.of.info(clusters.1,clusters.2) [1] > variation.of.info(clusters.1,clusters.3) [1] > variation.of.info(clusters.2,clusters.3) [1] The k-means clusterings are all roughly the same distance to the true classes (two bits or so), and noticeably closer to each other than to the true classes (around three-quarters of a bit). 9

10 3. Hierarchical clustering (a) Produce dendrograms using Ward s method, single-link clustering and complete-link clustering. Include both the commands you used and the resulting figures in your write-up. Make sure the figures are legible. (Try the cex=0.5 option to plot.) Answer: hclust needs a matrix of distances, handily produced by the dist function. nci.dist = dist(nci.t) plot(hclust(nci.dist,method="ward"),cex=0.5,xlab="cells", main="hierarchical clustering by Ward s method") plot(hclust(nci.dist,method="single"),cex=0.5,xlab="cells", main="hierarchical clustering by single-link method") plot(hclust(nci.dist,method="complete"),cex=0.5,xlab="cells", main="hierarchical clustering by complete-link method") Producing Figures 1, 2 and 3 (b) Which cell classes seem are best captured by each clustering method? Explain. Answer: Ward s method does a good job of grouping together, and ; is pretty good too but mixed up with some of the lab cell lines. Single-link is good with and decent with (though confused with ). There are little sub-trees of cells of the same time, like or, but mixed together with others. The complete-link method has sub-trees for,,, and, which look pretty much as good as Ward s method. (c) Which method best recovers the cell classes? Explain. Answer: Ward s method looks better scanning down the figure, a lot more of the adjacent cells are of the same type. Since the dendrogram puts items in the same sub-cluster together, this suggests that the clustering more nearly corresponds to the known cell types. (d) The hclust command returns an object whose height attribute is the sum of the within-cluster sums of squares. How many clusters does this suggest we should use, according to Ward s method? Explain. (You may find diff helpful.) Answer: > nci.wards = hclust(nci.dist,method="ward") > length(nci.wards$height) [1] 63 > nci.wards$height[1] [1] There are 63 heights, corresponding to the 63 joinings, i.e., not including the height (sum-of-squares) of zero when we have 64 clusters, 10

11 Hierarchical clustering by Ward's method Height K562B-repro K562A-repro MCF7A-repro MCF7D-repro PROSTATE PROSTATE UNKNOWN Cells hclust (*, "ward") Figure 1: Hierarchical clustering by Ward s method. 11

12 Hierarchical clustering by single-link method Height MCF7A-repro MCF7D-repro K562B-repro K562A-repro UNKNOWN PROSTATE PROSTATE Cells hclust (*, "single") Figure 2: Hierarchical clustering by the single-link method. 12

13 Hierarchical clustering by complete-link method Height MCF7A-repro MCF7D-repro K562B-repro K562A-repro UNKNOWN PROSTATE PROSTATE Cells hclust (*, "complete") Figure 3: Hierarchical clustering by the complete-link method. 13

14 Merging cost Clusters remaining Figure 4: Merging costs in Ward s method. one for each data point. Since the merging costs are differences, we want to add an initial 0 to the sequence: merging.costs = diff(c(0,nci.wards$height)) plot(64:2,merging.costs,xlab="clusters remaining",ylab="merging cost") The function diff takes the difference between successive components in a vector, which is what we want here (Figure 4). The heuristic is to stop joining clusters when the cost of doing so goes up a lot; this suggests using only 10 clusters, since going from 10 clusters to 9 is very expensive. (Alternately, use 63 clusters; but that would be silly.) (e) Suppose you did not know the cell classes. Can you think of any reason to prefer one clustering method over another here, based on 14

15 their outputs and the rest of what you know about the problem? Answer: I can t think of anything very compelling. Ward s method has a better sum-of-squares, but of course we don t know in advance that sum-of-squares picks out differences between cancer types with any biological or medical importance. 15

16 4. (a) Use prcomp to find the variances (not the standard deviations) associated with the principal components. Include a print-out of these variances, to exactly two significant digits, in your write-up. Answer: > nci.pca = prcomp(nci.t) > nci.variances = (nci.pca$sdev)^2 > signif(nci.variances,2) [1] 6.3e e e e e e e e+02 [9] 1.1e e e e e e e e+01 [17] 6.7e e e e e e e e+01 [25] 5.0e e e e e e e e+01 [33] 3.7e e e e e e e e+01 [41] 3.1e e e e e e e e+01 [49] 2.3e e e e e e e e+01 [57] 1.7e e e e e e e e-28 (b) Why are there only 64 principal components, rather than 6830? (Hint: Read the lecture notes.) Answer: Because, when n < p, it is necessarily true that the data lie on an n-dimensional subspace of the p-dimensional feature space, so there are only n orthogonal directions along which the data can vary at all. (Actually, one of the variances is very, very small because any 64 points lie on a 63-dimensional surface, so we really only need 63 directions, and the last variance is within numerical error of zero.) Alternately, we can imagine that there are = 6766 other principal components, each with zero variance. (c) Plot the fraction of the total variance retained by the first q components against q. Include both a print-out of the plot and the commands you used. Answer: plot(cumsum(nci.variances)/sum(nci.variances),xlab="q", ylab="fraction of variance", main = "Fraction of variance retained by first q components") producing Figure 5. The handy cumsum function takes a vector and returns the cumulative sums of its components (i.e., another vector of the sum length). (The same effect can be achieved through lapply or sapply, or through an explicit loop, etc.) (d) Roughly how much variance is retained by the first two principal components? Answer: From the figure, about 25%. More exactly: > sum(nci.variances[1:2]) [1] > sum(nci.variances[1:2])/sum(nci.variances) [1]

17 Fraction of variance retained by first q components Fraction of variance q Figure 5: R 2 vs. q. 17

18 so 23% of the variance. (e) Roughly how many components must be used to keep half of the variance? To keep nine-tenths? Answer: From the figure, about 10 components keep half the variance, and about 40 components keep nine tenths. More exactly: > min(which(cumsum(nci.variances) > 0.5*sum(nci.variances))) [1] 10 > min(which(cumsum(nci.variances) > 0.9*sum(nci.variances))) [1] 42 so we need 10 and 42 components, respectively. (f) Is there any point to using more than 50 components? (Explain.) Answer: There s very little point from the point of view of capturing variance. The error in reconstructing the expression levels from using 50 components is already extremely small. However, there s no guarantee that, in some other application, the information carried by the 55th component (say) wouldn t be crucial. (g) How much confidence should you have in results from visualizing the first two principal components? Why? Answer: Very little; the first two components represent only a small part of the total variance. 18

19 PC PROSTATE UNKNOWN MCF7D-repro MCF7A-repro PROSTATE K562B-repro K562A-repro PC1 Figure 6: PC projections of the cells, labeled by cell type. 5. (a) Plot the projection of each cell on to the first two principal components. Label each cell by its type. Hint: See the solutions to the first homework. Answer: Take the hint! plot(nci.pca$x[,1:2],type="n") text(nci.pca$x[,1:2],nci.classes, cex=0.5) Figure 6 is the result. (b) One tumor class (at least) forms a cluster in the projection. Say which, and explain your answer. Answer: ; most of the cells cluster in the bottomcenter of the figure (PC1 between about 0 and 20, PC2 around 19

20 40), with only a few non- cells nearby, and a big gap to the rest of the data. One could also argue for in the center left, in the upper left, above it, and in the top right. (c) Identify a tumor class which does not form a compact cluster. Answer: Most of them don t. What I had in mind though was, which is very widely spread. (d) Of the two classes of tumors you have just named, which will be more easily classified with the prototype method? With the nearest neighbor method? Answer: will be badly classified using the prototype method. The prototype will be around the middle of the plot, where there are no breast-cancer cells. Nearest-neighbors can hardly do worse. On the other hand, should work better with the prototype method, because it forms a compact blob. 20

21 6. Combining dimensionality reduction and clustering (a) Run k-means with k = 14 on the projections of the cells on to the first two principal components. Give the commands you used to do this, and get three clusterings from three different runs of k-means. pc.clusters.1 = kmeans(nci.pca$x[,1:2],centers=14)$cluster pc.clusters.2 = kmeans(nci.pca$x[,1:2],centers=14)$cluster pc.clusters.3 = kmeans(nci.pca$x[,1:2],centers=14)$cluster (b) Calculate the number of errors, as with k-means clustering based on all genes. Answer: > count.lumping.errors(nci.classes,pc.clusters.1) [1] 96 > count.lumping.errors(nci.classes,pc.clusters.2) [1] 92 > count.lumping.errors(nci.classes,pc.clusters.3) [1] 111 > count.splitting.errors(nci.classes,pc.clusters.1) [1] 126 > count.splitting.errors(nci.classes,pc.clusters.2) [1] 128 > count.splitting.errors(nci.classes,pc.clusters.3) [1] 134 The number of lumping errors has increased a bit, though not very much. The number of splitting errors has gone up by about 10%. (c) Are there any pairs of cells which are always clustered together? If so, do they have the same cell type? Answer: For me, the first three cells are all clustered together, and are all. (d) Does k-means find a cluster corresponding to the cell type you thought would be especially easy to identify in the previous problem? (Explain your answer.) Answer: Make confusion matrices and look at them. > table(nci.classes,pc.clusters.1) pc.clusters K562A-repro K562B-repro

22 MCF7A-repro MCF7D-repro PROSTATE UNKNOWN Six of the eight cells are in one cluster here, which has no other members this matches what I guessed from the projection plot. This is also true in one of the other two runs; in the third that group of six is split into two clusters of 4 cells and 2. (e) Does k-means find a cluster corresponding to the cell type you thought be be especially hard to identify? (Again, explain.) Answer: I thought would be hard to classify, and it is, being spread across six clusters, all containing cells from other classes. This remains true in the other k-means runs. On the other hand, it wasn t well-clustered with the full data, either. 22

23 7. Combining dimensionality reduction and classification (a) Calculate the error rate of the prototype method using all the gene features, using leave-one-out cross-validation. You may use the solution code from previous assignments, or your own code. Remember that in this data set, the class labels are the row names, not a separate column, so you will need to modify either your code or the data frame. (Note: this may take several minutes to run. [Why so slow?]) Answer: I find it simpler to add another column for the class labels than to modify the code. > nci.frame = data.frame(labels = nci.classes, nci.t) > loocv.prototype(nci.frame) [1] (The frame-making command complains about duplicated row-names, but I suppressed that for simplicity.) 58% accuracy may not sound that great, but remember there are 14 classes it s a lot better than chance. Many people tried to use matrix here. The difficulty, as mentioned in the lecture notes, is that a matrix or array, in R, has to have all its components be of the same data type it can t mix, say, numbers and characters. When you try, it coerces the numbers into characters (because it can do that but can t go the other way). With data.frame, each column can be of a different data type, so we can mix character labels with numeric features. This takes a long time to run because it has to calculate 14 class centers, with 6830 dimensions, 64 times. Of course most of the class prototypes are not changing with each hold-out (only the one center of the class to which the hold-out point belongs), so there s a fair amount of wasted effort computationally. A slicker implementation of leave-one-out for the prototype method would take advantage of this, at the cost of specializing the code to that particular classifier method. (b) Calculate the error rate of the prototype method using the first two, ten and twenty principal components. Include the R commands you used to do this. Answer: Remember that the x attribute of the object returned by prcomp gives the projections on to the components. We need to turn these into data frames along with the class labels, but since we don t really care about keeping them around, we can do that in the argument to the CV function. > loocv.prototype(data.frame(labels=nci.classes,nci.pca$x[,1:2])) [1] > loocv.prototype(data.frame(labels=nci.classes,nci.pca$x[,1:10])) [1]

24 proto.with.q.components = function(q, pcs, classes) { pcs = pcs[,1:q] frame = data.frame(class.labels=classes, pcs) accuracy = loocv.prototype(frame) return(accuracy) } Code Example 5: Function for calculating the accuracy of a variable number of components. > loocv.prototype(data.frame(labels=nci.classes,nci.pca$x[,1:20])) [1] So the accuracy is only slightly reduced, or even slightly increased, by using the principal components rather than the full data. (c) (Extra credit.) Plot the error rate, as in the previous part, against the number q of principal components used, for q from 2 to 64. Include your code and comment on the graph. (Hint: Write a function to calculate the error rate for arbitrary q, and use sapply.) Answer: Follow the hint (Code Example 5). This creates the frame internally strictly the extra arguments to the function aren t needed, but assuming that global variables will exist and have the right properties is always bad programming practice. I could add default values to them (pcs=nci.pca$x, etc.), but that s not necessary because sapply can pass extra named arguments on to the function. > pca.accuracies = sapply(2:64, proto.with.q.components, + pcs=nci.pca$x, classes=nci.classes) > pca.accuracies[c(1,9,19)] [1] > plot(2:64, pca.accuracies, xlab="q", ylab="prototype accuracy") The middle command double checks that the proto.with.q.components function works properly, by giving the same results as we got by hand earlier. (Remember that the first component of the vector pca.accuracies corresponds to q = 2, etc.) The plot is Figure 7. There s a peak in the accuracy for q between about 15 and

25 Prototype accuracy q Figure 7: Accuracy of the prototype method as a function of the number of components q. 25

Homework : Data Mining SOLUTIONS

Homework : Data Mining SOLUTIONS Homework 4 36-350: Data Mining SOLUTIONS 1. Similarity searching for cells (a) How many features are there in the raw data? Are they discrete or continuous? (If there are some of each, which is which?)

More information

CS168: The Modern Algorithmic Toolbox Lecture #7: Understanding Principal Component Analysis (PCA)

CS168: The Modern Algorithmic Toolbox Lecture #7: Understanding Principal Component Analysis (PCA) CS68: The Modern Algorithmic Toolbox Lecture #7: Understanding Principal Component Analysis (PCA) Tim Roughgarden & Gregory Valiant April 0, 05 Introduction. Lecture Goal Principal components analysis

More information

DIMENSION REDUCTION AND CLUSTER ANALYSIS

DIMENSION REDUCTION AND CLUSTER ANALYSIS DIMENSION REDUCTION AND CLUSTER ANALYSIS EECS 833, 6 March 2006 Geoff Bohling Assistant Scientist Kansas Geological Survey geoff@kgs.ku.edu 864-2093 Overheads and resources available at http://people.ku.edu/~gbohling/eecs833

More information

Quantitative Understanding in Biology Short Course Session 9 Principal Components Analysis

Quantitative Understanding in Biology Short Course Session 9 Principal Components Analysis Quantitative Understanding in Biology Short Course Session 9 Principal Components Analysis Jinhyun Ju Jason Banfelder Luce Skrabanek June 21st, 218 1 Preface For the last session in this course, we ll

More information

Getting Started with Communications Engineering

Getting Started with Communications Engineering 1 Linear algebra is the algebra of linear equations: the term linear being used in the same sense as in linear functions, such as: which is the equation of a straight line. y ax c (0.1) Of course, if we

More information

MITOCW ocw f99-lec01_300k

MITOCW ocw f99-lec01_300k MITOCW ocw-18.06-f99-lec01_300k Hi. This is the first lecture in MIT's course 18.06, linear algebra, and I'm Gilbert Strang. The text for the course is this book, Introduction to Linear Algebra. And the

More information

Lecture 12 : Graph Laplacians and Cheeger s Inequality

Lecture 12 : Graph Laplacians and Cheeger s Inequality CPS290: Algorithmic Foundations of Data Science March 7, 2017 Lecture 12 : Graph Laplacians and Cheeger s Inequality Lecturer: Kamesh Munagala Scribe: Kamesh Munagala Graph Laplacian Maybe the most beautiful

More information

Natural deduction for truth-functional logic

Natural deduction for truth-functional logic Natural deduction for truth-functional logic Phil 160 - Boston University Why natural deduction? After all, we just found this nice method of truth-tables, which can be used to determine the validity or

More information

Quantitative Understanding in Biology Principal Components Analysis

Quantitative Understanding in Biology Principal Components Analysis Quantitative Understanding in Biology Principal Components Analysis Introduction Throughout this course we have seen examples of complex mathematical phenomena being represented as linear combinations

More information

Sums of Squares (FNS 195-S) Fall 2014

Sums of Squares (FNS 195-S) Fall 2014 Sums of Squares (FNS 195-S) Fall 014 Record of What We Did Drew Armstrong Vectors When we tried to apply Cartesian coordinates in 3 dimensions we ran into some difficulty tryiing to describe lines and

More information

Introduction to Computer Science and Programming for Astronomers

Introduction to Computer Science and Programming for Astronomers Introduction to Computer Science and Programming for Astronomers Lecture 8. István Szapudi Institute for Astronomy University of Hawaii March 7, 2018 Outline Reminder 1 Reminder 2 3 4 Reminder We have

More information

The Derivative of a Function

The Derivative of a Function The Derivative of a Function James K Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University March 1, 2017 Outline A Basic Evolutionary Model The Next Generation

More information

Fitting a Straight Line to Data

Fitting a Straight Line to Data Fitting a Straight Line to Data Thanks for your patience. Finally we ll take a shot at real data! The data set in question is baryonic Tully-Fisher data from http://astroweb.cwru.edu/sparc/btfr Lelli2016a.mrt,

More information

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way EECS 16A Designing Information Devices and Systems I Spring 018 Lecture Notes Note 1 1.1 Introduction to Linear Algebra the EECS Way In this note, we will teach the basics of linear algebra and relate

More information

MITOCW ocw f99-lec05_300k

MITOCW ocw f99-lec05_300k MITOCW ocw-18.06-f99-lec05_300k This is lecture five in linear algebra. And, it will complete this chapter of the book. So the last section of this chapter is two point seven that talks about permutations,

More information

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way EECS 16A Designing Information Devices and Systems I Fall 018 Lecture Notes Note 1 1.1 Introduction to Linear Algebra the EECS Way In this note, we will teach the basics of linear algebra and relate it

More information

Experiment 2 Random Error and Basic Statistics

Experiment 2 Random Error and Basic Statistics PHY9 Experiment 2: Random Error and Basic Statistics 8/5/2006 Page Experiment 2 Random Error and Basic Statistics Homework 2: Turn in at start of experiment. Readings: Taylor chapter 4: introduction, sections

More information

CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA

CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA Andrew ID: ljelenak August 25, 2018 This assignment reviews basic mathematical tools you will use throughout

More information

CS168: The Modern Algorithmic Toolbox Lecture #8: How PCA Works

CS168: The Modern Algorithmic Toolbox Lecture #8: How PCA Works CS68: The Modern Algorithmic Toolbox Lecture #8: How PCA Works Tim Roughgarden & Gregory Valiant April 20, 206 Introduction Last lecture introduced the idea of principal components analysis (PCA). The

More information

1 Review of the dot product

1 Review of the dot product Any typographical or other corrections about these notes are welcome. Review of the dot product The dot product on R n is an operation that takes two vectors and returns a number. It is defined by n u

More information

MATH 310, REVIEW SHEET 2

MATH 310, REVIEW SHEET 2 MATH 310, REVIEW SHEET 2 These notes are a very short summary of the key topics in the book (and follow the book pretty closely). You should be familiar with everything on here, but it s not comprehensive,

More information

PRINCIPAL COMPONENTS ANALYSIS

PRINCIPAL COMPONENTS ANALYSIS 121 CHAPTER 11 PRINCIPAL COMPONENTS ANALYSIS We now have the tools necessary to discuss one of the most important concepts in mathematical statistics: Principal Components Analysis (PCA). PCA involves

More information

MITOCW ocw f99-lec16_300k

MITOCW ocw f99-lec16_300k MITOCW ocw-18.06-f99-lec16_300k OK. Here's lecture sixteen and if you remember I ended up the last lecture with this formula for what I called a projection matrix. And maybe I could just recap for a minute

More information

Chapter 1 Review of Equations and Inequalities

Chapter 1 Review of Equations and Inequalities Chapter 1 Review of Equations and Inequalities Part I Review of Basic Equations Recall that an equation is an expression with an equal sign in the middle. Also recall that, if a question asks you to solve

More information

Data Exploration and Unsupervised Learning with Clustering

Data Exploration and Unsupervised Learning with Clustering Data Exploration and Unsupervised Learning with Clustering Paul F Rodriguez,PhD San Diego Supercomputer Center Predictive Analytic Center of Excellence Clustering Idea Given a set of data can we find a

More information

#29: Logarithm review May 16, 2009

#29: Logarithm review May 16, 2009 #29: Logarithm review May 16, 2009 This week we re going to spend some time reviewing. I say re- view since you ve probably seen them before in theory, but if my experience is any guide, it s quite likely

More information

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2 Final Review Sheet The final will cover Sections Chapters 1,2,3 and 4, as well as sections 5.1-5.4, 6.1-6.2 and 7.1-7.3 from chapters 5,6 and 7. This is essentially all material covered this term. Watch

More information

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3 Linear Algebra Row Reduced Echelon Form Techniques for solving systems of linear equations lie at the heart of linear algebra. In high school we learn to solve systems with or variables using elimination

More information

CS1800: Mathematical Induction. Professor Kevin Gold

CS1800: Mathematical Induction. Professor Kevin Gold CS1800: Mathematical Induction Professor Kevin Gold Induction: Used to Prove Patterns Just Keep Going For an algorithm, we may want to prove that it just keeps working, no matter how big the input size

More information

Slope Fields: Graphing Solutions Without the Solutions

Slope Fields: Graphing Solutions Without the Solutions 8 Slope Fields: Graphing Solutions Without the Solutions Up to now, our efforts have been directed mainly towards finding formulas or equations describing solutions to given differential equations. Then,

More information

Experiment 2 Random Error and Basic Statistics

Experiment 2 Random Error and Basic Statistics PHY191 Experiment 2: Random Error and Basic Statistics 7/12/2011 Page 1 Experiment 2 Random Error and Basic Statistics Homework 2: turn in the second week of the experiment. This is a difficult homework

More information

The Haar Wavelet Transform: Compression and. Reconstruction

The Haar Wavelet Transform: Compression and. Reconstruction The Haar Wavelet Transform: Compression and Damien Adams and Halsey Patterson December 14, 2006 Abstract The Haar Wavelet Transformation is a simple form of compression involved in averaging and differencing

More information

Solution to Proof Questions from September 1st

Solution to Proof Questions from September 1st Solution to Proof Questions from September 1st Olena Bormashenko September 4, 2011 What is a proof? A proof is an airtight logical argument that proves a certain statement in general. In a sense, it s

More information

CSE 241 Class 1. Jeremy Buhler. August 24,

CSE 241 Class 1. Jeremy Buhler. August 24, CSE 41 Class 1 Jeremy Buhler August 4, 015 Before class, write URL on board: http://classes.engineering.wustl.edu/cse41/. Also: Jeremy Buhler, Office: Jolley 506, 314-935-6180 1 Welcome and Introduction

More information

Lecture: Face Recognition and Feature Reduction

Lecture: Face Recognition and Feature Reduction Lecture: Face Recognition and Feature Reduction Juan Carlos Niebles and Ranjay Krishna Stanford Vision and Learning Lab Lecture 11-1 Recap - Curse of dimensionality Assume 5000 points uniformly distributed

More information

MAT137 - Term 2, Week 2

MAT137 - Term 2, Week 2 MAT137 - Term 2, Week 2 This lecture will assume you have watched all of the videos on the definition of the integral (but will remind you about some things). Today we re talking about: More on the definition

More information

Pattern Recognition Prof. P. S. Sastry Department of Electronics and Communication Engineering Indian Institute of Science, Bangalore

Pattern Recognition Prof. P. S. Sastry Department of Electronics and Communication Engineering Indian Institute of Science, Bangalore Pattern Recognition Prof. P. S. Sastry Department of Electronics and Communication Engineering Indian Institute of Science, Bangalore Lecture - 27 Multilayer Feedforward Neural networks with Sigmoidal

More information

Computational Techniques Prof. Sreenivas Jayanthi. Department of Chemical Engineering Indian institute of Technology, Madras

Computational Techniques Prof. Sreenivas Jayanthi. Department of Chemical Engineering Indian institute of Technology, Madras Computational Techniques Prof. Sreenivas Jayanthi. Department of Chemical Engineering Indian institute of Technology, Madras Module No. # 05 Lecture No. # 24 Gauss-Jordan method L U decomposition method

More information

Exploratory Factor Analysis and Principal Component Analysis

Exploratory Factor Analysis and Principal Component Analysis Exploratory Factor Analysis and Principal Component Analysis Today s Topics: What are EFA and PCA for? Planning a factor analytic study Analysis steps: Extraction methods How many factors Rotation and

More information

Descriptive Statistics (And a little bit on rounding and significant digits)

Descriptive Statistics (And a little bit on rounding and significant digits) Descriptive Statistics (And a little bit on rounding and significant digits) Now that we know what our data look like, we d like to be able to describe it numerically. In other words, how can we represent

More information

Classification and Regression Trees

Classification and Regression Trees Classification and Regression Trees Ryan P Adams So far, we have primarily examined linear classifiers and regressors, and considered several different ways to train them When we ve found the linearity

More information

DIFFERENTIAL EQUATIONS

DIFFERENTIAL EQUATIONS DIFFERENTIAL EQUATIONS Basic Concepts Paul Dawkins Table of Contents Preface... Basic Concepts... 1 Introduction... 1 Definitions... Direction Fields... 8 Final Thoughts...19 007 Paul Dawkins i http://tutorial.math.lamar.edu/terms.aspx

More information

Mathematical Induction

Mathematical Induction Mathematical Induction James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University January 12, 2017 Outline Introduction to the Class Mathematical Induction

More information

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.]

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.] Math 43 Review Notes [Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty Dot Product If v (v, v, v 3 and w (w, w, w 3, then the

More information

Alex s Guide to Word Problems and Linear Equations Following Glencoe Algebra 1

Alex s Guide to Word Problems and Linear Equations Following Glencoe Algebra 1 Alex s Guide to Word Problems and Linear Equations Following Glencoe Algebra 1 What is a linear equation? It sounds fancy, but linear equation means the same thing as a line. In other words, it s an equation

More information

Big-oh stuff. You should know this definition by heart and be able to give it,

Big-oh stuff. You should know this definition by heart and be able to give it, Big-oh stuff Definition. if asked. You should know this definition by heart and be able to give it, Let f and g both be functions from R + to R +. Then f is O(g) (pronounced big-oh ) if and only if there

More information

1 Probabilities. 1.1 Basics 1 PROBABILITIES

1 Probabilities. 1.1 Basics 1 PROBABILITIES 1 PROBABILITIES 1 Probabilities Probability is a tricky word usually meaning the likelyhood of something occuring or how frequent something is. Obviously, if something happens frequently, then its probability

More information

EXAM 2 REVIEW DAVID SEAL

EXAM 2 REVIEW DAVID SEAL EXAM 2 REVIEW DAVID SEAL 3. Linear Systems and Matrices 3.2. Matrices and Gaussian Elimination. At this point in the course, you all have had plenty of practice with Gaussian Elimination. Be able to row

More information

ECE 592 Topics in Data Science

ECE 592 Topics in Data Science ECE 592 Topics in Data Science Final Fall 2017 December 11, 2017 Please remember to justify your answers carefully, and to staple your test sheet and answers together before submitting. Name: Student ID:

More information

Conditional probabilities and graphical models

Conditional probabilities and graphical models Conditional probabilities and graphical models Thomas Mailund Bioinformatics Research Centre (BiRC), Aarhus University Probability theory allows us to describe uncertainty in the processes we model within

More information

Instructor (Brad Osgood)

Instructor (Brad Osgood) TheFourierTransformAndItsApplications-Lecture26 Instructor (Brad Osgood): Relax, but no, no, no, the TV is on. It's time to hit the road. Time to rock and roll. We're going to now turn to our last topic

More information

Exploratory Factor Analysis and Principal Component Analysis

Exploratory Factor Analysis and Principal Component Analysis Exploratory Factor Analysis and Principal Component Analysis Today s Topics: What are EFA and PCA for? Planning a factor analytic study Analysis steps: Extraction methods How many factors Rotation and

More information

Lecture: Face Recognition and Feature Reduction

Lecture: Face Recognition and Feature Reduction Lecture: Face Recognition and Feature Reduction Juan Carlos Niebles and Ranjay Krishna Stanford Vision and Learning Lab 1 Recap - Curse of dimensionality Assume 5000 points uniformly distributed in the

More information

The Euler Method for the Initial Value Problem

The Euler Method for the Initial Value Problem The Euler Method for the Initial Value Problem http://people.sc.fsu.edu/ jburkardt/isc/week10 lecture 18.pdf... ISC3313: Introduction to Scientific Computing with C++ Summer Semester 2011... John Burkardt

More information

1 Maintaining a Dictionary

1 Maintaining a Dictionary 15-451/651: Design & Analysis of Algorithms February 1, 2016 Lecture #7: Hashing last changed: January 29, 2016 Hashing is a great practical tool, with an interesting and subtle theory too. In addition

More information

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero Chapter Limits of Sequences Calculus Student: lim s n = 0 means the s n are getting closer and closer to zero but never gets there. Instructor: ARGHHHHH! Exercise. Think of a better response for the instructor.

More information

1 Dirac Notation for Vector Spaces

1 Dirac Notation for Vector Spaces Theoretical Physics Notes 2: Dirac Notation This installment of the notes covers Dirac notation, which proves to be very useful in many ways. For example, it gives a convenient way of expressing amplitudes

More information

CIS 2033 Lecture 5, Fall

CIS 2033 Lecture 5, Fall CIS 2033 Lecture 5, Fall 2016 1 Instructor: David Dobor September 13, 2016 1 Supplemental reading from Dekking s textbook: Chapter2, 3. We mentioned at the beginning of this class that calculus was a prerequisite

More information

The Effects of Coarse-Graining on One- Dimensional Cellular Automata Alec Boyd UC Davis Physics Deparment

The Effects of Coarse-Graining on One- Dimensional Cellular Automata Alec Boyd UC Davis Physics Deparment The Effects of Coarse-Graining on One- Dimensional Cellular Automata Alec Boyd UC Davis Physics Deparment alecboy@gmail.com Abstract: Measurement devices that we use to examine systems often do not communicate

More information

Lecture 15: Exploding and Vanishing Gradients

Lecture 15: Exploding and Vanishing Gradients Lecture 15: Exploding and Vanishing Gradients Roger Grosse 1 Introduction Last lecture, we introduced RNNs and saw how to derive the gradients using backprop through time. In principle, this lets us train

More information

Lecture 2: Linear regression

Lecture 2: Linear regression Lecture 2: Linear regression Roger Grosse 1 Introduction Let s ump right in and look at our first machine learning algorithm, linear regression. In regression, we are interested in predicting a scalar-valued

More information

Lecture 4: Constructing the Integers, Rationals and Reals

Lecture 4: Constructing the Integers, Rationals and Reals Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 4: Constructing the Integers, Rationals and Reals Week 5 UCSB 204 The Integers Normally, using the natural numbers, you can easily define

More information

Lecture 3: Sizes of Infinity

Lecture 3: Sizes of Infinity Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 3: Sizes of Infinity Week 2 UCSB 204 Sizes of Infinity On one hand, we know that the real numbers contain more elements than the rational

More information

MA 1128: Lecture 19 4/20/2018. Quadratic Formula Solving Equations with Graphs

MA 1128: Lecture 19 4/20/2018. Quadratic Formula Solving Equations with Graphs MA 1128: Lecture 19 4/20/2018 Quadratic Formula Solving Equations with Graphs 1 Completing-the-Square Formula One thing you may have noticed when you were completing the square was that you followed the

More information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Lines and Their Equations

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Lines and Their Equations ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER 1 017/018 DR. ANTHONY BROWN. Lines and Their Equations.1. Slope of a Line and its y-intercept. In Euclidean geometry (where

More information

Notes for CS542G (Iterative Solvers for Linear Systems)

Notes for CS542G (Iterative Solvers for Linear Systems) Notes for CS542G (Iterative Solvers for Linear Systems) Robert Bridson November 20, 2007 1 The Basics We re now looking at efficient ways to solve the linear system of equations Ax = b where in this course,

More information

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2:

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: 03 17 08 3 All about lines 3.1 The Rectangular Coordinate System Know how to plot points in the rectangular coordinate system. Know the

More information

Basic Linear Algebra in MATLAB

Basic Linear Algebra in MATLAB Basic Linear Algebra in MATLAB 9.29 Optional Lecture 2 In the last optional lecture we learned the the basic type in MATLAB is a matrix of double precision floating point numbers. You learned a number

More information

1 Using standard errors when comparing estimated values

1 Using standard errors when comparing estimated values MLPR Assignment Part : General comments Below are comments on some recurring issues I came across when marking the second part of the assignment, which I thought it would help to explain in more detail

More information

MITOCW ocw f99-lec30_300k

MITOCW ocw f99-lec30_300k MITOCW ocw-18.06-f99-lec30_300k OK, this is the lecture on linear transformations. Actually, linear algebra courses used to begin with this lecture, so you could say I'm beginning this course again by

More information

PHY 123 Lab 1 - Error and Uncertainty and the Simple Pendulum

PHY 123 Lab 1 - Error and Uncertainty and the Simple Pendulum To print higher-resolution math symbols, click the Hi-Res Fonts for Printing button on the jsmath control panel. PHY 13 Lab 1 - Error and Uncertainty and the Simple Pendulum Important: You need to print

More information

Regression, Part I. - In correlation, it would be irrelevant if we changed the axes on our graph.

Regression, Part I. - In correlation, it would be irrelevant if we changed the axes on our graph. Regression, Part I I. Difference from correlation. II. Basic idea: A) Correlation describes the relationship between two variables, where neither is independent or a predictor. - In correlation, it would

More information

Select/Special Topics in Atomic Physics Prof. P. C. Deshmukh Department of Physics Indian Institute of Technology, Madras

Select/Special Topics in Atomic Physics Prof. P. C. Deshmukh Department of Physics Indian Institute of Technology, Madras Select/Special Topics in Atomic Physics Prof. P. C. Deshmukh Department of Physics Indian Institute of Technology, Madras Lecture - 9 Angular Momentum in Quantum Mechanics Dimensionality of the Direct-Product

More information

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations Lab 2 Worksheet Problems Problem : Geometry and Linear Equations Linear algebra is, first and foremost, the study of systems of linear equations. You are going to encounter linear systems frequently in

More information

Guide to Proofs on Sets

Guide to Proofs on Sets CS103 Winter 2019 Guide to Proofs on Sets Cynthia Lee Keith Schwarz I would argue that if you have a single guiding principle for how to mathematically reason about sets, it would be this one: All sets

More information

Park School Mathematics Curriculum Book 9, Lesson 2: Introduction to Logarithms

Park School Mathematics Curriculum Book 9, Lesson 2: Introduction to Logarithms Park School Mathematics Curriculum Book 9, Lesson : Introduction to Logarithms We re providing this lesson as a sample of the curriculum we use at the Park School of Baltimore in grades 9-11. If you d

More information

Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras

Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras Lecture - 21 Central Potential and Central Force Ready now to take up the idea

More information

Lecture 10: Powers of Matrices, Difference Equations

Lecture 10: Powers of Matrices, Difference Equations Lecture 10: Powers of Matrices, Difference Equations Difference Equations A difference equation, also sometimes called a recurrence equation is an equation that defines a sequence recursively, i.e. each

More information

Connectedness. Proposition 2.2. The following are equivalent for a topological space (X, T ).

Connectedness. Proposition 2.2. The following are equivalent for a topological space (X, T ). Connectedness 1 Motivation Connectedness is the sort of topological property that students love. Its definition is intuitive and easy to understand, and it is a powerful tool in proofs of well-known results.

More information

High Dimensional Geometry, Curse of Dimensionality, Dimension Reduction

High Dimensional Geometry, Curse of Dimensionality, Dimension Reduction Chapter 11 High Dimensional Geometry, Curse of Dimensionality, Dimension Reduction High-dimensional vectors are ubiquitous in applications (gene expression data, set of movies watched by Netflix customer,

More information

Lab Slide Rules and Log Scales

Lab Slide Rules and Log Scales Name: Lab Slide Rules and Log Scales [EER Note: This is a much-shortened version of my lab on this topic. You won t finish, but try to do one of each type of calculation if you can. I m available to help.]

More information

Factoring. there exists some 1 i < j l such that x i x j (mod p). (1) p gcd(x i x j, n).

Factoring. there exists some 1 i < j l such that x i x j (mod p). (1) p gcd(x i x j, n). 18.310 lecture notes April 22, 2015 Factoring Lecturer: Michel Goemans We ve seen that it s possible to efficiently check whether an integer n is prime or not. What about factoring a number? If this could

More information

Lesson 21 Not So Dramatic Quadratics

Lesson 21 Not So Dramatic Quadratics STUDENT MANUAL ALGEBRA II / LESSON 21 Lesson 21 Not So Dramatic Quadratics Quadratic equations are probably one of the most popular types of equations that you ll see in algebra. A quadratic equation has

More information

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in Vectors and Matrices Continued Remember that our goal is to write a system of algebraic equations as a matrix equation. Suppose we have the n linear algebraic equations a x + a 2 x 2 + a n x n = b a 2

More information

Section 20: Arrow Diagrams on the Integers

Section 20: Arrow Diagrams on the Integers Section 0: Arrow Diagrams on the Integers Most of the material we have discussed so far concerns the idea and representations of functions. A function is a relationship between a set of inputs (the leave

More information

TheFourierTransformAndItsApplications-Lecture28

TheFourierTransformAndItsApplications-Lecture28 TheFourierTransformAndItsApplications-Lecture28 Instructor (Brad Osgood):All right. Let me remind you of the exam information as I said last time. I also sent out an announcement to the class this morning

More information

Cosets and Lagrange s theorem

Cosets and Lagrange s theorem Cosets and Lagrange s theorem These are notes on cosets and Lagrange s theorem some of which may already have been lecturer. There are some questions for you included in the text. You should write the

More information

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2.

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2. Midterm 1 Review Comments about the midterm The midterm will consist of five questions and will test on material from the first seven lectures the material given below. No calculus either single variable

More information

MITOCW ocw f99-lec09_300k

MITOCW ocw f99-lec09_300k MITOCW ocw-18.06-f99-lec09_300k OK, this is linear algebra lecture nine. And this is a key lecture, this is where we get these ideas of linear independence, when a bunch of vectors are independent -- or

More information

Graph Theory. Thomas Bloom. February 6, 2015

Graph Theory. Thomas Bloom. February 6, 2015 Graph Theory Thomas Bloom February 6, 2015 1 Lecture 1 Introduction A graph (for the purposes of these lectures) is a finite set of vertices, some of which are connected by a single edge. Most importantly,

More information

Data Mining Prof. Pabitra Mitra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Data Mining Prof. Pabitra Mitra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Data Mining Prof. Pabitra Mitra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 21 K - Nearest Neighbor V In this lecture we discuss; how do we evaluate the

More information

Approximations - the method of least squares (1)

Approximations - the method of least squares (1) Approximations - the method of least squares () In many applications, we have to consider the following problem: Suppose that for some y, the equation Ax = y has no solutions It could be that this is an

More information

MA554 Assessment 1 Cosets and Lagrange s theorem

MA554 Assessment 1 Cosets and Lagrange s theorem MA554 Assessment 1 Cosets and Lagrange s theorem These are notes on cosets and Lagrange s theorem; they go over some material from the lectures again, and they have some new material it is all examinable,

More information

II. Unit Speed Curves

II. Unit Speed Curves The Geometry of Curves, Part I Rob Donnelly From Murray State University s Calculus III, Fall 2001 note: This material supplements Sections 13.3 and 13.4 of the text Calculus with Early Transcendentals,

More information

Answers in blue. If you have questions or spot an error, let me know. 1. Find all matrices that commute with A =. 4 3

Answers in blue. If you have questions or spot an error, let me know. 1. Find all matrices that commute with A =. 4 3 Answers in blue. If you have questions or spot an error, let me know. 3 4. Find all matrices that commute with A =. 4 3 a b If we set B = and set AB = BA, we see that 3a + 4b = 3a 4c, 4a + 3b = 3b 4d,

More information

At the start of the term, we saw the following formula for computing the sum of the first n integers:

At the start of the term, we saw the following formula for computing the sum of the first n integers: Chapter 11 Induction This chapter covers mathematical induction. 11.1 Introduction to induction At the start of the term, we saw the following formula for computing the sum of the first n integers: Claim

More information

Cover Page: Entropy Summary

Cover Page: Entropy Summary Cover Page: Entropy Summary Heat goes where the ratio of heat to absolute temperature can increase. That ratio (Q/T) is used to define a quantity called entropy. The useful application of this idea shows

More information

Algorithms Exam TIN093 /DIT602

Algorithms Exam TIN093 /DIT602 Algorithms Exam TIN093 /DIT602 Course: Algorithms Course code: TIN 093, TIN 092 (CTH), DIT 602 (GU) Date, time: 21st October 2017, 14:00 18:00 Building: SBM Responsible teacher: Peter Damaschke, Tel. 5405

More information

Recitation 9: Probability Matrices and Real Symmetric Matrices. 3 Probability Matrices: Definitions and Examples

Recitation 9: Probability Matrices and Real Symmetric Matrices. 3 Probability Matrices: Definitions and Examples Math b TA: Padraic Bartlett Recitation 9: Probability Matrices and Real Symmetric Matrices Week 9 Caltech 20 Random Question Show that + + + + +... = ϕ, the golden ratio, which is = + 5. 2 2 Homework comments

More information

Lecture 3: Special Matrices

Lecture 3: Special Matrices Lecture 3: Special Matrices Feedback of assignment1 Random matrices The magic matrix commend magic() doesn t give us random matrix. Random matrix means we will get different matrices each time when we

More information