Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

Bed beckons...must obey before I can't locate the bed through my shut, tired eyes.

I've enjoyed the problem. Thanks!

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

Okay, thanks for coming and have a good night.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**ShivamS****Member**- Registered: 2011-02-07
- Posts: 3,646

Does the prime matter?

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**ShivamS****Member**- Registered: 2011-02-07
- Posts: 3,646

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**ShivamS****Member**- Registered: 2011-02-07
- Posts: 3,646

*Last edited by ShivamS (2014-03-16 03:38:34)*

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

Hi;

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

phrontister wrote:

Oooo...nice! Tried it. I didn't know you could do that.

bobbym wrote:Which part?

phrontister wrote:RootApproximant with FullSimplify, to convert the G result to that nice, brief, accurate answer.

And I like the slider proof!

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

Hi;

Geogebra is a great program.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

Yes, it made my initial job easy. When I started this problem it took just a very short time to draw it up in G and to get its decimal approximation.

I pressed on to see if I could find a formula solution...which I finally got, after lots of searching. However, the formula was very large and I wanted to simplify it, which was beyond my capabilities of doing by hand because of its complexity.

And so I enlisted M's help...and I have to assume that the simplification it gave (which is the same as in your Computer Math thread) is correct because I trust M (I think) and I have no means of proving or disproving it by hand.

Anyway, how could M be wrong? After all, in my M, the result of my formula minus M's simplified answer, viz:

N[My formula,100000000] - N[M's simplified answer,100000000],

= 0.*10^-100000000. (and the result is also zero for smaller N[]s)

But W|A disagrees with my M result for N[1000000] (the only one I tested it on)! It's very close-ish, though. And, unlike my M, it gives different answers (though both still very close-ish) depending on whether or not I make its job 'easier' by using "14" instead of "2x7" and "245" instead of "5x7²" in my formula ('7' being my prime-number choice)!! Xlnt!!!

*Last edited by phrontister (2014-03-17 14:26:56)*

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

Different algorithms will get different answers.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

I tried some things in W|A and found that the discrepancies relate to N[]. Testing for N's digit precision = powers of 10, N[*expr*,1000] and below give the correct answer (zero), but N[*expr*,10000] and above give the discrepancies.

My M copes with N[*expr*,100000000], but the next power of 10 causes an overflow in the computation because "the limit $MaxPrecision = ∞ was reached". But I don't really need to go to 1 billion digit precision with this.

*Last edited by phrontister (2014-03-18 01:47:07)*

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

What were your expressions? The ones you posted?

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

Yes, exactly as in post #8, but with p replaced by a value (7), and FullSimplify replaced by N (with a digit precision value).

From that I deducted the simplified output, which I had to give its own N because I was getting the error "N::meprec: Internal precision limit $MaxExtraPrecision = 50" if I used a single N for the whole calculation...but if I didn't set a precision value, the output was zero, as expected. W|A succeeds here up to N=1000 with answer = zero, but fails at N=10000 as before.

Also, for that 'different answers' discrepancy I mentioned in the last paragraph of post #36, W|A gives answer zero if N=1000.

So it looks like the problems are just memory related, and I guess that for my M there's an internal precision setting that could be changed fix the problem I'm getting with the single N when I set its value.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

Hi;

At 1000 mine spits out.

You can change that internal value to whatever you like.

`$MaxExtraPrecision = 100`

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

Hi Bobby,

Mine gives the same output as yours, which I've been calling 'zero' in other posts.

I tried your code and also looked it up in the help files. The example given there works in my M, but not for my expression that has the single 'N' (with any precision value).

It's not bothering me, though, so I think I'll just let it slide.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

It is one of the problems connected with using floating point numbers. Congratulations if you have been calling it zero!

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

Well, I thought that 0.*10^-1000 (or 0.*10^-100000000 as per post #36), was probably near enough to zero for me to call the deduction's result 'zero' fairly safely.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

The ability to spot the difference between a fungus and actually a valuable answer comes with some experience in numerical analysis. For instance, in numerical work Newton's will also produce tiny complex fungi.

Somewhat better than doing that subtraction ( remembering that computers should never be used to compare floating point numbers and that they can not subtract very well) is to come up with a completely different method and see if the answers are the same.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,079

Hi Bobby,

I've been confident all along that my non-decimal trig answer is correct, and I just wanted to prove that M's simplified answer to my formula was also correct.

M's help file on FullSimplify says that it "tries a wide range of transformations on *expr *involving elementary and special functions, and returns the simplest form it finds", which to me means that the simplified version gives exactly the same result as the original.

I understand from M's help file that M's RootApproximant[x] of G's decimal answer (which is rounded to 15 decimal places) may not be 100% correct, as it "converts the number *x* to one of the "simplest" algebraic numbers that approximates it well". However, the approximation was so good that FullSimplify gave the correct answer.

With my comparison of my formula and M's simplified version, I thought that subtractions in M would be accurate, but apparently not always so with floating point numbers.

...come up with a completely different method and see if the answers are the same.

Using my formula and its simplified answer from M, with both methods set to N=1000000 level of precision, I compared the 100 digits from the 500000th to 500099th of each method and they are exactly the same, as are their last 100 digits. So subtraction worked fine in this case.

M's answer, which contains two fives, seems to indicate for this pentagon problem that there may be a much simpler approach than mine out there somewhere......

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 95,855

Hi;

Your solution is fine and we do not always have the luxury of having two solutions to choose from. You did good.

**In mathematics, you don't understand things. You just get used to them.**

**If it ain't broke, fix it until it is.**

Offline