Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

#76 2013-07-25 03:16:04

bobbym
Administrator

Offline

Re: An Integral and the Computer

Good point, yours does seem to converge faster than the normal trapezoid rule.

That is why I said leave it alone. But supposing you are asked for the exact trapezoid answer on a test or something. Yours, because it is a different algorithm will not be able to provide it.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#77 2013-07-25 03:19:51

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Hmm.... You mean to say that I've made a difference from the standard trapezoidal rule. But where, how??

THe next person knows.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#78 2013-07-25 03:23:00

bobbym
Administrator

Offline

Re: An Integral and the Computer

The next person does not. There are so many variations of each method that it is impossible for me to say.

What is more important is whether this algorithm converges as the original one does.

I would use the empirical method and continue from there, another type of creature would demand a proof.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#79 2013-07-25 12:09:02

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Will you please answer a question?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#80 2013-07-25 13:02:12

bobbym
Administrator

Offline

Re: An Integral and the Computer

Sorry, I found the problem when I began to think that yours was correct and maybe mine was not, instead of the other way around.

There is nothing wrong with your program, mine had a subtle error in it.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#81 2013-07-25 14:34:59

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

May I see your program?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#82 2013-07-25 17:43:18

bobbym
Administrator

Offline

Re: An Integral and the Computer

Hi;

I did not write it like this. Mathematica allows me to write things as formulas, just as I see them in math books. So I naturally did it like that.

But if I were going to use M's procedural capabilities I would have done this:

Code:

f[x_] := Cos[x]^100;

a = 0;

b = π/4 // N;

n = 10;

h = (b - a)/n;

s = 0;

For[k = 1, k < n, k++,
 s += f[a + k*h]]

h*((f[a] + f[b])/2 + s)

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#83 2013-07-25 22:26:55

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Where is your subtle error?

Anyway, another question remains


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#84 2013-07-25 22:30:46

bobbym
Administrator

Offline

Re: An Integral and the Computer

It was in the M code, not in that.

Another question?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#85 2013-07-25 22:47:54

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Why does my progrAm give the following?

f(x) = x^9 between 0 and 10 with 100000 intervals.

I get 1000000000.75


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#86 2013-07-25 22:51:13

bobbym
Administrator

Offline

Re: An Integral and the Computer

That is what you are supposed to get.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#87 2013-07-25 23:05:09

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Why? sad


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#88 2013-07-25 23:08:16

bobbym
Administrator

Offline

Re: An Integral and the Computer

The true value of the integral is 10000000, so your answer of 1000000000.75 is relatively close. Remember numerical integration by trapezoidal rule is an approximate method although it will be exact for some.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#89 2013-07-25 23:58:17

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

It is extremely close but is that an error?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#90 2013-07-26 00:02:57

bobbym
Administrator

Offline

Re: An Integral and the Computer

No, that is what is expected.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#91 2013-07-26 00:05:13

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

What do I do to get a precision of up to three digits after decimal?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#92 2013-07-26 00:06:20

bobbym
Administrator

Offline

Re: An Integral and the Computer

For that problem? Because it is a large number it will require a lot of trapezoids.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#93 2013-07-26 00:18:40

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Oh.

Could you tell me what is the Simpson rule?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#94 2013-07-26 00:19:38

bobbym
Administrator

Offline

Re: An Integral and the Computer

The Simpson rule puts arcs that are quadratics on top instead of triangles.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#95 2013-07-26 00:30:54

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

really? How?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#96 2013-07-26 00:32:24

bobbym
Administrator

Offline

Re: An Integral and the Computer

The trapezoid rule fits two points on top with a straight line, the simpsons takes three points and fits a quadratic on top.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#97 2013-07-26 00:40:17

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

How to do that? I think it is amazing


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#98 2013-07-26 00:40:56

bobbym
Administrator

Offline

Re: An Integral and the Computer

We will go over it as the next one. Can it wait till tomorrow?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

#99 2013-07-26 00:44:54

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: An Integral and the Computer

Yes, happily. But my tomorrow and yours have a difference. I would like to know how many seconds?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Who are you to judge everything?' -Alokananda

#100 2013-07-26 00:46:22

bobbym
Administrator

Offline

Re: An Integral and the Computer

It is night there. You will sleep soon. When you awaken we will start.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Board footer

Powered by FluxBB