10727 - Practice

All about problems in Volume 107. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
backslash null
New poster
Posts: 8
Joined: Tue Nov 11, 2003 11:02 pm

10727 - Practice

Post by backslash null »

Hi every body any idea about problem 10727,
I don't understand the problem :( ....

thank you.
Last edited by backslash null on Mon Oct 04, 2004 2:15 pm, edited 2 times in total.
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post by gvcormac »

Which problem? Your title says 10727 while your message says 10728.

I'll use your problem to entreat everybody to PUT THE PROBLEM NAME IN THE TITLE of your message. Perhaps everybody but me has 1GHz ethernet, a 100GHz processor, and access to a mirror of this site that is 100 times faster than the one I have.

It takes me a good fraction of a minute to look up the problem corresponding to a particular problem number. So if all you post is the problem number, I'm not likely to take the effort to figure out what you're talking about.
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post by gvcormac »

The problem is asking you to do Logistic Regression. You can search the web or consult a statistics textbook to find more explanation.
Quantris
Learning poster
Posts: 80
Joined: Sat Dec 27, 2003 4:49 am
Location: Edmonton AB Canada

Post by Quantris »

What's the output for the case:
2
1 0
2 1

..my program runs off to -infinity for a, and i'm not sure where to stop it.
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post by gvcormac »

Quantris wrote:What's the output for the case:
2
1 0
2 1

..my program runs off to -infinity for a, and i'm not sure where to stop it.
The result is undefined for the example you give. You need to have at least one inversion in the input for the result to be well-defined. The judge data has this property, but it was a little awkward to state the conditions in the problem statement. By an inversion, I mean that
if you sort by one value (n) the other value (w) must not be totally in order.
Quantris
Learning poster
Posts: 80
Joined: Sat Dec 27, 2003 4:49 am
Location: Edmonton AB Canada

Post by Quantris »

ok, thanks. I think I figured out what else was wrong with my program, so hopefully I can fix it.
backslash null
New poster
Posts: 8
Joined: Tue Nov 11, 2003 11:02 pm

is sample output correct

Post by backslash null »

isn't it more accurate if u select a=0 and b=0.25 ?
:-?
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Re: is sample output correct

Post by gvcormac »

backslash null wrote:isn't it more accurate if u select a=0 and b=0.25 ?
:-?
I assume you are referring to the previous example [(1,0), (2,1)]. When you apply the logistic transformation you're trying to fit [(1,log(0/1-0)), (2,log(1/(1-1))] = [(1,-inf),(2,+inf)]. The "solution" to this is a=-inf, b=+inf.
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

Just a short note after I get this AC. Hope this can help any people to solve this problem in future.

It was a really really painful journey to find the right reference to help me kill this problem. At first I use Logistic Regression to google, but most of the web pages I get are telling people to use SAS or S PLUS to do the estimation(instead of talking about the algorithm).....

After a few days of research, I finally know that, what you need to know, is Newton Raphson's method only. Just do a small transformation, you can get this problem AC by Newton Raphson's method without knowing any thing in Logistic Regression.......

I write this because I feel little bit disappointed that my few-days-long research makes no contribution to solving this problem..... But I still need to say thanks to Prof. Gordon V. Cormack, through the research on this problem I have learnt knowledge on regression(not only logistic, also linear and non-linear). :D
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

In fact, no fancy algorithms are necessary. Simple nested binary search was enough to give me AC.
Destination Goa
Experienced poster
Posts: 123
Joined: Thu Feb 10, 2005 4:46 am

Post by Destination Goa »

I used 2D ternary search (nestes 1D's).
To be the best you must become the best!
Post Reply

Return to “Volume 107 (10700-10799)”