Jump to content
The Corroboree

Recommended Posts

How did you do the simulations? I wouldn't really know how to do one so quickly.

Share this post


Link to post
Share on other sites
clear all
close all
weeks_max = 1000000;
is_other_patrons = false;
seats = 6;
trials = 1000000;
met_on_day = zeros(0,trials);
for trial = 1:trials
for week = 1:weeks_max
met = false;
clear other_patrons
if is_other_patrons
other_patrons = randi(seats+1,1) - 1;
else
other_patrons = 0;
end
if (other_patrons
if other_patrons > 0
chair_patron = zeros(0,other_patrons);
for patron = 1:other_patrons
chair_patron(patron) = randi(seats,1);
end
end
day_m = randi(7,1);
day_f = randi(7,1);
time_m = randi(2,1);
time_f = randi(2,1);
seat_taken = true;
while seat_taken
chair_m = randi(seats,1);
chair_f = randi(seats,1);
if other_patrons > 0
for patron = 1:other_patrons
if (chair_m ==chair_patron(patron))||(chair_f ==chair_patron(patron))
seat_taken = true;
break
end
seat_taken = false;
end
else
seat_taken = false;
end
end
while (chair_f == chair_m)&&(day_f == day_m)&&(time_f == time_m)
chair_f = randi(seats,1);
end
table_m = ceil((chair_m-0.1)/2);
table_f = ceil((chair_f-0.1)/2);
if (day_f == day_m)&&(time_f == time_m)&&(table_f == table_m)
mod = (week-1)*7+day_f;
met = true;
break
end
end
end
if( met == false)
string = 'error: have not met by days_max'
pause
end
met_on_day(trial) = mod;
end
met_on_day_ave = sum(met_on_day)/trials
hist(met_on_day,100 )
[met_on_day_mode, number_of_times] = mode(met_on_day)

This is the code for in matlab. You set the is_other_patrons to true or false for questions 2 and 1, respectively. You can change seats = 6 to 5 or 8 for question 4, and set trials to whatever you want to get high accuracy, preferably 1000000 or more. weeks_max is just the maximum number of weeks that the simulation will go for if they never meet. You will get an error message if weeks_max is reached before they meet, and you would just have to increase it, but 1000000 is sufficient for the particular parameters of these questions.

The output is the average day they meet on, the mode, and the number of times the mode occurred, and it also plots a histogram.

Edited by ballzac

Share this post


Link to post
Share on other sites

Heh! I never learned how to use matlab for that. Now if you're correct in saying that Q3 is the mode, then is it even possible to calculate this analytically without programming techniques?

Share this post


Link to post
Share on other sites

Heh! I never learned how to use matlab for that. Now if you're correct in saying that Q3 is the mode, then is it even possible to calculate this analytically without programming techniques?

Well, like I said, every day in the first week occurs with the same probability, and every other day occurs with lower probability. So there are seven modes, and they are the seven days of the first week.

Share this post


Link to post
Share on other sites

the problem is blatantly sexualist, seeing as it states only a man & a woman can fall in love at the table... which is a pity cause clearly cβl & ballzac should go sit at the table together & be done with it

  • Like 3

Share this post


Link to post
Share on other sites

^^^ LOLOLOL

If CBL and ballzac aren't aliens I'll eat my tinfoil hat. I've absolutely no idea what they are burbling on about.

Love doesn't work like that. They'll smell each other first, or exchange words at the counter, or something.

Don't mathematicians know anything?

  • Like 2

Share this post


Link to post
Share on other sites

Tell you something else. If she has to wait 70 days for him to come and say Hi, she'll be long gone.

Share this post


Link to post
Share on other sites

i had suspicions that this was a very complicated question.

still, i wouldn't have guessed ballzac would fumble with it. not to diminish blunt's smarty-gifts either, i just know zac better and know that he is one brainy-ass motherfucker.

Share this post


Link to post
Share on other sites

'and never has any other patrons sitting at the tables when either the man or woman are there.' 2cents

Share this post


Link to post
Share on other sites

 

:P excellent alternative interpretation! I think you win.

Share this post


Link to post
Share on other sites

i wish i was better at abstract math. i distinctly remember the joy of maths being beat out of me at school.. in early childhood when i was first learning times tables & beyond i was fascinated by it as in my mind the numbers inhabited this profoundly vast space where they were three dimensional objects & floated around as though they were in a vacuum.. was a very visual experience & the numbers would perform all kinds of flips & movement in relation to each other as i found a path to the correct answers.. i remember it being a really fun & creative process where my mind would find it's own unique set of shapes & movements of these number/objects & i would make it to the answer.. no one understood what i was talking about when i tried to explain it & it was definitely not the way they were teaching us to do it. pretty quickly i got bored of however it was they wanted us to think about it & i rejected it..

it's a pity cause i think maths is profoundly interesting & definitely isn't purely a left brain phenomenon.. maths savants i find particularly interesting.. the ones that see the numbers as colors or taste them or smell them & the answers to complex equations come to them instantly as flavors or visual objects etc.. i think these abilities are in all of us to develop if we have the right support.. cause i remember experiences like this & also distinctly remember being told to stop it, or at least not encouraged in any way...

anyway, to make a pointlessly general statement, i think nerds are probably the coolest people around today & more & more are gonna be the ones running the world..

  • Like 1

Share this post


Link to post
Share on other sites

don't worry about that comment JD is one of the biggest nerds i've had the fortune of meeting, in fact he even looks identical to the nerd that homer yelled at.

i had the same childhood ability to perform arithmetic visually. i won't veer into my algebra vs geometry rant, it's probably not really related to what i'm about to say. pardon the "labelling" of "conditions" but i strongly suspect that what you describe is a mildly autistic characteristic. whenever i described visual modes of thinking at a young age it seemed to always be a new thing for the listener.

it's a very interesting topic for me. i reckon i swapped a lot of potential brilliance to be more normal, probably not by choice but by outside factors. i'm still weird but i can pass for normal or normalish, and i'm pretty happy about that. it's like the sweet spot for me. i wouldn't trade my balance of characteristics for a large sum of unconventional intelligence, and i certainly wouldn't choose to be strongly autistic. it might be okay/worthwhile in some cultures or in some school/social environments etc but i had a pretty shit time of it and i reckon i'm only marginally off-centre.

Share this post


Link to post
Share on other sites

yeah i'm definitely well along the spectrum. i can't pass for normal most of the time unless i'm really on my game, i have fairly expressive eyes i think & i'm crap at hiding the weirdness in my head & i'm quite socially detached most of the time.. but i've made it work for me thus far, i have a lot of good friends who love me for the weirdo i am.. most of the time i don't mind that people find me strange cause i know that they are just as strange or stranger in their own way & they usually don't even know it.. & most peoples strangeness is predictable & boring as hell.. i usually prefer weird & awkward people anyway, so have no desire to fit in.. over all though i think i'm fairly decently balanced.. for my liking anyhow, but definitely more on the autistic end than the other end thats for sure.. certainly makes life a lot more difficult, but worth it i reckon.. i'd want to suicide if my inner world was as boring as the minds of the people who find me strange seem to be.. i'm happy to trade a bit of social detached-ness & strange looks from simple people for the weird shit in my head :) & yeah i'm glad i'm not much further along the spectrum as well, though a little more savant-like genius would be nice..

Share this post


Link to post
Share on other sites

doubt thelema will mind the sidetrack since IIRC he identifies as "non neuro-typical" (neuro typical, a good word for those who do not have any autistic traits... driving home the idea that autism describes a brain that while not typical is perhaps a valuable product of genetic diversity, which like colour blindness may have assisted hunter gatherer tribes by allowing the entire tribe to benefit from a costly but useful trait possessed by even a single member of the tribe)

is it just me who finds the topic so fascinating (because i sit in the middle)? here's a case for syd barret as autism spectrum http://incorrectpleasures.blogspot.com.au/2009/11/interesting-case-of-syd-barrett-for.html

are you medically diagnosed?

where you mention suiciding rather than living without your rich inner world reminded me how deeply i treasure my own, although i don't (or try not to) view others as boring, i think we all (humans) have fantastic, incomprehensible brains which lean heavily in odd directions due to upbringing. how to nurture and challenge different young brains to their full potential is something humans need to work on whereas unfortunately while education techniques should be improving along with parenting techniques, parents these have too much stress and not enough time, and kids are a full-time job.

there are many types of clever people, in my case i think my brain is good at remembering shit and i wonder if that is because of it's slightly visual bent (two languages = better compression ratio than one language). i still have good memory even after fifteen years of moderate(ish) chemical assault. memories and questions are like homework for the brain when you sleep (sort yer rig just by laying in bed). i could go on about the pros and cons of a brain with a visual bent but meh, it's actually so diminished in adulthood that it doesn't play much of a part in ordinary wakefulness.

i want to hang around more non-typicals to get a better feel for it. i have empathy on both sides of the spectrum, but admittedly when you don't reap the fruits of autism (for instance if you share an interest and have the opportunity to pick their brain dry of horded information and unique perspectives) they can be hard people to like (based on very limited experience). sheldon cooper from "the big bang theory" is a fictitious, exaggerated character but it's a bit like that. nobody who watches sitcoms is expected to take sheldon's side, real life has more shades of grey but let him be a lesson to you! don't be so smug and conceited with your intellectual gifts that you think you are beyond the "give and take" of human relations, if you don't find the balance between being yourself and getting along with others, you may exceed at the former but you fail in the latter and people will write you off just as you have probably written countless people off, not because you're a bit weird but because you're more of a dick than you realise. so yeah both sides of the coin have more to offer but they're generally pretty aware of what they do have. it's much harder to be aware of what you AREN'T bringing to the table.

  • Like 1

Share this post


Link to post
Share on other sites

solution:

1) there's a 1/14 chance of them being in the café at the same time on any given shift within any given week. There's a 1/5 chance they'll sit opposite each other...thus 1/70. 70 days average.

