DSPRelated.com
Forums

today's puzzle

Started by PT October 23, 2012
g(n) is a function of any integer n, positive or negative, which
produces an integer value, with conditions:

a) g(g(n)) = n

b) g(g(n + 2) + 2) = n

c) g(0) = 1

1. Determine g(n)
2. Prove your solution is unique.

---
Paul T.
On Tuesday, October 23, 2012 5:02:48 PM UTC-4, PT wrote:
> g(n) is a function of any integer n, positive or negative, which > > produces an integer value, with conditions: > > > > a) g(g(n)) = n > > > > b) g(g(n + 2) + 2) = n > > > > c) g(0) = 1 > > > > 1. Determine g(n) > > 2. Prove your solution is unique. > > > > --- > > Paul T.
g(n)= 1-n
clay@claysturner.com wrote:
> On Tuesday, October 23, 2012 5:02:48 PM UTC-4, PT wrote: >> g(n) is a function of any integer n, positive or negative, which
>> produces an integer value, with conditions:
>> a) g(g(n)) = n
>> b) g(g(n + 2) + 2) = n
>> c) g(0) = 1
>> 1. Determine g(n)
>> 2. Prove your solution is unique.
> g(n)= 1-n
I agree, but you forgot step 2. -- glen
On Tue, 23 Oct 2012 23:38:16 +0000, glen herrmannsfeldt wrote:

> clay@claysturner.com wrote: >> On Tuesday, October 23, 2012 5:02:48 PM UTC-4, PT wrote: >>> g(n) is a function of any integer n, positive or negative, which > >>> produces an integer value, with conditions: > >>> a) g(g(n)) = n > >>> b) g(g(n + 2) + 2) = n > >>> c) g(0) = 1 > >>> 1. Determine g(n) > >>> 2. Prove your solution is unique. > >> g(n)= 1-n > > I agree, but you forgot step 2. > > -- glen
Proof of uniqueness: The OP would be terrifically embarrassed if there were more than one solution. Therefore, the solution is unique. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On Tue, 23 Oct 2012 23:38:16 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:

>clay@claysturner.com wrote: >> On Tuesday, October 23, 2012 5:02:48 PM UTC-4, PT wrote: >>> g(n) is a function of any integer n, positive or negative, which > >>> produces an integer value, with conditions: > >>> a) g(g(n)) = n > >>> b) g(g(n + 2) + 2) = n > >>> c) g(0) = 1 > >>> 1. Determine g(n) > >>> 2. Prove your solution is unique. > >> g(n)= 1-n > >I agree, but you forgot step 2. > >-- glen
But step 3 = Profit! Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
Le

On Tuesday, October 23, 2012 7:38:17 PM UTC-4, glen herrmannsfeldt wrote:
> clay wrote: > > > On Tuesday, October 23, 2012 5:02:48 PM UTC-4, PT wrote: > > >> g(n) is a function of any integer n, positive or negative, which > > > > >> produces an integer value, with conditions: > > > > >> a) g(g(n)) = n > > > > >> b) g(g(n + 2) + 2) = n > > > > >> c) g(0) = 1 > > > > >> 1. Determine g(n) > > > > >> 2. Prove your solution is unique. > > > > > g(n)= 1-n > > > > I agree, but you forgot step 2. > > > > -- glen
Glen, here's this cond a -> g(g(n) = n do g^-1() of both sides and find g(n) = g^-1(n) self inverting cond b -> g(g(n+2)+2)=n do g^-1() of both sides and find g(n+2) = g(n)-2 Now rewrite as ( g(n+2) - g(n) )/ ((n+2) - (n)) = -1 = slope for all n cond c -> g(0) = 1 defines the intercept Thus with a constant slope of -1 and an intercept of 1, we have a uniquely defined 1st order polynomial. All higher order derivatives are equal to 0. Clay
On Tue, 23 Oct 2012, PT wrote:

> g(n) is a function of any integer n, positive or negative, which > produces an integer value, with conditions: > > a) g(g(n)) = n > > b) g(g(n + 2) + 2) = n > > c) g(0) = 1
Let f(n) = 1 - n. ff(n) = f(1 - n) = 1 - (1 - n) = n f(f(n + 2) + 2) = f(1 - (n + 2) + 2) = f(1 - n) = n f(0) = 1
> 1. Determine g(n)
g = f.
> 2. Prove your solution is unique.
On Tue, 23 Oct 2012, William Elliot wrote:
> On Tue, 23 Oct 2012, PT wrote: > > > g(n) is a function of any integer n, positive or negative, which > > produces an integer value, with conditions: > > > > a) g(g(n)) = n > > > > b) g(g(n + 2) + 2) = n > > > > c) g(0) = 1
> Let f(n) = 1 - n. > > ff(n) = f(1 - n) = 1 - (1 - n) = n > f(f(n + 2) + 2) = f(1 - (n + 2) + 2) = f(1 - n) = n > f(0) = 1 > > > 1. Determine g(n) > > g = f. > > > 2. Prove your solution is unique. >
f(0) = 1 = g(0) f(1) = 0 = gg(0) = g(1) If f(n) = g(n), then n = g(g(n + 2) + 2) 1 - n = f(n) = g(n) = g(n + 2) + 2 g(n + 2) = 1 - n - 2 = 1 - (n + 2) = f(n + 2) By induction, for all n >= 0, f(n) = g(n). g(-0) = 1 = f(-0) g(g(-1 + 2) + 2) = -1 g(-1) = g(-1 + 2) + 2 = g(1) + 2 = 2 = f(-1) If n >= 0 and f(-n) = g(-n), then g(g(-(n+2) + 2) + 2) = -(n + 2) g(-(n + 2)) = g(-n) + 2 = 1 + n + 2 = 1 - (-(n + 2)) = f(-(n + 2)) Again by induction, for all n >= 0, g(-n) = g(-n). Done.
clay@claysturner.com writes:

> Glen, here's this > > > cond a -> g(g(n) = n > > do g^-1() of both sides and find > > g(n) = g^-1(n) self inverting > > cond b -> g(g(n+2)+2)=n > > do g^-1() of both sides and find > > g(n+2) = g(n)-2 > > Now rewrite as ( g(n+2) - g(n) )/ ((n+2) - (n)) = -1 = slope for all n
Slope? If you're thinking of the slope of a line (or curve) there isn't one. The function is only defined on the integers.
> cond c -> g(0) = 1 defines the intercept > > Thus with a constant slope of -1 and an intercept of 1, we have a uniquely defined 1st order polynomial. All higher order derivatives are equal to 0.
We don't necessarily have a polynomial, or derivatives. Let me illustrate by changing the problem slightly. g(g(n)) = n, and g(n+2) = g(n)-2, as before. But: g(0) = 2 It turns out that this is sufficient only to define the values of g at the even integers. So we are also free to define: g(1) = 11 And this defines g for the odd integers. Now you have points on two different lines. Scott -- Scott Hemphill hemphill@alumni.caltech.edu "This isn't flying. This is falling, with style." -- Buzz Lightyear
On Tuesday, October 23, 2012 5:02:48 PM UTC-4, PT wrote:
> g(n) is a function of any integer n, positive or negative, which > > produces an integer value, with conditions: > > > > a) g(g(n)) = n > > > > b) g(g(n + 2) + 2) = n > > > > c) g(0) = 1 > > > > 1. Determine g(n) > > 2. Prove your solution is unique. > > > > --- > > Paul T.
If you change the problem then you change the answer. I just extented the problem to the reals and found a solution consistant with the given constraints. Clay