Math Puzzle

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
Find a function H such that H(H(x)) = H(x) for all numbers x, and such that H(1) = 36, H(2) = pi/3 and H(13) = 47.

It's an optional question in one of my textbook's chapters, but it is quite interesting!
 
Mar 10, 2005
14,647
2
0
English&
 

mcurphy

Diamond Member
Feb 5, 2003
4,150
8
81
Find a function H such that H(H(x)) = H(x) for all numbers x, and such that H(1) = 36, H(2) = pi/3 and H(13) = 47.

It's an optional question in one of my textbook's chapters, but it is quite interesting!

So you are looking for help on the bonus question, so that you can score extra points on your assignment? :D
 

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
So you are looking for help on the bonus question, so that you can score extra points on your assignment? :D

Lol :p

Nah, actually it's just a regular ole question in my textbook's chapter. Its a gay textbook, the author adds random questions just to piss us off. At least he tells us in advance that these are only bonus "challenges".

I've figured out an answer, it's not pretty but I think it's correct. Don't want to spoil the puzzle for others yet though.
 

mcurphy

Diamond Member
Feb 5, 2003
4,150
8
81
Lol :p

Nah, actually it's just a regular ole question in my textbook's chapter. Its a gay textbook, the author adds random questions just to piss us off. At least he tells us in advance that these are only bonus "challenges".

I've figured out an answer, it's not pretty but I think it's correct. Don't want to spoil the puzzle for others yet though.

Ahh, I see. :sneaky:

I tried to solve it, but I got stuck pretty quick. It has been years since I've had to do functions (or any kind of complicated math for that matter). So unfortunately I can't help you. :(

But I'm sure there are plenty of other math nerds around here that could give a correct solution. Good luck! :thumbsup:
 

Fenixgoon

Lifer
Jun 30, 2003
33,673
13,398
136
like all strictly mathematical problems...what does solving this actually get you? it's just like finding the probability of the sun rising tomorrow. sure, there's a possibility it won't, but it's absolutely meaningless. ;)

on the other hand, if you need to engineer something, there's a set of math problems worth solving...:D
 

JTsyo

Lifer
Nov 18, 2007
12,068
1,159
126
Find a function H such that H(H(x)) = H(x) for all numbers x, and such that H(1) = 36, H(2) = pi/3 and H(13) = 47.

It's an optional question in one of my textbook's chapters, but it is quite interesting!

H(36)=36
H(pi/3)=pi/3
H(47)=47

hmmm
Since there's pi in there, guessing it has some trig in it.
 

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
like all strictly mathematical problems...what does solving this actually get you? it's just like finding the probability of the sun rising tomorrow. sure, there's a possibility it won't, but it's absolutely meaningless. ;)

on the other hand, if you need to engineer something, there's a set of math problems worth solving...:D

haha yeah, I get where you are coming from. But you got to admire the unadulterated beauty of pure math :)
 

Farmer

Diamond Member
Dec 23, 2003
3,334
2
81
H(36)=36
H(pi/3)=pi/3
H(47)=47

hmmm
Since there's pi in there, guessing it has some trig in it.

So, the function must be periodic, but the period also varies with x. I'll think about it. I pretty sure it's some kind of beats function, i.e., sum of sines.
 
Last edited:

Farmer

Diamond Member
Dec 23, 2003
3,334
2
81
Most important thing to note is H(H(x))=H(x).

Are there any other constraints? Like, does it have to be continuous and smooth (infinitely differentiable)?

If those constraints do not apply, then you can make a point-discontinuous function that satisfies the constraints:

H(1) = H(36) = 36
H(pi/3) = H(2) = pi/3
H(13) = H(47) = 47
H(x) = x for all other x

If you force it to be smooth and continuous, it would have to be periodic, still thinking about that.
 
Last edited:

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
Are there any other constraints? Like, does it have to be continuous and smooth (infinitely differentiable)?

No, I don't think it needs to be continuous and smooth (it's a first year calc textbook lol), but do you know if there is anyway of determining a continuous/smooth function from the given points without haphazardly trying various possible curves?

For what its worth, my answer was

Let f(x) = g(x) + Indicator_fn{x in range of f(x)}*[x - g(x)]

And then fit whatever you like to g(x), as long as it satisfies the three points. I'm not particularly happy with my answer, seems like a cop-out. The question was marked 'hard' in the textbook, so I don't think it is as easy as I make it out to be.
 

RapidSnail

Diamond Member
Apr 28, 2006
4,257
0
0
H(H(x))=H(x)
[H'(H(x))][H'(x)]=H'(x)
H'(H(x))=1

I don't know if that's the proper use of the chain rule, but if it is, I don't see how the function could have a slope of 1 at each x, satisfy the conditions above and be continuous.
 

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
Also, perhaps of academic interest is whether we can prove a continuous fn. cannot exist that satisfies our given constraints?
 

Farmer

