Problem 226

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
albert
Posts: 61
Joined: Sat Aug 02, 2008 12:36 pm

Problem 226

Post by albert »

Code: Select all

In Euler226 The definition of S(x) defines a function like

       *              *
     *   *         * 
   *        *    *
*              *

In electronics this is called a triangular wave form.

This is how a sawtooth is wave form looks like.


         *        *
      *  *     *  * 
    *    *   *    *
*        *        *

This would define S(x) as the distance to the preceding integer.

I think this may be need of clarification.

Groetjes Albert
quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Euler 226: sawtooth or triangular wave?

Post by quilan »

Saw tooth can be defined as the distance x is to the closest integer. So it's a triangle wave.

Edit: I see what you're saying, as that's correct for Electronics / etc. Some clarification could probably be used.
ex ~100%'er... until the gf came along.
Image
User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 11:15 pm
Location: Bremen, Germany

Re: Euler 226: sawtooth or triangular wave?

Post by daniel.is.fischer »

In real life, there are saws with differently shaped teeth, let's call them mathematically shaped and electronically shaped :lol:
In mathematics, the distance to the nearest integer is commonly called the saw-tooth function (or Weierstraß' saw-tooth function if one wants to be more precise). Electronics follows a different convention :(

So, how should we clarify it?
"Note (for electrical engineers): This saw-tooth function is not the one you're used to."?
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Euler 226: sawtooth or triangular wave?

Post by ed_r »

Our definition goes back to at least 1937.

IMHO, proponents of such modern-day sorcery as ... "electronics" ( *ugh* :twisted: ) ... should just live with it.

And before you rush to complain: yes, as it happens, I am typing this into an abacus! :lol:
!647 = &8FDF4C
User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 11:57 pm
Location: Netherlands

Re: Euler 226: sawtooth or triangular wave?

Post by stijn263 »

daniel.is.fischer wrote:(..) In mathematics, the distance to the nearest integer is commonly called the saw-tooth function (or Weierstraß' saw-tooth function if one wants to be more precise). Electronics follows a different convention :(
Not just electronics, the saw-tooth function they teach in my mathematics study is the one shown by albert in the first post..
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Euler 226: sawtooth or triangular wave?

Post by ed_r »

Well hooray for diversity ;-)
!647 = &8FDF4C
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Euler 226: sawtooth or triangular wave?

Post by hk »

Would everybody be happy if we changed "where s is the sawtooth function" in "where s is a sawtooth function"
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Euler 226: sawtooth or triangular wave?

Post by ed_r »

Who's "everybody"? Two dissenters out of, how many, 50K? Let's move on …
!647 = &8FDF4C
quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Euler 226: sawtooth or triangular wave?

Post by quilan »

To be fair, I also thought it meant the jagged sawtooth wave until I realized the function would look nothing like it did in the picture. A quick trip to wiki land gave me the right idea for the curve.
Last edited by quilan on Wed Jan 07, 2009 3:12 pm, edited 1 time in total.
ex ~100%'er... until the gf came along.
Image
JohnMorris
Posts: 64
Joined: Sun Dec 23, 2007 6:38 am

Re: Euler 226: sawtooth or triangular wave?

Post by JohnMorris »

Image
ishkur
Posts: 1
Joined: Tue Jan 06, 2009 1:43 am

Re: Euler 226: sawtooth or triangular wave?

Post by ishkur »

A look at the wikipedia page for the Blancmange curve shows this:

Image

Hope that helps clear any lingering doubts.
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Euler 226: sawtooth or triangular wave?

Post by ed_r »

There are no doubts about the definition. (Some) people just don't like the name "sawtooth function".
!647 = &8FDF4C
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Euler 226: sawtooth or triangular wave?

Post by hk »

Anyhow. I f one looks up sawtooth one does not find the form we need.
Is the mentioning of "sawtooth function" really necessary? Cannot we do without?
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Euler 226: sawtooth or triangular wave?

Post by ed_r »

Yes, of course we can do without. But I don't see the need to change it.
!647 = &8FDF4C
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Euler 226: sawtooth or triangular wave?

Post by hk »

Why not if it gives some people the wrong impression?
Image
War ruins the life and health of untold numbers of innocent children.
JohnMorris
Posts: 64
Joined: Sun Dec 23, 2007 6:38 am

Re: Euler 226: sawtooth or triangular wave?

Post by JohnMorris »

How about changing "where s is the sawtooth function" to "where s has the form of a triangle wave".

The first three Google hits for "Triangle wave" (to Wikipedia, Mathworld and some audio site) all show pictures of the right thing.
Image
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Euler 226: sawtooth or triangular wave?

Post by ed_r »

Edited to remove reference to "sawtooth" function. Let's hear no more about it.
!647 = &8FDF4C
ImRe
Posts: 12
Joined: Thu Aug 28, 2008 3:09 pm

Re: Problem 226

Post by ImRe »

I'm sort of stuck on this one.

Can somebody verify if the area under the circle between the intersection points are
0.09040954?

Thx.
User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: Problem 226

Post by Tommy137 »

That's not right :(
Image
ImRe
Posts: 12
Joined: Thu Aug 28, 2008 3:09 pm

Re: Problem 226

Post by ImRe »

Thx. It helped a lot.
Post Reply