Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ToohrVyk

A weird function.

This topic is 5419 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to define a function f : [0,1] -> [0,1] so that, for any 0 <= a < b <= 1 and 0 <= y <= 1, there is c in ]a, b[ for which f(c) == y. How would you go about doing this? I''ve heard there are quite a few solutions. Below is my solution. ---------------------------- ***Definition Firstly, f(1) = 1; Let x be a number in [0,1[. I will write x = 0,x1x2x3x4x5... in base 11. If there is an infinity of A digits, then f(x) = 1. If there is a finite number of A digits, I define recursively two series: u(0) = 0, u(n+1) = if (xn == A) then 0 else u(n)+1; v(0) = 0, v(n+1) = if (xn == A) then 0 else v(n) + xn/10^(u(n)) Since there is a finite number of A digits, there is a biggest N for which xN == A, and if N'' > N, xN'' != A. This means that starting with N, u(n) is growing at a rate of 1. Also, v(n) is a growing series that is always below 1, which means it has a limit. We define f(x) = lim v ***Now it''s defined, let''s check it has the right properties. Take a, b, y. Let a = 0,a1a2a3a4... in base 11. Let L = log(11)(b-a). Let N > L so that aN != A. let x = 0,a1a2....a(N-1)Ax1x2x3x4... if y == 1 then x1=x2=x3=...=A so f(X) = 1 = y if y == 0,y1y2y3y4y5y6... in base 10, then for each n, xn = yn, so f(X) = 0,y1y2y3.... = y

Share this post


Link to post
Share on other sites
Advertisement
Even if this was homework, I for one think that the OP has put an honorable amount of work and time into solving this themselves, and I can only feel compelled to help out

However I''ve never seen the notation x = 0,x1x2x3x4x5... before, and the part about it being in base 11 doesn''t really give me much clue Are you referring to the actual digits of the number? Lastly, it''s been a while since I''ve seen something like ]a, b[ used. Is this another way of saying [0,a] U [b,1]? Sorry for confusion over notation, I''ve just never seen it before!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Zipster
Lastly, it''s been a while since I''ve seen something like ]a, b[ used. Is this another way of saying [0,a] U [b,1]? Sorry for confusion over notation, I''ve just never seen it before!

I guess in the US you usually write (a,b). It denotes an open interval.

Share this post


Link to post
Share on other sites
quote:
Original post by ToohrVyk
A question from a test last year. Here, in France, July-August is holidays, so no homework.


You don't get bugger loads of homework to do over the holidays?!? Blimey, what do you do with yourself without any maths to do for two months?

edit: Anyway, i rekon your solution looks good, i havn't scrutinised the proof too much mind you. I can;t help thinking that this question is beggin for a reference to some of the standard analysis theorems that you were no doubt taugght in your course. I never did much real analysis at uni ( i stuck to the complex kind, much neater and easier ) so I could tell you any more.

[edited by - Keem on August 15, 2003 5:57:45 AM]

Share this post


Link to post
Share on other sites
Ah, I see. Yes, we do use the parenthesis in the US more often to denote open intervals, although now that I think about it I do vaguely remember one of my books using the "backwards bracket" notation once, maybe twice... at any rate, I hope you are correct because I'll be assuming that for the rest of this post!

As far as I can tell, you're looking for a continuous function that maps an open-interval domain to a closed-interval range. The function can't be f : [0,1] -> [0,1], at least by the criteria you have provided. The only functions I can think of off the top of my head that have this property are sine and cosine, but even then the domain is (-inf, +inf), which I feel might be "cheating" a bit because they're periodic, but oh well You might be able to map 'c' in the range (a, b) to a 'd' in the range (0, PI/4), then plug that into sin. However it's still going to be tough to get the closed domain, because only at 0 and PI/4 does sin output 0 and 1 respectively.

I might be really far off though, so excuse any ignorance on my part

[edited by - Zipster on August 15, 2003 6:20:06 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
As far as I can tell, he''s looking for a function that maps ANY open interval in the domain to the whole range [0,1]. I don''t know how to contruct such a function, but it can''t be continuous, as far as I understand.

Share this post


Link to post
Share on other sites
AP: Yes, it can't be continuous. Proof:

let a in [0,1], e > 0. There is an x in (a-e,a+e) so f(x) = 1, an y in (a-e,e=a+e) so f(y) = 0. So when e tends towards 0, we have a series x(n)->a so that f(x(n)) = 1, and a series y(n)->a so that f(y(n)) = 0. This means lim(a) f is undefined, so f isn't continuous in a.

Keem: actually I don't get any real homework at all for two years. I'm preparing a "competition" to enter one of the greater schools in my country, so I'm meant to work all by myself: get my own books, choose my "homework" and do it. Sure, teachers teach us, and guide us into what we might want working more. Besides, we have a thing called "kholle", where three students and a teacher reunite for an hour in a classroom. Each student is given as many exercises as he can take during that hour, and he must solve each before going on to the next one.

EDIT to Keem: also, I've been give the teacher's solution to this problem. It's almost like the one above (it defines f(x) as the limit of A(n)/n, where A(n) is the number of "1" in the n first digits after the point ). It's just that I feel there might be some other, algebra-based, solution.

Zipster: yes, ]a,b[ = { x in IR | a < x < b }, and if I write x = 0,x1x2... I mean xn is the nth digit of x. Also, like I said this question was one of 32 questions in a 4-hour test, so I actually HAD to solve it... well, I almost did at the time

Also, for mapping (0,1) onto [0,1] with a continuous function:

0.5 * ( 1 + sin( x / ( 2*pi ) ) )

Back to my problem...

Anyone has any ideas? Maybe this could be done using the fact that IR is a Q-vectorial space of non-finite dimension?

[edited by - ToohrVyk on August 15, 2003 8:32:18 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
tu vas en prépa?
tu verras, c''est fun

No continuous function will satisfy your condition. Easy to prove.

if you want an easy function that will satisfy your condition, try this one :
f(x) = 1 if x is rational, 0 otherwise.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!