CSci 530: Problem Set 4 Example Solution
Virtual Memory and Page Tables
Derek Harter
2014-11-13
Assigned: Tuesday November 4, 2014
Due: Wednesday November 12, 2014
Overview
In this problem set we will look at an example of a page table for a process
in a
GENERALIZED ADDITIVE MODELS (GAMs)
The primary shortcoming of the linear and logistic regression models is that they assume that the
relationship between the inputs and the output is monotone. What if the actual relationship is nonmonotone? For example, f
Problem Set-3
Problem #1:
Answer: The possible interleavings for the proceeding of two processes p() and q() are as follows: In
the given process p() there are 3 atomic statements such as A, B, C whereas in process q() there are 2
atomic statements that i
#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
/ States
const int
const int
const int
of process and program global constants are declared.
Running = 1;
Ready = 2;
Blocked = 3;
#define
Bagging
The decision trees suffer from high variance. Bootstrap
aggregation, or bagging, is a general-purpose procedure
for reducing the variance of a statistical learning method.
Averaging a set of observations reduces variance. Hence
a natural way to re
Exploring Data
Data exploration uses a combination of summary
statisticsmeans and medians, variances, and
countsand visualization, or graphs of the data. You
can spot some problems just by using summary
statistics; other problems are easier to find visual
CSCI 530: Problem Set 4
Virtual Memory and Page Tables
Q.1) Describe exactly, how in general, a virtual address generated by CPU is translated into a physical
memory address?
Answer: The following are the steps that how the virtual address generated by CP
Prasanna Gajula
50143945
1. Load data week4.csv (from Doc Sharing) into a data frame named logData using read.csv
Make sure that you include head=TRUE and stringsAsFactors=FALSE. You can also use na.strings option in the read.csv to let R treat unknown va
Navateja Gajula
35233825
1.Part 1. Load Data
Load crabs.csv data into a data frame.(You can get the file from Doc Sharing, or load from MASS library from R command prompt)
This data frame contains the following columns:
sp: species - "B" or "O" for blue
Navateja Gajula
35233825
Problem 1.
Create a vector with the following elements:18,15,18,16,17,15,14,14,14,15,15,14,15,14,24,22,18,21,27,26
Ans:
A <-c ( 18,15,18,16,17,15,14,14,14,15,15,14,15,14,24,22,18,21,27,26)
> A
[1] 18 15 18 16 17 15 14 14 14 15 15
Part 0. Set a Seed Value.
Use set.seed() function.
> set.seed(102)
Part 1. Locate Data
Part 2. Read Data into a Data Frame
Read/load data and assign it to a data frame variable named wineData.
If you are reading from file, use read.csv and make sure that
Navateja Gajula
35233825
Part 1. Install packages gmodels, class, and ggvis
> install.packages("gmodels")
> install.packages("class")
> install.packages("ggvis")
Part 2. Load ratings.csv file into a data frame (You can download it from Doc Sharing).
Movi
Navateja Gajula
35233825
0. Install library mgcv.
> install.packages("mgcv")
>
1. Load data from file College.csv. You can download College.csv from Doc Sharing.
> Data <- read.csv(file.choose(), header=TRUE, stringsAsFactors=FALSE)
2. Split 80% of data
Prasanna Gajula
50143945
Question 1 : Write a function named loadDataFromFile to open a file and return data from a specified column of the file as a vector
Answer :
> loadDataFromFile <- function(fileName, coloumnName) cfw_
+ MyData <- read.csv(fileName
Prasanna Gajula
50143945
Problem 1:
(a) Use histogram as visualization tool to explore the predictor variables and their distributions.
Please see the Hint below on how to print multiple graphs in a single layout page.
Answer :
=
library(mlbench)
data(Gl
Prasanna Gajula
50143945
Part I
Hierarchical Clustering
1. Load Data Into a Matrix
Load geneExpression.csv data into R using read.csv(). Note that you need to set header=FALSE because data don't have header.
Data can be downloaded from Doc Sharing.
Read
Problem 1
Create a Vector
a <- c(18,15,18,16,17,15,14,14,14,15,15,14,15,14,24,22,18,21,27,26)
A) Length of the vector.
length(a)
B) Print all elements of the vector without using a loop structure.
a
C) Print elements at indicies 8 through 12.
a[8:12]
D) P
Prasanna Gajula
50143945
1. Load Data
Load data whitewines.csv. The file can be downloaded from Doc Sharing.
> Data <- read.csv(file.choose(), header=TRUE, stringsAsFactors=FALSE)
2. Set Seed Value
Set a seed value to get the consistent results.
Example
Prasanna Gajula
50143945
part 1
Load Boston.csv data into a data frame.(You can get the file from Doc Sharing)
This data frame contains the following columns:
crim: per capita crime rate by town.
zn: proportion of residential land zoned for lots over 25,0
Navateja Gajula
35233825
Step 1: Load Data into a data from named breastData
> loc <- "http:/archive.ics.uci.edu/ml/machine-learning-databases/"
> ds <- "breast-cancer-wisconsin/breast-cancer-wisconsin.data"
> url <- paste(loc, ds, sep=")
> breastData <-
Hints to solutions for HW#12
Exercise 34.5-1:
o Prove it is in NP.
o Prove that CLIQUE p SUBGRAPH-ISOMORPHISM.
Exercise 34.5-2:
o Prove it is in NP.
o Prove that 3-CNF-SAT p 0-1 INTEGER-PROGRAMMING
Exercise 34.5-3:
o Prove it is in NP.
o Prove that 0-
Hints to solutions for HW#2
Exercise 16.1-3:
o Least Duration
i
Si
Fi
1
0
5
2
3
6
3
5
10
o Overlaps the fewest
i
1
2
3
4
5
6
7
8
9
Si
1
4
7
1
1
3
5
6
6
Fi
3
6
9
4
4
5
7
8
8
o Earliest start
i
Si
Fi
1
0
1
2
1
3
3
2
4
Exercise 16.3-3:
Symbol
a
b
c
d
e
f
g
Hints to solutions for HW#4
Exercise 22.5-3:
No it does not always produce correct results. Example.
1
1
1
1
1
1
1
2
3
1
1
1
1
1
1
Exercise
1 22.5-7:
o 1Call STRONGLY-CONNECTED-COMPONENTS
o
o
Perform topological sort for all SCC.
For all SSCi i=1, 2, 3,
Hints to solutions for HW#11
Exercise 34.2-10:
Follow the contrapositive proof.
If P = NP, if X NP, A is in P.
we can decide in polynomial time any member of A.
reverse the output of the decision.
A` P. A` NP.
A coNP.
NP = co NP.
Exercise 34.3-2:
F1
Hints to solutions for HW#5
Problem 23-3(a):
o Proof by contrapositive.
o If tree T isnt a bottleneck spanning tree of G => T isnt a MST of G.
If L is the maximum weight edge in T=> Remove L => two trees T1, T2 => Find L
s.t. L<L => connect T1 and T2 us