The following problems were given to Tennessee State University (TSU) Freshman Engineering Seminar students in the Fall 2015 semester.



Note: If you wish to replicate the R code below, then you will need to copy and paste the following commands in R first (to make sure you have all the packages and their dependencies):

install.packages("install.load")
# install the install.load package

install.load::install_load("mosaic", "Deriv", "DescTools", "prob", "signal", "htmlTable", "iemisc")
# install and/or load the packages and their dependencies, this does not require extra system dependencies (this process may take a while depending on the number of dependencies)

# if you have Java, Jython, Python, Sympy, Numpy, Yacas, etc. installed on your system, then you can use the code below:
install.load::install_load("mosaic", "Ryacas", "Deriv", "DescTools", "prob", "signal", "rSymPy", "htmlTable", "iemisc")
# install and/or load the packages and their dependencies, including the extra system dependencies (this process may take a while depending on the number of dependencies)


install.packages("import") # install the import package

import::from(pracma, roots, fzero) # import ode45 from the pracma package


This document was created with rmarkdown 1.2 using the following:



Solve the following problems:

1) \(\int~x^2 + 2x - 2 x~dx\)



Solved using the mosaic package:


library(mosaic)

antiD(x^2 + 2 * x - 2 ~ x)
## function (x, C = 0) 
## 1/3 * x^3 + 1 * x^2 - 2 * x + C



Solved using the Ryacas package:


library(Ryacas)  # requires yacas

x <- Sym("x")

Integrate(x^2 + 2 * x - 2, x)
## expression(x^3/3 + x^2 - 2 * x)



Solved using the rSymPy package:


library(rSymPy) # requires Java, Jython, Python

x <- Var("x")

sympy("integrate(x**2 + 2*x - 2, x)")

[1] "-2*x + x**2 + x**3/3"



2) \(\frac{d}{dx}~x + 2x - 2\)



The following solution is using base R only:


simp.exp <- expression(x^2 + 2 * x - 2)

(D.sc <- D(simp.exp, "x"))
## 2 * x + 2



Solved using the Deriv package:


library(Deriv)

f <- function(x) x^2 + 2 * x - 2

Deriv(f)
## function (x) 
## 2 + 2 * x



Solved using the mosaic package:


library(mosaic)

D(x^2 + 2 * x - 2 ~ x)
## function (x) 
## 2 * x + 2



Solved using the Ryacas package:


library(Ryacas)  # requires yacas

x <- Sym("x")

deriv(x^2 + 2 * x - 2, x)
## expression(2 * x + 2)



Solved using the rSymPy package:


library(rSymPy) # requires Java, Jython, Python

x <- Var("x")

sympy("diff(x**2+2*x-2, x, 1)")

[1] "2 + 2*x"



3) If x = 5, then what is \(x^2 + 2x - 2\)?



x <- 5

x^2 + 2 * x - 2
## [1] 33



4) 5, 2, 4, 6, 9.2, 10.0, 100, 7, 2



  1. What is the mean of the above data set?
mean(c(5, 2, 4, 6, 9.2, 10, 100, 7, 2))
## [1] 16.13333



  1. What is the median of the above data set?
require(stats)

median(c(5, 2, 4, 6, 9.2, 10, 100, 7, 2))
## [1] 6



  1. What is the mode of the above data set?
library(DescTools)

Mode(c(5, 2, 4, 6, 9.2, 10, 100, 7, 2))
## [1] 2



5) If you have a standard 54 card deck, what is the probability that you will pick any card from the Hearts suite?



# The Jokers are included

library(prob)

cds <- cards(jokers = TRUE, makespace = TRUE)  # include the probability column in the
# cards function and create a data.frame called cds of the cards function

Heart <- subset(cds, suit == "Heart")  # subset cds with only the Heart suit

Heartprob <- Prob(Heart)  # Calculates the probability

Heartprob
## [1] 0.2407407



or



# The Jokers are not included

library(prob)

cds <- cards(makespace = TRUE)  # include the probability column in the cards function and
# create a data.frame called cds of the cards function

Heart <- subset(cds, suit == "Heart")  # subset cds with only the Heart suit

Heartprob <- Prob(Heart)  # Calculates the probability

Heartprob
## [1] 0.25



6) What is the angle between force F and the x-axis, where F = 30i + 50j - 20k newtons? (Olia 25)



library(iemisc)

Fx <- 30  # 30i

Fy <- 50  # 50j

Fz <- -20  # -20k

cos_thetax <- Fx/sqrt(Fx^2 + Fy^2 + Fz^2)

theta <- acosd(cos_thetax)  # degrees

theta
## [1] 60.87843



7) Solve the equation x(2x - 3) = 5 for x. (Olia 73)



Solved using the signal package:


library(signal)

roots(c(2, -3, -5))
## [1]  2.5 -1.0



Solved using the pracma package:


import::from(pracma, roots)

roots(c(2, -3, -5))
## [1]  2.5 -1.0



Solved using the pracma package:


import::from(pracma, fzero)

fzero(function(x) 2 * x^2 - 3 * x - 5, 2)
## $x
## [1] 2.5
## 
## $fval
## [1] 0



