January 6, 2009

Pages


Search Site


Topics



Archives

Tweets

CFMenuCal: "True" Random vs. Evenly Distributed

July 20 2007 by Adam
Today I read Ben Nadel's post about the difference between random numbers and even distribution; which wasn't something I was unaware of, but was something that I hadn't given much consideration. Being the total geek that I am, I have a bias to support "random" numbers rather than even distribution – even though (as Ben points out) "if we were randomly selecting values between 1 and 10, it is possible (but unlikely) to randomly select 5 ten thousand times in a row;" – because I enjoy telling people they are wrong. (Sad but true. There's just something satisfying about telling people that the string 5555555 can be considered random.) A while ago my wife asked me why it worked this way (because some meals would show up 3 times in a month, while others not at all), and that's when I explained that random numbers are not necessarily evenly distributed. She understood and then asked, in that innocent way that makes me wonder why I didn't think of it, why I used random numbers instead of even distribution. So I have decided to put the feelers out and see what the opinions of my potential users are. There have been a handful of people who have expressed interest in the project, and if you wouldn't mind leaving a comment or sending me an email with your preference (random or evenly distributed?), it would be greatly appreciated.

Posted in CFMenuCal | ColdFusion | My projects |

4 comments:

  1. Alex Gorelik Says:

    Adam,

    Thought I'd pass this on since I have it. This is a randomizer I wrote that checks the random number once so it helps distribute to avoid get duplicates in your output. It loops a query into an array then loops through that array again.
  2. Alex Gorelik Says:

    In this case, even distribution does in fact seem the way to go. Good call!

    This isn't just a technical exercise, after all, but a project attempting to improve the quality of life and diet at home. Thus, eating Chicken Kiev three times in a row is not only boring, it might turn people off from using the applicaiton. If you find yourself moving dishes around manually, it kind of messes up the entire flow of the recommendations.
  3. Lola LB Says:

    I think I'd probably want to set some level of randomness. Say, between 1 to 5, with 5 being more random of course, so as to avoid having something appear three times in a row. I think the more meal choices you enter, the more chances there will be for randomness.
  4. Adam Says:

    - I agree. Until recently, I was operating under the idea that if you were displeased with the suggested menu due to its randomness (or lack thereof), you could simply hit the refresh button to get a new one (though you still can).

    Don't forget that you can enter a minimum "proximity" based on meal "type", which I am using as chicken, pork, beef, etc. for my own purposes - but it is a free text field, and you are free to enter any classification that you want; for example: Ethiopian, Polynesian, Mexican, etc - if you are into eating different cultural cuisine. This proximity will keep - to the best of its ability - meals of the same "type" X days apart, where X is the number you enter.

    - That's a very interesting suggestion. I guess essentially a randomness level of 0 would just loop over your list of meals and pick the first one that meets your proximity requirements. I think that this would result in always having the exact same meals in the exact same order, the only thing that would change would be the number of days in the month, and which days of the week they fell on. I can see how might want that. Then adding some randomness would choose at random from the list of meals until they had all been selected once (again constraining to proximity rules), and then repeat.

    I'm not sure what would make one random selection "more" random than another, but I will give it some thought.

Comments now closed