2) for 0,1,2,3,4,5,6 strangers respectively, the probability that if the man and woman are also in the café that they sit opposite each other is (1/5, 5/24, 1/5, 3/10, 1/5, 0, 0) each x 1/14 = (1/70, 5/336, 1/70, 3/140, 1/70, 0, 0). Add, divide by 7, convert to a reciprocal = 1/88.421

Thus in this situation 88.4 days average.

3) How many days should Marcello bet for them meeting to have an equally-weighted chance in scenario 2?

When (87.421)^n / (88.421)^n = 0.5 ie n = log0.5/log(87.421/88.421) = 60.94 days.

4) I'll leave the rest to you....

Share this post


Link to post
Share on other sites

Where does 5/24 come from?


This is what I got for that option:

Case 5 free seats (1 other sitting) : 4/5 chance she will select an empty table. Guy then has 1/4 chance of sitting across from her. P = (4/5)*(1/4) = 4/20

Share this post


Link to post
Share on other sites

solution:

1) there's a 1/14 chance of them being in the café at the same time on any given shift within any given week. There's a 1/5 chance they'll sit opposite each other...thus 1/70. 70 days average.

2) for 0,1,2,3,4,5,6 strangers respectively, the probability that if the man and woman are also in the café that they sit opposite each other is (1/5, 5/24, 1/5, 3/10, 1/5, 0, 0) each x 1/14 = (1/70, 5/336, 1/70, 3/140, 1/70, 0, 0). Add, divide by 7, convert to a reciprocal = 1/88.421

