Page 69: #12

A company with a fleet of trucks faces increasing maintenance costs as the age and mileage of the trucks increases.

Identify a problem you would like to study. List the variables affect the behavior you have identified.

Variables to consider:

Which variables would be neglected completely?

Which might be considered as constants initially?

Can you identify any submodels you would want to study in detail?

Identify any data you would want collected.

Page 79: # 11

Determine whether the data set supports the stated proportionality model.

\[ y \propto x^3 \]

\(y \propto x^3\) if and only if \(y = kx^3\) for a constant k. Determine whether there is a positive constant \(k\) satisfying \(y = kx^3\).

We can calculate the ratio of \(y^{1/3}/x\) or \(y/x^3\) as both should be true if the data set is proportional.

y <- c(0, 1, 2, 6, 14, 24, 37, 58, 82, 114)
x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

data <- data.frame(y, x)

data$ratio <- data$y/data$x^3

ggplot(data, aes(x=x, y=ratio)) + geom_point() + ggtitle('Ratio of y/x^3')

# calculate the average ratio of y/x^3
k <- (mean(data$ratio))

\[y = 0.0963571x^2\]

data$predicted <- k*data$x^3

df <- rbind(data.frame(value = 'Actual', x = data$x, y = data$y),
            data.frame(value = 'Predicted', x = data$x, y = data$predicted))


ggplot(df, aes(x=x, y=y, color=value)) + geom_line()

We see some an increasing difference between the actual versus predicted values starting at \(x = 5\)

Recalculate \(k\) this time with the average ratio starting from the x >= 5

# calculate the average ratio of y/x^3 starting with x = 5

k <- mean(subset(data, x > 4, select=ratio)$ratio)

\[y = 0.1117912x^3\]

data$predicted2 <- k*data$x^3

rbind(data.frame(value = 'Actual', x = data$x, y = data$y),
            data.frame(value = 'Predicted', x = data$x, y = data$predicted2)) %>%
ggplot(aes(x=x, y=y, color=value)) + geom_line()

With the second approach, we see that the data set does support proportionality with the constant \(k = 0.1117912\) producing a close fit. The second \(k\) value produces a much closer fit. Worth noting is that the line generated by this data set does not pass through the origin, although it is very close.

Page 94: #4

Lumber Cutters–Lumber cutters wish to use readily available measurements to estimate the number of board feet of lumber in a tree. Assume they measure the daimeter of the tree in inches at waist height. Develop a model the predicts board feet as a function of diameter in inches.

x <- c(17, 19, 20, 23, 25, 28,  32,  38,  39,  41)
y <- c(19, 25, 32, 57, 71, 113, 123, 252, 259, 294)

data <- data.frame(x, y); data
##     x   y
## 1  17  19
## 2  19  25
## 3  20  32
## 4  23  57
## 5  25  71
## 6  28 113
## 7  32 123
## 8  38 252
## 9  39 259
## 10 41 294

The variable \(x\) is the diameter of a ponderosa pine in inches, and \(y\) is the number of board feet divided by 10.

Consider two separate assumptions, allowing each to lead to a model. Completely analyze each model.

  1. Assume that all trees are right-circular cylinders and are approximately the same height.

The characteristic dimension of a cylinder is the diameter \(d\). The number of board feet is a function of the volume which is given by \(V = \pi r^2h\). Assuming that the radius is proportional to the diameter, we derive:

\[ V \propto r^2 \propto d^2 \]

where \(h\) is constant since all trees are the same height.

For this model we assume that all trees are of the same height so the volume is a function of the diameter squared which is the \(x\) variable.

\[ V \propto d^2 \] or \[ y \propto x^2\]

where \(y = board feet\) and \(x = diameter\)

Using this, we calculate proportionality using:

\(y \propto x^2\) if and only if y = kx^2 for a constant \(k\) which leads to \(y \propto x^2\)

Calculate the ratio of \(y/x^2\)

data$ratio <- data$y/data$x^2  

k <- (mean(data$ratio))

\[y = 0.122029 * x^2 \]

data$predicted <- k*data$x^2   

df <- rbind(data.frame(value = 'Actual', x = data$x, y = data$y),
            data.frame(value = 'Predicted', x = data$x, y = data$predicted))

ggplot(df, aes(x=x, y=y, color=value)) + geom_line()

  1. Assume that all trees are right-circular cylinders and that the height of the tree is proportional to the diameter.

For this model we assume that the height of the tree is proportional to the diameter. From above, we have volume is proportional to diameter squared (\(V \propto d^2\)). In this problem, we are to assume that \(h\) is proportional to the diameter.

\[ V \propto d^2 * h \propto d^3 \]

Therefore the volume of each tree is a proportional to the diameter cubed or \(V \propto d^3\).

\[ y \propto x^3 \]

where \(y = board feet\) and \(x = diameter\)

x <- c(17, 19, 20, 23, 25, 28,  32,  38,  39,  41)
y <- c(19, 25, 32, 57, 71, 113, 123, 252, 259, 294)

data <- data.frame(x, y); data
##     x   y
## 1  17  19
## 2  19  25
## 3  20  32
## 4  23  57
## 5  25  71
## 6  28 113
## 7  32 123
## 8  38 252
## 9  39 259
## 10 41 294

\(y/x^3 = k\)

data$ratio <- data$y/data$x^3

k <- mean(data$ratio)

data$predicted <- k*data$x^3

\[y = 0.004286668 * x^3 \]

df <- rbind(data.frame(value = 'Actual', x = data$x, y = data$y),
            data.frame(value = 'Predicted', x = data$x, y = data$predicted))
 
ggplot(df, aes(x=x, y=y, color=value)) + geom_line()

  1. The second model appears to be better. The fit of the model appears to be more accurate than compared to the first.