Home /
Expert Answers /
Computer Science /
language-is-python-problem-6-sums-of-reciprocals-of-factorials-compute-the-following-value-1-pa862
(Solved): Language is Python
Problem 6: Sums of reciprocals of factorials Compute the following value: \[ 1 ...
Language is Python
Problem 6: Sums of reciprocals of factorials Compute the following value: \[ 1+1 / 1 !+1 / 2 !+1 / 3 !+1 / 4 !+\ldots+1 / 10 \text { ! } \] The value should be close to \( e(\approx 2.71828) \), the base of the natural logarithms. Like with the previous few problems, you should use a variable \( n=10 \) to determine how many fractions to add. In theory, increasing this number should get you closer to the true value of e. Hint: The easiest way to solve this is with two nested for loops. It is possible, but tricky, to compute this using only one for loop. That is not necessary for this assignment. Hint: Copy your solution to "Problem 5: Multiple factorials", then modify it. Rather than printing the factorials, you will add their reciprocals to a running total, then print that total at the end. Hint: don't try to work the very first "1 +" into your loop; do it outside the loops (either at the very beginning or the very end of the outer loop).