Q1. Here is the random sample:

x = c(57.8,53.8,56.4,53.6,63.3,58.0,58.3,55.7,56.3,47.3,56.6,61.4,61.5,55.2,52.6,53.1,58.6,55.2,59.8,57.6,53.7,62.0,57.2,66.1,61.0,54.5,62.5,58.7,51.5,57.8)

Code to run a 1-sample \(t\) test with the t.test() function:

t.test(x, mu = 55, alternative = "two.sided", conf.level = .95)

Q2. Here are the two independent samples:

x1 = c(17.4,11.1,15.6,10.0,17.8,16.3,11.8,16.5,7.8,17.3,10.7,18.1,18.7,16.5,8.3)

x2 = c(10.6,13.6,6.8,9.8,13.2,6.8,7.2,12.2,9.4,12.7,9.7,11.0,6.0,8.8,7.7,14.3,8.1,8.7,13.1,13.0)

Code to run a 2-sample \(t\) test with the t.test() function:

t.test(x = x1, y = x2, mu = 0, alternative = "two.sided", conf.level = .99)

Q2. Here are the paired samples:

y1 = c(61.7,65.4,60.1,59.8,64.9,61.6,61.3,57.6,50.0,59.6,59.0,63.2)

y2 = c(73.1,64.5,71.3,66.9,78.6,69.6,78.8,69.8,77.4,71.0,69.0,71.1)

Code to do the matched pairs test with the t.test()

t.test(x = y2, y = y1, mu = 0, alternative="two.sided", conf.level = .95, paired = TRUE)