home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 56,988 of 57,431   
   Stefan Ram to Richard Heathfield   
   Re: Paragraph Wrapping   
   02 Feb 23 22:03:06   
   
   From: ram@zedat.fu-berlin.de   
      
   Richard Heathfield  writes:   
   >Did you even notice my reply re the food dish question?   
      
     Yes. Sorry. I should have written a reply!   
      
     So, what that book by Eijkhout said is in my words:   
      
     The last dish could be anything, so that its expected value of   
     the rating function on the scale from 0 to 1 is equal to 0.5.   
      
     Therefore, one would choose the penultimate dish if its   
     rating is better than 0.5, because then it would be better   
     than the alternative.   
      
     If one assumes that the penultimate dish can be anything, it is   
     better than 0.5 in half of the cases, in such a case, one would   
     choose it, and since it then lies somewhere between 0.5 and 1, the   
     expected value is then 0.75. Otherwise, one takes the last dish with   
     an expected value of 0.5. Overall, with this strategy and two dishes,   
     the expected value is then the mean of 0.75 and 0.5, i.e., 0.625.   
      
     So, the second-to-last dish would have to be better than 0.625   
     in order to be chosen.   
      
     I wrote a small Python program to compare this with the strategy you   
     mentioned. The result is that the strategy given above fares better   
     by a factor of 1.2146 if every dish's quality is randomly between 0   
     and 1. But the traditional strategy you gave fares better by a factor   
     between 0.8 and 0.99 when the quality of all the dishes is a priori   
     restricted to some range [a,b], where a < b and 0 <= a <= 1, at least   
     for three such cases I looked at.   
      
     Which is "the best" solution, then, might depend on details of   
     the wording of the question, i.e., whether it states that every   
     dish can have an arbitrary quality between 0 and 1 or whether   
     a certain cook always produces dishes between a and b (but how   
     could he know or control the ratings the customer will give?).   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca