wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> hard >> find the function
(Message started by: inexorable on Jan 4th, 2006, 12:17pm)

Title: find the function
Post by inexorable on Jan 4th, 2006, 12:17pm
Construct a function F from integers to integers such that f(f(n))=-n for any integer n.
Also find a function g from positive rational numbers to positive rational numbers such that g(g(q))=1/q for any positive rational q?

Title: Re: find the function
Post by JocK on Jan 4th, 2006, 12:40pm

on 01/04/06 at 12:17:39, inexorable wrote:
Construct a function F from integers to integers such that f(f(n))=-n for any integer n.


Any function f obtained from [hide]pairing distinct positive integers k and n such that

f(-k) = -n
f(-n) = +k
f(+n) = -k
f(+k) = +n

[/hide]suffices (if complemented with f(0) = 0).




Title: Re: find the function
Post by SMQ on Jan 4th, 2006, 12:41pm
Didn't we just see g somewhere (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_putnam;action=display;num=1135714645) recently? ;)

f looks a bit more interesting, though...

--SMQ

Title: Re: find the function
Post by inexorable on Jan 4th, 2006, 8:17pm

on 01/04/06 at 12:41:43, SMQ wrote:
Didn't we just see g somewhere (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_putnam;action=display;num=1135714645) recently? ;)

but g here is a function from positive rational numbers to positive rational numbers so it can't be g(q)=q^i

Title: Re: find the function
Post by SMQ on Jan 5th, 2006, 6:10am
You mean to tell me not all complex numbers are rational? ;D :-[

Ah well, so not every f() over there is a g() over here; the questions are still related, as any g() here is also an f() there. :)

--SMQ

Title: Re: find the function
Post by Eigenray on Jan 5th, 2006, 10:49am
Jock's trick for f will also work for g.  [hide]Partition the rationals greater than 1 into ordered pairs (r,s), and let f act as the cycle r -> s -> 1/r -> 1/s -> r[/hide].

Title: Re: find the function
Post by Barukh on Jan 7th, 2006, 1:45am
Ilike your argument, Eigenray! But it seems a bit existential, don't you think? Iwas trying to come with some specific pairing but didn't suceed so far. [hide]One way of partitioning that I tried was the parity of p+q for some rational r = p/q[/hide].

Title: Re: find the function
Post by Eigenray on Jan 7th, 2006, 11:23pm
You're right, there's a constructive way [hide]using f[/hide]:
[hide]g([prod] pia_i) = [prod] pif(a_i)[/hide]

Title: Re: find the function
Post by srn347 on Sep 2nd, 2007, 11:26am
F(n)=n(i)
g(q)=q^i

Title: Re: find the function
Post by towr on Sep 2nd, 2007, 12:20pm

on 09/02/07 at 11:26:36, srn347 wrote:
F(n)=n(i)
g(q)=q^i



on 01/04/06 at 20:17:49, inexorable wrote:
but g here is a function from positive rational numbers to positive rational numbers so it can't be g(q)=q^i

Title: Re: find the function
Post by srn347 on Sep 17th, 2007, 6:34am
It still works for f. It is for integers and i is a guasion integer. It could be division by i also.

Title: Re: find the function
Post by towr on Sep 17th, 2007, 7:58am

on 09/17/07 at 06:34:02, srn347 wrote:
It still works for f. It is for integers and i is a guasion integer. It could be division by i also.
A gaussian integer isn't an integer in the normal sense, and so unfortunately doesn't qualify as a solution.
You can compare it to how an imaginary friend, despite having the noun friend in it, isn't really a friend, because it doesn't exist (courtesy of the adjective imaginary). A gaussian integer, despite containing the noun integer, isn't an integer (because the adjective gaussian modifies it to something else).

Title: Re: find the function
Post by srn347 on Sep 18th, 2007, 7:19am
Though the definition of integer is having a representation that is neither fraction nor decimal. It is a subset of reals though.

Title: Re: find the function
Post by rmsgrey on Sep 18th, 2007, 8:01am

on 09/18/07 at 07:19:43, srn347 wrote:
Though the definition of integer is having a representation that is neither fraction nor decimal. It is a subset of reals though.

The definition of the integers I usually use is "the closure of the natural numbers under subtraction"

Title: Re: find the function
Post by towr on Sep 18th, 2007, 9:03am

on 09/18/07 at 07:19:43, srn347 wrote:
Though the definition of integer is having a representation that is neither fraction nor decimal. It is a subset of reals though.
http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/pi.gif is neither a rational (http://en.wikipedia.org/wiki/Rational_number), nor a decimal (http://en.wikipedia.org/wiki/Decimal) (which btw isn't a type of number, but a number representation. You can't write http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/pi.gif as decimal, as it would have infinite length. But please do try; but mind you, not here.)

Title: Re: find the function
Post by Grimbal on Sep 18th, 2007, 9:46am
And in fact, integers do have a representation as a fraction and as a decimal.

Title: Re: find the function
Post by Hippo on Sep 18th, 2007, 1:12pm
just some comments:
Eigenray: ... the construction of q using f and factorisation should be applied on both parts of fraction.... oops you are right ... you use negative ai's.

The cycles for f can be defined for example in the following way:
Write nonzero integer n as +/- 2ko where o is odd. If k is odd f(n)=n/2 otherwise f(n)=-2n.
f(0)=0.

Title: Re: find the function
Post by srn347 on Sep 18th, 2007, 7:13pm
Pi is a decimal, though infinite. It also has some fraction representations. Check it on wikipedia.

Title: Re: find the function
Post by JP05 on Sep 18th, 2007, 7:18pm

on 09/18/07 at 19:13:43, srn347 wrote:
It also has some fraction representations. Check it on wikipedia.


You are incorrect. pi does not have any fractional (rational) representations.  It has as many rational "approximations" as you wish to exploit via truncation.

Title: Re: find the function
Post by srn347 on Sep 18th, 2007, 8:38pm
No offence, but saying pi has no fraction representation is not even wrong(finally I get to use that phrase). Regardless, let's get back on topic before the spammers come.

Title: Re: find the function
Post by JP05 on Sep 18th, 2007, 9:09pm
Of course, no offense. I think you need to discern the difference between an approximation and a representation in this case.  I believe mathematicians regard a representation as being precise.

Again, there are no rational representations of pi. There are as many rational approximations of pi as you wish to make from truncation.

And last, I have reviewed the forums tonight and so have noticed I should not even be responding here with this. After all, there are plenty of cartoons that I would otherwise be missing myself.

Title: Re: find the function
Post by srn347 on Sep 18th, 2007, 9:14pm
Try multitasking. Anyway, f2(f2-f0)=2n. Hopefully this helps. Try graphing it with x, y, and z(x, f(x), and f(f(x))).

Title: Re: find the function
Post by ima1trkpny on Sep 18th, 2007, 9:22pm

on 09/18/07 at 21:14:15, srn347 wrote:
... I know...


Ok, I have yet to see you prove you know anything! Mostly it is a bunch of bogus, irrelevant claims from you that you never actually prove! You just go "Oh I think it must involve this and that and that..." (and whatever other theorems name you think throwing around will draw respect) and I must say it truly is pathetic.

Title: Re: find the function
Post by JP05 on Sep 18th, 2007, 9:25pm
That's nonsense. Don't you realize that this is a good place to learn mathematics and computer algos? Why are you against the grain here?  Don't you see how generous people are here with explanations and knowledge?

You are using all these benefits to your disadvantage. We don't care if you are a dummy. Well, at least no one had to test you to see if you were a dummy, because, well, you showed it on your own.

Bye.

Title: Re: find the function
Post by ima1trkpny on Sep 18th, 2007, 9:49pm

on 09/18/07 at 21:43:57, srn347 wrote:
if you don't believe those functions being used, wait until I find the answer.

It doesn't matter what I believe or not! My point is that you just spew whatever comes to the top of your head as an answer without actually doing any work! Guessing at an answer means NOTHING if you have no idea how you got there and how to produce the same results! As it is you just spew a bunch of bogus and then provide absolutely NO PROOF or SUPPORT for your arguments! You lack sound logic and the humility to realize there is a possibility you are wrong.

Let's pretend for a moment you are an engineer or someone with some responsibility. Let's say you are in charge of a the design of a building and you pull this same guessing game. Maybe once you will get lucky and come out with the right measurements, etc. for the building to stand. But what the hell happens when you aren't? The building is completely faulty and potentially could kill people and you would have no blueprints or anything for someone else to either notice your mistake or be able to correct the failures to make it work. The difference here is that most of these people have been doing this for years and years (some long before you were even conceived) and can recognise by instinct poor foundations. They are trying to save you from big mistakes and bad habits that will be a road block for you later in life.(And they are completely right) And you have the guts to call them audacious? Your sillyness is beyond words!

Title: Re: find the function
Post by srn347 on Sep 18th, 2007, 11:32pm
You focus so much on stuff being wrong that you don't focus on what is right(not that I'm saying that what I say is wrong).

Title: Re: find the function
Post by mikedagr8 on Sep 19th, 2007, 12:44am

Quote:
And you have the guts to call them audacious

HE DID NOT! He called everyone odacious. :P


Quote:
You focus so much on stuff being wrong that you don't focus on what is right(not that I'm saying that what I say is wrong).

If you plan to admit that you are incorrect, leave it that way until someone says that you are correct.

P.S. Please excuse my troll baiting.

Title: Re: find the function
Post by SMQ on Sep 19th, 2007, 6:08am

on 09/18/07 at 23:32:26, srn347 wrote:
(not that I'm saying that what I say is wrong).

And that, in a nutshell, is the problem: in 338 posts you have never once admitted you were wrong, even when it was blindingly obvious.  [AnneRobinson]You are the weakest link; goodbye (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_suggestions;action=display;num=1189630753#12).[/AnneRobinson]

-SMQ

Title: Re: find the function
Post by srn347 on Sep 19th, 2007, 6:29am
You see what I mean?! I'm the only one trying to solve this riddle, and you're trying to stop me.

Title: Re: find the function
Post by towr on Sep 19th, 2007, 7:19am

on 09/19/07 at 06:29:10, srn347 wrote:
You see what I mean?! I'm the only one trying to solve this riddle, and you're trying to stop me.
What I see is that you ignore all well-meant attempts of correcting your misconceptions of mathematics. And consequently people get fed up with you and your posts.
If you really want to solve this puzzle, you should first understand the concepts it relies on; you clearly don't, and you won't listen to anyone trying to explain it to you.

Title: Re: find the function
Post by ThudanBlunder on Sep 19th, 2007, 8:36am

on 09/18/07 at 23:32:26, srn347 wrote:
( [AnneRobinson]You are the weakest link; goodbye (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_suggestions;action=display;num=1189630753#12).[/AnneRobinson]

I am surprised they show Brit quiz shows in Michigan.

(Sorry SMQ, I have edited your post by mistake. :-[  I clicked Modify instead of Quote. I hope you can rectify it.)

Title: Re: find the function
Post by towr on Sep 19th, 2007, 8:43am

on 09/19/07 at 08:36:47, ThudanBlunder wrote:
(Sorry SMQ, I have edited your post by mistake.   :-[  Will try to rectify.)
One of the pitfalls of moderatorship, editing when you think you're quoting.  ;D

Title: Re: find the function
Post by SMQ on Sep 19th, 2007, 8:51am

on 09/19/07 at 08:36:47, ThudanBlunder wrote:
I am surprised they show Brit quiz shows in Michigan.

Not generally -- although BBC America does show a few -- but the networks over here are notorious for taking show ideas from you Brits, and Anne Robinson also hosted the US version of Weakest Link for a while.


Quote:
(Sorry SMQ, I have edited your post by mistake. :-[  I clicked Modify instead of Quote. I hope you can rectify it.)

No problem; I think it's fixed now.

--SMQ

Title: Re: find the function
Post by srn347 on Sep 19th, 2007, 4:19pm
Since f(0)=0, the function involves no addition or subtraction(except in terms of n).

Title: Re: find the function
Post by Grimbal on Sep 20th, 2007, 7:30am

on 01/04/06 at 12:40:48, JocK wrote:
Any function f obtained from [hide]pairing distinct positive integers k and n such that

f(-k) = -n
f(-n) = +k
f(+n) = -k
f(+k) = +n

[/hide]suffices (if complemented with f(0) = 0).

And this form is necessary.

Title: Re: find the function
Post by Eigenray on Sep 20th, 2007, 6:30pm

on 09/19/07 at 08:36:47, ThudanBlunder wrote:
(Sorry SMQ, I have edited your post by mistake. :-[  I clicked Modify instead of Quote. I hope you can rectify it.)

SMQ, could you add a function to your Greasemonkey script?  There doesn't seem to be an easy way to check whether an action=modify page is using moderator powers though.  One way to do it would be on an action=display page, for each "Modify" link whose author is distinct from the $USER in "Hey, $USER" at the top of the page, append "#foo=bar" to the link.  Then on an action=modify page, you could check for this and invert the colors on the textarea, or put a frame around it, or something like that.

Or maybe, when you click on a modify link other than your own, it pops up an alert for confirmation.

Title: Re: find the function
Post by srn347 on Sep 20th, 2007, 8:21pm
If you people would cooperate, we would already have solved it. I've already done most of the work(not to brag). Let's see somebody else do something.

Title: Re: find the function
Post by towr on Sep 21st, 2007, 12:54am

on 09/20/07 at 20:21:11, srn347 wrote:
If you people would cooperate, we would already have solved it. I've already done most of the work(not to brag). Let's see somebody else do something.
Not to rain on your parade, but it was already solved in the first 7 posts.

Title: Re: find the function
Post by srn347 on Sep 21st, 2007, 6:14pm
You mean the link? What does x' mean though?

Title: Re: find the function
Post by towr on Sep 22nd, 2007, 3:06am

on 09/21/07 at 18:14:49, srn347 wrote:
You mean the link? What does x' mean though?
I meant specifically the 2nd and 7th post of this thread.
In that other thread, x' is just another real number distinct from the x that was chosen. It might have been called y instead of x'.

Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 10:45am
It still hasn't been solved. The k thing is just a hint, not the answer. Also, g(1)=1, g(q)=l, g(l)=1/q, g(1/q)=1/l, g(1/l)=q.

Title: Re: find the function
Post by towr on Sep 23rd, 2007, 10:56am

on 09/23/07 at 10:45:54, srn347 wrote:
It still hasn't been solved. The k thing is just a hint, not the answer.
It isn't just a hint, it precisely defines a whole class of solutions.

Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 11:17am
But it still doesn't answer it.

Title: Re: find the function
Post by towr on Sep 23rd, 2007, 12:15pm

on 09/23/07 at 11:17:45, srn347 wrote:
But it still doesn't answer it.
Yes it does.
Look, if you can't grasp the solution, that's fine. But that's no reason to dismiss it.

Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 2:49pm
What is k? It has to be an integer, but if I ask for the f of a specific n(like 10), the k thing wouldn't help.

Title: Re: find the function
Post by towr on Sep 23rd, 2007, 3:08pm

on 09/23/07 at 14:49:59, srn347 wrote:
What is k? It has to be an integer, but if I ask for the f of a specific n(like 10), the k thing wouldn't help.
Sure it does. It tells me I can pick any (unpaired) positive integer and pair it with n=10, and f behaves precisely as desired for n and k.

You could pair each odd positive integer with the following even positive integer. But there are many other ways that work just as well.

Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 3:27pm
If only that actually meant something. There is no solution.

Title: Re: find the function
Post by Whiskey Tango Foxtrot on Sep 23rd, 2007, 8:13pm
I no longer feel bad about considering a ban of srn.  After this display, I'm all for immediate action.

Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 8:33pm
Do you believe that the same God who gave us reason, purpose, and sense wants us to forgo their use? if you ban me, that's what you'll be doing.

Title: Re: find the function
Post by ThudanBlunder on Sep 23rd, 2007, 9:03pm

on 09/23/07 at 20:33:03, srn347 wrote:
Do you believe that the same God who gave us reason, purpose, and sense wants us to forgo their use?

Do you believe that the same God who gave us sense, reason, and intellect intended us to forgo their use? - Galileo

Do you not believe that the same God who gave us Google, Copy, and Paste, wants you to forgo their use?


Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 9:13pm
copy actually, since cut won't work here. He also gave us an infinite amount of web sites, and out of an infinite amount of web sites, the probability of going to a specific one is zero(positive zero).

Title: Re: find the function
Post by JiNbOtAk on Sep 23rd, 2007, 10:09pm

on 09/23/07 at 21:13:06, srn347 wrote:
copy actually, since cut won't work here. He also gave us an infinite amount of web sites, and out of an infinite amount of web sites, the probability of going to a specific one is zero(positive zero).


Wow, an infinite amount of websites, really ?  ::)

Title: Re: find the function
Post by srn347 on Sep 23rd, 2007, 10:27pm
well, not all at the same time, but more web sites are created each day with no exponential decay, so after an eternity there will be. It is already seemingly infinite and going to be infinite. If you count search result pages, there are infinite since you can search for anything with infinite possibilities.

Title: Re: find the function
Post by towr on Sep 23rd, 2007, 11:10pm

on 09/23/07 at 20:33:03, srn347 wrote:
Do you believe that the same God who gave us reason, purpose, and sense wants us to forgo their use?
Then why do you never display any sense or reason and does your only purpose seem to be holding on to your obstinate ignorance?

Title: Re: find the function
Post by amstrad on Sep 24th, 2007, 10:02am
How about this for f(n):

[hide]
f(n) = (  (n%2)==0 ? -n/2 : 2*n )

if n is even f(n) is -n/2 else f(n) is 2n
[/hide]

Still working on g(q)...

Title: Re: find the function
Post by pex on Sep 24th, 2007, 10:11am

on 09/24/07 at 10:02:12, amstrad wrote:
How about this for f(n):

[hide]
f(n) = (  (n%2)==0 ? -n/2 : 2*n )

if n is even f(n) is -n/2 else f(n) is 2n
[/hide]

Then f(f(4)) = 1, not -4...

Title: Re: find the function
Post by amstrad on Sep 24th, 2007, 12:53pm

on 09/24/07 at 10:11:42, pex wrote:
Then f(f(4)) = 1, not -4...


Yep doesn't work.

How about this (my coworker's solution, which I think really is correct):

[hideb]

You need 4 states and a circle process to traverse them:  positive even, positive odd, negative even and negative odd.  The state transition goes like this:

po -> pe -> no -> ne -> po.......

f(n) =
po: n+1
pe: -n+1
no: n-1
ne: -n-1

[/hideb]

Title: Re: find the function
Post by srn347 on Sep 24th, 2007, 7:13pm
Assuming zero stays zero since it is neither positive or negative(yet). Anyway, inspired by that answer, here is g. g(q)=
integer-           q-1+(1/q)
not integer-              write it in the representation q-1+1/q where q is an integer and get rid of the q-1.

Title: Re: find the function
Post by Whiskey Tango Foxtrot on Sep 24th, 2007, 8:20pm

on 09/23/07 at 20:33:03, srn347 wrote:
Do you believe that the same God who gave us reason, purpose, and sense wants us to forgo their use? if you ban me, that's what you'll be doing.


Another religious concept (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_general;action=display;num=1186592555): I'm done with this sh*t.

Title: Re: find the function
Post by mikedagr8 on Sep 24th, 2007, 8:27pm
Good call. ;)

Title: Re: find the function
Post by amstrad on Sep 25th, 2007, 6:46am
Here is my solution for g(q):

[hide]

For q to be rational it is n/m for some integers n and m.

To mirror my solution for f(n), I make 4 states:

1) n is greater than m and n+m is even  (ge)
2) n is greater than m and n+m is odd   (go)
3) n is less than m and n+m is even     (le)
4) n is less than m and n+m is odd      (lo)

again the cycle is ge->go->le->lo->ge.......

so g(n/m) =
if(ge) (n+1)/m
if(go) m/(n-1)
if(le) n/(m+1)
if(lo) (m-1)/n

it is important not to reduce your intermediate results

starting with 8 (or 8/1) you get 8->1/7->1/8->7->8....
starting with 21/5 you get 21/5->5/20->5/21->20/5->21/5...


[/hide]

Title: Re: find the function
Post by Grimbal on Sep 25th, 2007, 7:22am
Hm... if you don't simplify your fractions, you are not working with rationals, but with pairs of integers.
You can not define a rational function that does
3/6 -> 5/3
2/4 -> 2/5
   and
1/2 -> 1/1

Title: Re: find the function
Post by towr on Sep 25th, 2007, 7:22am

on 09/25/07 at 06:46:29, amstrad wrote:
it is important not to reduce your intermediate results
That's a bit of a flaw then, because fractions keep the same value if you reduce them; they're the same number.
There are alternatives that don't have that problem.

Title: Re: find the function
Post by srn347 on Sep 25th, 2007, 5:00pm
A fraction can also have both sides be negative, thus reversing the inequality.

Title: Re: find the function
Post by Grimbal on Sep 26th, 2007, 12:40am
sure.

Title: Re: find the function
Post by srn347 on Sep 30th, 2007, 9:43pm
At least g was solved for.

Title: Re: find the function
Post by RandomSam on Oct 4th, 2007, 5:05pm
Based entirely on amstrad's post, how's this for rationals:[hideb]For integers a and b

x>1, floor(x)    odd  : g(x) = x + 1
x>1, floor(x)    even: g(x) = (x - 1)-1
x<1, floor(x-1) odd  : g(x) = (x-1 + 1)-1
x<1, floor(x-1) even: g(x) = x-1 - 1[/hideb]

Title: Re: find the function
Post by towr on Oct 5th, 2007, 1:33am

on 10/04/07 at 17:05:36, RandomSam wrote:
Based entirely on amstrad's post, how's this for rationals:[hideb]For integers a and b

x>1, floor(x)    odd  : g(x) = x + 1
x>1, floor(x)    even: g(x) = (x - 1)-1
x<1, floor(x-1) odd  : g(x) = (x-1 + 1)-1
x<1, floor(x-1) even: g(x) = x-1 - 1[/hideb]
Seems fairly good, although you probably want to check for the absolute value of x, and define what to do with 1.

Title: Re: find the function
Post by RandomSam on Oct 5th, 2007, 8:22am

on 10/05/07 at 01:33:03, towr wrote:
Seems fairly good, although you probably want to check for the absolute value of x, and define what to do with 1.

oops...  :-[ I meant to say "x is a positive rational" instead of defining a and b as integers, which aren't used in the rest of the solution!



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board