Diamond Member
Dec 23, 2003
3,334
2
81
but do you know if there is anyway of determining a continuous/smooth function from the given points without haphazardly trying various possible curves?

Yes, that technique is called splining and is a field in applied mathematics/numerical methods. It has applications in computer graphics. There are techniques to fit smooth curves through points. If you want any old curve, it shouldn't be hard (i.e., given a set of points, you can draw a curve by hand pretty easily). The techniques normally consist of finding the appropriate superposition of a basis set of smooth functions (i.e., cubic spline is a technique using cubics).

Spline:
http://en.wikipedia.org/wiki/Spline_%28mathematics)

Cubic Spline:
http://mathworld.wolfram.com/CubicSpline.html

For what its worth, my answer was

Let f(x) = g(x) + Indicator_fn{x in range of f(x)}*[x - g(x)]

And then fit whatever you like to g(x), as long as it satisfies the three points. I'm not particularly happy with my answer, seems like a cop-out. The question was marked 'hard' in the textbook, so I don't think it is as easy as I make it out to be.

If you don't require it to be smooth or continuous, then yes, you can manufacture tons of different discontinuous, weird functions that satisfy your constraints. Mine above works fine, and I don't know about yours but it seems like it should work too.
 

Farmer

Diamond Member
Dec 23, 2003
3,334
2
81
H(H(x))=H(x)
[H'(H(x))][H'(x)]=H'(x)
H'(H(x))=1

I don't know if that's the proper use of the chain rule, but if it is, I don't see how the function could have a slope of 1 at each x, satisfy the conditions above and be continuous.

Actually that's great. Now that the OP mentions this is a calc 1 problem, I think you're on the right track to the "intended" solution, but I don't think your interpretation is correct. It doesn't require the derivative H'(x) to be 1 at all x (that would be H'(x) = 1, of H'(H(x)) = 1).

Your differentiation looks weird but it seems right.

H(H(x)) = H(x)

dH/dx = ( dH(H)/dH ) dH/dX

But since, in H(H(x)), the dependency of H on H(x) is the same as the dependency of H on x in H(x), dH(H)/dH should be H'(H(x)), so

H'(H(x)) = 1

Where H'() = dH/dx (x), and you are substituting H(x) for x. Essentially H(H(x)) = H(x) is linear in H(x) (if you replace all the H(x) with x, you get H(x) = x, a straight line. The derivative of that line is 1).

I think you're right. This gets us somewhere but still need to think.
 
Last edited:

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
H(H(x))=H(x)
[H'(H(x))][H'(x)]=H'(x)
H'(H(x))=1

I don't know if that's the proper use of the chain rule, but if it is, I don't see how the function could have a slope of 1 at each x, satisfy the conditions above and be continuous.

Makes sense, but the only thing I'd note is that H(H(x)) = H(x) is only valid {x : x in H(x)}. So it is perfectly reasonable for H(x) =/= x where x not in H(x).

Then what if you have a point x in H(x) but x + dx not in H(x), this might throw out the above logic.

It's quite an interesting problem. Its essentially a function that returns values based on certain inputs, but when the output of this function is entered as input, the function returns the same output. Could be a good way to model 'garbage in garbage out' phenomena.... (doesn't make sense to use output calculated from a model as input into the model)...maybe I'm just going crazy lol
 

JJChicken

Diamond Member
Apr 9, 2007
6,165
16
81
Yes, that technique is called splining and is a field in applied mathematics/numerical methods. It has applications in computer graphics. There are techniques to fit smooth curves through points. If you want any old curve, it shouldn't be hard (i.e., given a set of points, you can draw a curve by hand pretty easily). The techniques normally consist of finding the appropriate superposition of a basis set of smooth functions (i.e., cubic spline is a technique using cubics).

Spline:
http://en.wikipedia.org/wiki/Spline_(mathematics)

Cubic Spline:
http://mathworld.wolfram.com/CubicSpline.html



If you don't require it to be smooth or continuous, then yes, you can manufacture tons of different discontinuous, weird functions that satisfy your constraints. Mine above works fine, and I don't know about yours but it seems like it should work too.

Thanks for the links :)
 

JTsyo

Lifer
Nov 18, 2007
12,068
1,159
126
Pi/3 is 1 and change. since both Pi/3 and 2 give the same Y value, the function probably turns between the two, unless of course the period is less than one.
 

swanysto

Golden Member
May 8, 2005
1,949
9
81
Looking at this, I can't believe I got through calc 3. It has been 10 years, so my brain was a lot sharper back then. Getting old sucks.
 

Paul98

Diamond Member
Jan 31, 2010
3,732
199
106
Find a function H such that H(H(x)) = H(x) for all numbers x, and such that H(1) = 36, H(2) = pi/3 and H(13) = 47.

It's an optional question in one of my textbook's chapters, but it is quite interesting!

What other sort of questions were there in that chapter in that textbook? What were you doing using in that chapter? There are ways to solve this, would be nice to know the way they are looking for.