Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SolveTask One We will start our exploration of the connections between sequences, series, power series, and computing by examining and executing a very basic computer

SolveTask One
We will start our exploration of the connections between sequences, series, power series, and computing by examining and executing a very basic
computer program. In doing so, we will explore the basics of "Floating Point Numbers," which underlies how our computers store numbers.
The following code uses a "while" loop, which starts at the command "while" and ends at the command "end". A "while" loop operates much like a
for loop. After each command "sum=sum+diff", the computer evaluates the condition in the "while" line. If the condition is met, the computer runs
the loop again, and the computer stops if the condition is not met. In this case, as long as "sum1", the computer will run the command
"sum=sum+diff". Documentation on a "while" loop can be found here in the Mathworks Help Center (MathWorks).B
The following code also uses the "vpa" function, which approximates numbers to various levels of precision. For instance, vpa(pi) gives 32
significant digits of pi. vpa(pi,50) gives 50 digits of pi, and vpa(pi,3) gives 3 digits of pi. Documentation on "vpa" can be found here in the
Mathworks Help Center (Mathworks), B
Task: Make the following posts. First, answer Questions for Code 1, Questions for Code 2, and then work towards a Final Group Post as
described below.
For your first post, read the following two codes (i.e., Code 1 and Code 2) and answer the following questions:
Code 1
x0=.91
n=9
diff=1.000-x0n
sum=x0
while sum1
sum=sum+diff
end
disp(sum)
This code can also be found in this Code 1 document. (DOCX) darr
Questions for Code 1
Before you run the code, explain what the code is doing and what you expect the final value of "sum" to be.
Run the code. Was the output what you expected?
Run the code at x0=.5, was the output as you expected?
Run the code at x0=.1, was the output as you expected?
Explain any discrepancies between what you expect the code to do and what the code actually does. See Code 2 below if you need more
insight into these discrepancies.
This code can also be found in this Code 2 document. (DOCX):,darr
Questions for Code 2
Before you run the code, explain what the code is doing and what you expect the value of "a-b" to be.
Explain any discrepancies between what you expect the code to do and what the code actually does.
Matlab stores .1 as a "Floating-Point Number." Use the result of "a-b" to explain what happens with x0=.1 in Code 1.
Fixing Code 1
By the end of Module 7, your group should agree on changes to Code 1 that would make it give a mathematically accurate output for x0=.1, and
for other potentially problematic 0 values. Your suggested changes should also include an explanation of the errors in terms of sequences and
series and the resulting errors associated with partial summations.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Image Databases Towards Advanced Image Retrieval

Authors: Yihong Gong

1st Edition

1461375037, 978-1461375036

More Books

Students also viewed these Databases questions

Question

What is Ramayana, who is its creator, why was Ramayana written?

Answered: 1 week ago

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago