i <- 1:100

x <- ( (-1)^(i+1) )/(2*i - 1)

# solution
my_sol <- sum(x)
my_answers <- make_random_answers(my_sol)

#check_answers(my_answers)

Question

Create a vector x according to the following formula, where $i = 1 ... 100$. What is the sum of the elements of x?

$$ x_i=\frac{-1^{i+1}}{2i-1} $$

exams::answerlist(my_answers, markup = "markdown")

Solution


Meta-information

extype: num exsolution: r my_sol exname: "numeric " exshuffle: TRUE



msperlin/afedR documentation built on Sept. 11, 2022, 9:49 a.m.