# The algorithm is incorrect. Consider 3 pairs of boys (b1,b2,b3) and girls (ga,gb,gc) with the following preferences: b1(ga>.....), ga(b1>.....) b2(gb>gc>ga), gb(b1>b2>b3) b3(ga>gb>gc), gc(b2>.....) # -- Day 1: b1:ga, ga:{b1=yes, b3=no} b2:gb, gb:{b2=no}(preferred:b1) b3:ga, gc:(preferred:b2) # -- Day 2: b1:(married to ga), ga:(married to b1) b2:gc(gb refused me), gb:{b3=no}(preferred:b2) b3:gb, gc:{b2=yes} # -- Day 3: b1:(married to ga), ga:(married to b1) b2:(married to gc), gb:{b3=yes} b3:gb, gc:(married to b2) # -- Day 4: b1:(married to ga)(1st choice), ga:(married to b1)(1st choice) b2:(married to gc)(2nd choice), gb:(married to b3)(3rd choice) b3:(married to gb)(2nd choice), gc:(married to b2)(1st choice) # There exists 1 rogue couple: b2 prefers gb(1st choice) more than gc(current spouse, 2nd choice) gb prefers b2(2nd choice) more than b3(current spouse, 3rd choice) # Also, the assumption that a girl will not get a worse boy the next day than today is obviously wrong, because: 1) The boy that a girl loves more may be proposing, and ultimately being accepted by, another girl. 2) If a boy is refused, he may marry another girl next day or afterwards. 3) And not to mention that the rule specifies that a boy will cross a girl off his courting list, as soon as he's rejected. Meaning that a girl will never get a boy equally good as today.
I know this comment is 1 year old but this might help others who have the same question. I think your misunderstanding is thinking a girl rejects everyone except the person at the top of her list. Instead, girls reject every serenader who came to her except the highest ranking serenader *of that day* . Also the girls and boys do not get married until the wedding day, not whenever there is a match, since the boy could still get rejected on a later day. This is how the algorithm would actually run with your example: b1(ga>gc>gb), ga(b1>b2>b3) b2(gb>gc>ga), gb(b1>b2>b3) b3(ga>gb>gc), gc(b2>b1>b3) Day 1 b1 serenades ga b3 serenades ga ga rejects b3 since she prefers b1. b3 removes ga from his list. b2 serenades gb gb doesn't reject b2 since he is the only one serenading her (therefore he is her favourite of the day since there are no other serenaders for her this day) No one serenades gc. At the end of Day 1 the new lists are b1(ga>gc>gb) b2(gb>gc>ga) b3(gb>gc) girls lists always remains unchanged: ga(b1>b2>b3) gb(b1>b2>b3) gc(b2>b1>b3) Day 2 b1 serenades ga again ga doesn't reject him b2 serenades gb b3 serenades gb gb rejects b3 since b2 also serenaded her and b2 is higher on her list then b3. (so b2 is her favourite serenader of the day). b3 removes gb from his list No one serenades gc At the end of Day 2, the new lists are boys: b1(ga>gc>gb) b2(gb>gc>ga) b3(gc) girls lists always remains unchanged: ga(b1>b2>b3) gb(b1>b2>b3) gc(b2>b1>b3) Day 3 b1 serenades ga again ga doesn't reject him b2 serenades gb again gb doesn't reject him b3 serenades gc gc doesn't reject him as he is her only one serenading her today so he is her favourite serenader of the day Since there were no rejections this day, we terminate. Each girl marries the boy they were with on the final day. b1 with ga b2 with gb b3 with gc There are no rogue couples, b1 and ga is perfect match gb prefers b1 but b1 does not prefer gb over his current wife, ga, so gb can't be with b1. gc prefers b1 but b1 does not prefer gc over his current wife, ga. gc next prefers b2 but b2 doesn't prefer gc over his current wife, gb. Therefore gc cannot be with either b1 and b2 and must be with b3
Why is this video so underrated??? It is the best explanation I have ever gotten!
# The algorithm is incorrect. Consider 3 pairs of boys (b1,b2,b3) and girls (ga,gb,gc) with the following preferences:
b1(ga>.....), ga(b1>.....)
b2(gb>gc>ga), gb(b1>b2>b3)
b3(ga>gb>gc), gc(b2>.....)
# -- Day 1:
b1:ga, ga:{b1=yes, b3=no}
b2:gb, gb:{b2=no}(preferred:b1)
b3:ga, gc:(preferred:b2)
# -- Day 2:
b1:(married to ga), ga:(married to b1)
b2:gc(gb refused me), gb:{b3=no}(preferred:b2)
b3:gb, gc:{b2=yes}
# -- Day 3:
b1:(married to ga), ga:(married to b1)
b2:(married to gc), gb:{b3=yes}
b3:gb, gc:(married to b2)
# -- Day 4:
b1:(married to ga)(1st choice), ga:(married to b1)(1st choice)
b2:(married to gc)(2nd choice), gb:(married to b3)(3rd choice)
b3:(married to gb)(2nd choice), gc:(married to b2)(1st choice)
# There exists 1 rogue couple:
b2 prefers gb(1st choice) more than gc(current spouse, 2nd choice)
gb prefers b2(2nd choice) more than b3(current spouse, 3rd choice)
# Also, the assumption that a girl will not get a worse boy the next day than today is obviously wrong, because:
1) The boy that a girl loves more may be proposing, and ultimately being accepted by, another girl.
2) If a boy is refused, he may marry another girl next day or afterwards.
3) And not to mention that the rule specifies that a boy will cross a girl off his courting list, as soon as he's rejected. Meaning that a girl will never get a boy equally good as today.
You're missing the mark here by a long shot. Which is why you should look for understanding instead of looking to be "right"
I know this comment is 1 year old but this might help others who have the same question.
I think your misunderstanding is thinking a girl rejects everyone except the person at the top of her list. Instead, girls reject every serenader who came to her except the highest ranking serenader *of that day* . Also the girls and boys do not get married until the wedding day, not whenever there is a match, since the boy could still get rejected on a later day.
This is how the algorithm would actually run with your example:
b1(ga>gc>gb), ga(b1>b2>b3)
b2(gb>gc>ga), gb(b1>b2>b3)
b3(ga>gb>gc), gc(b2>b1>b3)
Day 1
b1 serenades ga
b3 serenades ga
ga rejects b3 since she prefers b1.
b3 removes ga from his list.
b2 serenades gb
gb doesn't reject b2 since he is the only one serenading her (therefore he is her favourite of the day since there are no other serenaders for her this day)
No one serenades gc.
At the end of Day 1 the new lists are
b1(ga>gc>gb)
b2(gb>gc>ga)
b3(gb>gc)
girls lists always remains unchanged:
ga(b1>b2>b3)
gb(b1>b2>b3)
gc(b2>b1>b3)
Day 2
b1 serenades ga again
ga doesn't reject him
b2 serenades gb
b3 serenades gb
gb rejects b3 since b2 also serenaded her and b2 is higher on her list then b3. (so b2 is her favourite serenader of the day).
b3 removes gb from his list
No one serenades gc
At the end of Day 2, the new lists are
boys:
b1(ga>gc>gb)
b2(gb>gc>ga)
b3(gc)
girls lists always remains unchanged:
ga(b1>b2>b3)
gb(b1>b2>b3)
gc(b2>b1>b3)
Day 3
b1 serenades ga again
ga doesn't reject him
b2 serenades gb again
gb doesn't reject him
b3 serenades gc
gc doesn't reject him as he is her only one serenading her today so he is her favourite serenader of the day
Since there were no rejections this day, we terminate.
Each girl marries the boy they were with on the final day.
b1 with ga
b2 with gb
b3 with gc
There are no rogue couples,
b1 and ga is perfect match
gb prefers b1 but b1 does not prefer gb over his current wife, ga, so gb can't be with b1.
gc prefers b1 but b1 does not prefer gc over his current wife, ga. gc next prefers b2 but b2 doesn't prefer gc over his current wife, gb. Therefore gc cannot be with either b1 and b2 and must be with b3