Thus in this situation 88.4 days average.

3) How many days should Marcello bet for them meeting to have an equally-weighted chance in scenario 2?

When (87.421)^n / (88.421)^n = 0.5 ie n = log0.5/log(87.421/88.421) = 60.94 days.

4) I'll leave the rest to you....

*weeks

 

3) How many days should Marcello bet for them meeting to have an equally-weighted chance in scenario 2?

When (87.421)^n / (88.421)^n = 0.5 ie n = log0.5/log(87.421/88.421) = 60.94 days.

Not sure what you mean here. "even bet" usually just means that you double your money if you win. Seeing as returns have nothing to do with which day would be best to bet on them meeting, I ignored that. But it seems that you meant something else. Can you explain this?

Share this post


Link to post
Share on other sites

whoops, yes weeks, sorry.

by even bet, I mean, the point at which the probability they have not yet met equals the probability that they have. i.e. the point at which his chance of doubling his money are equal to his chance of losing his money = even bet.

5/24 comes from: Case 5 free seats (1 other sitting) : 4/5 chance she will select an empty table. Guy then has 1/4 chance of sitting across from her. P = (4/5)*(1/4) = 4/20

Hmmm maybe I did my counting wrong, I'll double check it.

Share this post


Link to post
Share on other sites

by even bet, I mean, the point at which the probability they have not yet met equals the probability that they have. i.e. the point at which his chance of doubling his money are equal to his chance of losing his money = even bet.

