4
$\begingroup$

The Question More Information fvalues

I would really appreciate it if someone could help me with this multiple choice question, I don't have any more attempts and I already got wrong what I thought the answer was ({x0, x0, .., xn} is not right!).

Im new to Mathematica, but I figure this should be a relatively easy question to answer for someone who knows what you're doing.

Extract from the Mathematica notebook referred to above added.

$\endgroup$
3
  • 1
    $\begingroup$ Perhaps you could look at the documentation for Table and tell us if anything is unclear to you. See in particular the first few examples. $\endgroup$
    – jjc385
    Commented Jul 5, 2017 at 23:42
  • $\begingroup$ Or perhaps try running the code and looking at the variable fvalues. $\endgroup$
    – bill s
    Commented Jul 5, 2017 at 23:48
  • 1
    $\begingroup$ 'Image' I can't comment on your post because I don't have enough reputation, but I hope this is what you were asking for. $\endgroup$
    – Mike
    Commented Jul 5, 2017 at 23:48

1 Answer 1

1
$\begingroup$

I conjecture that the 3rd choice in the list of answers you give is the correct one and use Mathematica to verify the conjecture.

a = 1;
b = 2;
n = 10;
Δx = (b - a)/n;
f[x_] = 1/x;

First let us note that

a + 10 Δx == b

True

Now let's look at

Block[{a, b, Δx, f}, Print[Table[f[a + i Δx], {i, 0, n}]]]

table

I use Block to get a symbolic result. Remembering that a + 10 Δx == b, this is the same as the 3rd choice in the list of answers.

Let's test it against fvalues

fvalues = Table[f[i], {i, a, b, Δx}];
fvalues == Table[f[a + i Δx], {i, 0, n}]

True

Q.E.D.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.