8) Solve this system of equations: (Olia 75)



\[x - y + z = -3\] \[2x + y = 1\] \[y - 3z = 7\]

a <- matrix(c(1, -1, 1, 2, 1, 0, 0, 1, -3), nrow = 3, ncol = 3, byrow = TRUE)

b <- c(-3, 1, 7)

solve(a, b)
## [1]  0  1 -2




A segment of a spreadsheet is shown below. Use the numbers in the cells to answer the following questions. (Olia 159-160)

install.load::load_package("data.table", "htmlTable", "iemisc")

spread <- data.table(v1 = c(NA, 1:5), v2 = c("A", "20", "5", "6", "7", "8"), 
    v3 = c("B", "21", "A2^2", "A3^2", "A4^2", "A5^2"), v4 = c("C", "22", "B2*A$1", 
        "B3*B$1", "B4*C$1", "B5*D$1"), v5 = c("D", "23", "", "", "", ""))

setnames(spread, rep("", 5))

htmlTable(spread, rnames = FALSE, align = "c", align.header = "c", caption = "Spreadsheet segment (Olia 159-160)", 
    css.cell = "padding-left: 1em; padding-right: 1em;")
Spreadsheet segment (Olia 159-160)
A B C D
1 20 21 22 23
2 5 A2^2 B2*A$1
3 6 A3^2 B3*B$1
4 7 A4^2 B4*C$1
5 8 A5^2 B5*D$1



9) What will be the top to bottom values in column B (Olia 159-160)?



A <- c(20, 5, 6, 7, 8)

B <- data.table(B = c(21, A[2]^2, A[3]^2, A[4]^2, A[5]^2))

htmlTable(B, rnames = FALSE, align = "c", align.header = "c", caption = "B column spreadsheet segment (Olia 159-160)")
B column spreadsheet segment (Olia 159-160)
B
21
25
36
49
64
D <- 23

C <- 22

C <- c(22, B[2] * A[1], B[3] * B[1], B[4] * C, B[5] * D)



10) What will be the top to bottom values in column C (Olia 159-160)?



A <- c(20, 5, 6, 7, 8)

B <- c(21, A[2]^2, A[3]^2, A[4]^2, A[5]^2)

D <- 23

C <- 22

C <- data.table(C = c(22, B[2] * A[1], B[3] * B[1], B[4] * C, B[5] * D))

htmlTable(C, rnames = FALSE, align = "c", align.header = "c", caption = "C column spreadsheet segment (Olia 159-160)")
C column spreadsheet segment (Olia 159-160)
C
22
500
756
1078
1472



Works Cited

Masoud Olia, Ph.D., P.E. and Contributing Authors, Barron’s Fundamentals of Engineering Exam, Hauppauge, New York: Barron’s Educational Series, Inc., 2015, pages 25, 73, 75, 159-160.



77u/LS0tCnRpdGxlOiAiU29sdmVkIFByb2JsZW1zIGdpdmVuIHRvIEZyZXNobWFuIEVuZ2luZWVyaW5nIFNlbWluYXIgU3R1ZGVudHMsIEZhbGwgMjAxNSIKYXV0aG9yOiAiSXJ1Y2thIEVtYnJ5LCBFLkkuVC4iCmRhdGU6ICJgciBTeXMuRGF0ZSgpYCIKb3V0cHV0OgpodG1sX2RvY3VtZW50OgptYXRoamF4OiBkZWZhdWx0Ci0tLQoKPGJyIC8+CjxiciAvPgoKVGhlIGZvbGxvd2luZyBwcm9ibGVtcyB3ZXJlIGdpdmVuIHRvIFRlbm5lc3NlZSBTdGF0ZSBVbml2ZXJzaXR5IChUU1UpIEZyZXNobWFuIEVuZ2luZWVyaW5nIFNlbWluYXIgc3R1ZGVudHMgaW4gdGhlIEZhbGwgMjAxNSBzZW1lc3Rlci4KCjxiciAvPgo8YnIgLz4KCk5vdGU6IElmIHlvdSB3aXNoIHRvIHJlcGxpY2F0ZSB0aGUgUiBjb2RlIGJlbG93LCB0aGVuIHlvdSB3aWxsIG5lZWQgdG8gY29weSBhbmQgcGFzdGUgdGhlIGZvbGxvd2luZyBjb21tYW5kcyBpbiBSIGZpcnN0ICh0byBtYWtlIHN1cmUgeW91IGhhdmUgYWxsIHRoZSBwYWNrYWdlcyBhbmQgdGhlaXIgZGVwZW5kZW5jaWVzKToKCmBgYHtyIGV2YWwgPSBGQUxTRX0KaW5zdGFsbC5wYWNrYWdlcygiaW5zdGFsbC5sb2FkIikKIyBpbnN0YWxsIHRoZSBpbnN0YWxsLmxvYWQgcGFja2FnZQoKaW5zdGFsbC5sb2FkOjppbnN0YWxsX2xvYWQoIm1vc2FpYyIsICJEZXJpdiIsICJEZXNjVG9vbHMiLCAicHJvYiIsICJzaWduYWwiLCAiaHRtbFRhYm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