Hmmm, I know what you're getting at, but it doesn't really make sense. If he bets on a single day, his chance of doubling his money is never equal to his chance of losing his money. On day 1 he will be 68 times more likely to lose his money than to double it, and every week after that the odds just get worse (assuming that he places his bet before week 1).

If he wins the bet even if the couple have met prior to the day he chooses (which is essentially what your answer to this question requires as an assumption) then he is best off picking as late a date as possible to increase his chances.

A much clearer way of stating it would have been the way you have here: On what day does "the probability they have not yet met equal the probability that they have"? But if you want to weave it into your story, then it's important for the intended meaning of the question not to be obscured :)

Share this post


Link to post
Share on other sites

Yes, you're right, it's a case of bad wording.

I should have said:

"At the beginning, Marcello wants to make an even bet that they will have met by a certain number of weeks. What number should he bet on so that his chances of winning the bet are 50/50?"

I got the counting wrong, CBL is right. The correct solution is:

2) for 0,1,2,3,4,5,6 strangers respectively, the probability that if the man and woman are also in the café that they sit opposite each other is (1/5, 1/5, 1/5, 1/5, 1/5, 0, 0) each x 1/14 = (1/70, 1/70, 1/70, 1/70, 1/70, 0, 0). Add, divide by 7, convert to a reciprocal = 1/98. So 98 weeks.

3) How many weeks should Marcello bet for them meeting to have an equally-weighted chance in scenario 2?

When (97)^n / (98)^n = 0.5 ie n = log0.5/log(97/98) = 67.58 weeks

4) a) OK removing a seat, with the SAME DEAL concerning 0-6 strangers (another thing I should have specified):

For 0,1,2,3,4,5,6 strangers respectively, p that if man and woman are in the café that they sit opposite each other is (1/5, 1/5, 1/5, 1/5, 0, 0, 0) = 122.5 weeks

B) Adding a table gives (1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 1/7) = 98 weeks.

David's estimate is better than Marcello's, but no improvement.

If we use Bal-sac’s method, that when removing a chair we have randomly 0-5 other patrons, and when adding a table we have 0-8 randomly other patrons:

a) (1/5, 1/5, 1/5, 1/5, 0, 0) = 105 weeks

B) (1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 0, 0) = 126 weeks.

Then Marcello still comes out on top, but both are worse. Please note for the record of vanity that Balzac’s estimates are close but wrong.

Next, The Café Lover's Problem, Part 2.

Note: the original problem has been reworded slightly in light of the constructive insights of Balzac.

PS Don't you find it interesting, that no matter how many people are sitting at the tables, as long as n < 2t-1, then the probability is exactly the same for the lover's meeting? One way to think of this is that the reduction in probability of a table being occupied is exactly balanced by the increase in probability of them being constrained to less options in order to not sit next to each other.

Edited by Thelema

Share this post


Link to post
Share on other sites

The Café Lover's Problem, PART 2

Poor Marcello, can't sleep over the issue. He wants to increase dramatically the probability of them meeting before 98 weeks have passed.

He knows he cannot attract more than randomly 0-6 patrons at any one time. He enlists the help of a Mathematician who proves to him that variants of both his and David's solutions actually can't decrease the probability of them meeting. The Mathematician also shows him that if n=# of tables, then p = 1/(28n - 14) where n>3 and 1/98 if n<=3. The Mathematician also shows that subtracting a chair makes no difference to p if n>4, and p= (n-1)/49(2n-1) if n<=4. Therefore he shows them that 98 weeks is the optimum, given that their clientele won't vary - and that they needn't bother re-arranging the shop over the issue.

Marcello wakes in the middle of the night and thinks he has a solution: offer half price coffee's to couples that come into the shop. Let's say for the sake of the problem that this will increase the number of couples by 25%, and that couples will occupy both chairs of a table. Let's also say that if the man and the woman are sitting not opposite from each other, this deal will increase their chances of talking and pretending to be a couple by 1% in order to take advantage of the deal, but not if they're both on outer tables - and only if either the man or the woman can sit opposite each other, either on their own tables or on a vacant table.

Has Marcello hit on a way to reduce the 98 weeks? By how much?

Hint: the distributions 0-6 patrons rather than being random are now calculated to be 0.1215, 0.1215, 0.1366, 0.1366, 0.1544, 0.1544, 0.1751. You may not need this to solve the problem. If you do, double check it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×