Math and Logic Puzzles: Redux

This forum is for playing games other than Mafia and Mafia variants.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #225 (ISO) » Wed Nov 09, 2022 1:23 am

Post by Charles510 »

Are you still working?
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #226 (ISO) » Wed Nov 09, 2022 2:23 am

Post by StrangerCoug »

No, I was busy watching election results.
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #227 (ISO) » Wed Nov 09, 2022 2:30 am

Post by Charles510 »

who won?
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #228 (ISO) » Wed Nov 09, 2022 5:41 am

Post by StrangerCoug »

Here in Texas it largely went as expected.
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.
User avatar
Dessew
Dessew
Mafia Scum
User avatar
User avatar
Dessew
Mafia Scum
Mafia Scum
Posts: 1086
Joined: June 14, 2013

Post Post #229 (ISO) » Mon Mar 20, 2023 7:03 am

Post by Dessew »

Hey, haven't been to this site in ages :D

I wanted to ask my crush out for a date, but her brother is very protective of her, and gave me a condition I first have to fulfil unless I wish him to give me a purple nurple. I'll play 2n+1 games of chess (he hasn't decided exactly how many yet, but he'll tell me before we start) against him and his sister, always alternating. So for example if I first play against my crush, then I'll have to play against the brother next, then against her and so on, and in this case my last possible game would be against her. Only when I prove myself to be a colossal nerd by winning two games in a row, am I allowed to ask his sister out.

Now, she's very smart, and I can't even figure this problem out on my own, so my chances of winning against my crush are slim. Unfortunately, I can't tell her to lose against me on purpose, though, because then both my nurples will be purple, and that's where the limits of my ever-lasting love lie. On the other hand, her brother is a brute, and beating him should be a walk in the park.

Can you help me? Is there a way for me to maximise the probability of my crush's brother allowing me to ask his sister out? He's already letting me always play with the white pieces.
User avatar
Who
Who
Yes?
User avatar
User avatar
Who
Yes?
Yes?
Posts: 4745
Joined: March 22, 2013
Location: Third Base

Post Post #230 (ISO) » Mon Mar 20, 2023 9:21 am

Post by Who »

To clarify, the games are all being played sequentially, right? No game starts before the last one has ended. If so, are any of the following strategies allowed?
Use Stockfish against your crush
After beating her brother, before playing her, play another game against someone else you can beat, claim that you have won two games in a row and thus should be allowed to ask her out as per the exact words of the deal.
Beat her brother then forfeit against her before playing, then beat her brother again. Claim that because you forfeited before playing you didn't lose a game you played and thus you have won two games you played in a row and this one is just the last one but worse. Alternatively, lie and say you played her when you didn't.
What time control is there on each match, and are the games played immediately one after the other? Can you prolong a game against her brother to the point where she leaves/goes to sleep and then start the game against her and win on time when she doesn't show up?
Open with the bongcloud. She will assume that it is a meme game and proceed make meme moves, wait for her to screw up so badly that you can win starting a serious game there.
Who said that?
Chamber. It's all a conspiracy.
Or is it?
6
User avatar
Dessew
Dessew
Mafia Scum
User avatar
User avatar
Dessew
Mafia Scum
Mafia Scum
Posts: 1086
Joined: June 14, 2013

Post Post #231 (ISO) » Mon Mar 20, 2023 7:10 pm

Post by Dessew »

These are very creative solutions, but if the brother thinks I'm cheating or up to some trickery, he'll purple the nurple till I burple the purple. That wouldn't be a pretty sight.

HINT 1:
This is a maths problem.


HINT 2:
Perhaps there's an apect of these series of games that hasn't been explicitly specified yet, and where one option gives me a clear mathematical advantage over the other(s).
User avatar
Dessew
Dessew
Mafia Scum
User avatar
User avatar
Dessew
Mafia Scum
Mafia Scum
Posts: 1086
Joined: June 14, 2013

Post Post #232 (ISO) » Mon Mar 20, 2023 7:11 pm

Post by Dessew »

And yes, the games are played sequentially.
User avatar
implosion
implosion
he/him
Polymath
User avatar
User avatar
implosion
he/him
Polymath
Polymath
Posts: 14341
Joined: September 9, 2010
Pronoun: he/him
Location: zoraster's wine cellar

Post Post #233 (ISO) » Mon Mar 20, 2023 7:55 pm

Post by implosion »

Spoiler:
I think the unspecified thing is who the first and last games are played against, and the answer being looked for here is "choose to play against the sister first"?

Assuming your probability of winning against the sister is p and the brother is q, there's some inductive argument for calculating an exact probability of winning 2 in a row, and that could be easily used to show that it's better to choose to play the sister first when p < q. But based on the phrasing, it should be easier to just assume p is very small and q is very large, so losing a game to the brother is a rare event (even among samples where we win a game against the sister, which is also a rare event, as the two are independent), so having more chances to win against the sister will maximize your probability of winning.
User avatar
Dessew
Dessew
Mafia Scum
User avatar
User avatar
Dessew
Mafia Scum
Mafia Scum
Posts: 1086
Joined: June 14, 2013

Post Post #234 (ISO) » Mon Mar 20, 2023 8:38 pm

Post by Dessew »

Thanks to your help, managed to win two games in a row, and asked my crush out for a date. As it turns out, she hates my guts, and wants nothing to do with me. She broke my legs and my heart.

Spoiler:
For the argumentation you don't necessarily need induction (in fact, I'm not sure if that works). Consider that the difference of the probabilities you succeed with the teo different orders is some kind of (not constant) polynomial of p and q that's monotonic in both variables, and the only time the order doesn't matter is when p=q. So by continuity arguments you can set p and q to anything as long as their relative values are correct.

EDIT:
Small correction: I don't think the polynomial is monotonic.
User avatar
Dessew
Dessew
Mafia Scum
User avatar
User avatar
Dessew
Mafia Scum
Mafia Scum
Posts: 1086
Joined: June 14, 2013

Post Post #235 (ISO) » Wed Mar 22, 2023 5:42 am

Post by Dessew »

Let's try another one. I generate a random number p between 0 and 1 with uniform distribution, then I mint a coin such that the probability that it lands on heads when I toss it is p. What is the probability that I get exactly as many tails as heads if I toss the coin 2n times?
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2183
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #236 (ISO) » Wed Mar 22, 2023 6:32 am

Post by biancospino »

There's like an 80% chance I've messed some computation up along the line, but the general idea should work.

I write C(a,b) for a!/(b!(a-b)!) for each pair of integers with a>=b.

Suppose first that p was fixed. There are C(2n,n) scenarios in which you get n heads, and so the probability of getting exactly n heads is C(2n,n)p^n(1-p)^n.

Now, since p is extraded in [0,1] uniformly at random, the requested probability is the integral from 0 to 1 of C(2n,n)p^n(1-p)^n dp.

Now, let's compute the integral of p^n(1-p)^n dp between 0 and 1.
By parts, one has that, for a,b positive integers,
\int_0^1[p^a(1-p)^b dp]=
=[p^(a+1)/(a+1)(1-p)^b]|_0^1+\int_0^1[p^(a+1)/(a+1)(1-p)^(b-1)b dp]=
=\int_0^1[p^(a+1)(1-p)^(b-1) dp]b/(a+1)

So, by using this expression n times, one gets that
\int_0^1[p^n(1-p)^n dp]=(n/(n+1))*((n-1)/(n+2))*...*(1/2n)*\int_0^1[p^(2n)dp]
=n!/((2n)!/n!)*(1/(2n+1))=n!^2/(2n+1)!

And so in conclusion the requested probability is
C(2n,n)n!^2/(2n+1)!=((2n)!n!^2)/(n!*n!*(2n+1)!)=
1/(2n+1)
.
Taking a break from playing Mafia.
User avatar
Dessew
Dessew
Mafia Scum
User avatar
User avatar
Dessew
Mafia Scum
Mafia Scum
Posts: 1086
Joined: June 14, 2013

Post Post #237 (ISO) » Wed Mar 22, 2023 7:27 pm

Post by Dessew »

Yes, correct!

Spoiler:
Alternatively, we can also observe that a coinflip with probability p is equivalent to taking the indicator function of a random number uniformly generated between 0 and 1 being less than p. So we have 2n+1 iid random numbers, and we want to know if the first generated is in the middle. (We don't get pairwise distinct numbers with 0 probability, so there's no need to elaborate on that any further.
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2183
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #238 (ISO) » Fri Mar 24, 2023 10:28 pm

Post by biancospino »

Eh, let's do one.
Suppose there's a plane with 400 seats; all seats are booked, and all passengers are actually going to take the plane.

Passengers board the plane in a random order. The first one sits on the wrong seat (that is, a seat different from the one indicated in their ticket); all subsequent passengers sit on the correct seat if it's not occupied by someone else, and on a random unoccupied seat otherwise.

What is the chance that the last passenger to board will sit on the correct seat?
Taking a break from playing Mafia.
User avatar
tris
tris
she
Splatoon Tetris
User avatar
User avatar
tris
she
Splatoon Tetris
Splatoon Tetris
Posts: 5597
Joined: January 7, 2019
Pronoun: she
Location: tris
Contact:

Post Post #239 (ISO) » Sat Mar 25, 2023 8:55 am

Post by tris »

i know this one hehe
here's what it says
User avatar
Aisa
Aisa
she/her, they/them
Mafia Scum
User avatar
User avatar
Aisa
she/her, they/them
Mafia Scum
Mafia Scum
Posts: 2838
Joined: December 19, 2013
Pronoun: she/her, they/them
Location: Europe

Post Post #240 (ISO) » Fri Mar 31, 2023 1:12 pm

Post by Aisa »

In post 238, biancospino wrote: Eh, let's do one.
Suppose there's a plane with 400 seats; all seats are booked, and all passengers are actually going to take the plane.

Passengers board the plane in a random order. The first one sits on the wrong seat (that is, a seat different from the one indicated in their ticket); all subsequent passengers sit on the correct seat if it's not occupied by someone else, and on a random unoccupied seat otherwise.

What is the chance that the last passenger to board will sit on the correct seat?
Spoiler:
I think it's very close to 1/2.

The first passenger sets off a "chain" of passengers sitting in the wrong seats. For example, if they sit on passenger #3's seat, then #3 might sit in #17's seat, and so on. The chain only stops when one of the passengers closes the loop by randomly sitting in #1's seat, at which point everyone remaining can sit in their assigned seats.

Two possibilities:
1. If someone sits on #1's seat before someone sits on #400's seat, then #400 will sit on the correct seat.
2. If someone sits on #400's seat before someone sits on #1's seat, then #400 will be displaced.

There is a 1/399 chance that #1 happened to sit on passenger #400's seat, displacing #400.

Conditional on this not happening, the probabilities of any displaced passenger in the chain randomly sitting in #1's seat and in #400's seat are the same.

So the probability is (398/399) * (1/2) = 0.4987...

Or (1/2) * ((n-2)/(n-1)) for generic n.

Becomes exactly 1/2 if the first passenger chooses their seat uniformly at random from all seats on the plane, including their assigned seat.
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2183
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #241 (ISO) » Fri Mar 31, 2023 1:27 pm

Post by biancospino »

In post 240, Aisa wrote:
In post 238, biancospino wrote: Eh, let's do one.
Suppose there's a plane with 400 seats; all seats are booked, and all passengers are actually going to take the plane.

Passengers board the plane in a random order. The first one sits on the wrong seat (that is, a seat different from the one indicated in their ticket); all subsequent passengers sit on the correct seat if it's not occupied by someone else, and on a random unoccupied seat otherwise.

What is the chance that the last passenger to board will sit on the correct seat?
Spoiler:
I think it's very close to 1/2.

The first passenger sets off a "chain" of passengers sitting in the wrong seats. For example, if they sit on passenger #3's seat, then #3 might sit in #17's seat, and so on. The chain only stops when one of the passengers closes the loop by randomly sitting in #1's seat, at which point everyone remaining can sit in their assigned seats.

Two possibilities:
1. If someone sits on #1's seat before someone sits on #400's seat, then #400 will sit on the correct seat.
2. If someone sits on #400's seat before someone sits on #1's seat, then #400 will be displaced.

There is a 1/399 chance that #1 happened to sit on passenger #400's seat, displacing #400.

Conditional on this not happening, the probabilities of any displaced passenger in the chain randomly sitting in #1's seat and in #400's seat are the same.

So the probability is (398/399) * (1/2) = 0.4987...

Or (1/2) * ((n-2)/(n-1)) for generic n.

Becomes exactly 1/2 if the first passenger chooses their seat uniformly at random from all seats on the plane, including their assigned seat.
That is correct
Taking a break from playing Mafia.
User avatar
Aisa
Aisa
she/her, they/them
Mafia Scum
User avatar
User avatar
Aisa
she/her, they/them
Mafia Scum
Mafia Scum
Posts: 2838
Joined: December 19, 2013
Pronoun: she/her, they/them
Location: Europe

Post Post #242 (ISO) » Fri Mar 31, 2023 1:58 pm

Post by Aisa »

I can do one.

I have two piles of coins that have been flipped to show either heads or tails. The coins are fair, so 1/2 chance of each. The first pile has 101 coins, and the second pile has 100 coins. What is the probability the first pile contains (strictly) more heads than the second pile?

Spoiler: Follow-up question
Can you generalise the result to the case where the coins are unfair and turn up heads with probability p?
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2183
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #243 (ISO) » Fri Mar 31, 2023 2:48 pm

Post by biancospino »

I'm answering the "fair coins" situatiom for now.

Let Q(n) be the chance that, by throwing n coins twice, you get the same number of heads.

Let R(n) be the chance that, by throwing n coins twice, you get more coins the first time. Now, R(n)=(1-Q(n))/2, since provided you get different numbers, which is larger is equally probable.

Let in the end P(n) be the chance that, by throwing n+1 coins, you get more heads than by throwing another n coins. Clearly P(n) is the chance that the first coin is head, times Q(n)+R(n); or that the first coin is tail, times R(n). So,
P(n)=(Q(n)+(1-Q(n))/2)/2+(1-Q(n))/4
=Q(n)/2+1/4-Q(n)/4+1/4-Q(n)/4
=1/2




If p!=1/2, one gets
P(n)=(Q(n)+(1-Q(n))/2)p+((1-Q(n))/2)(1-p)
=Q(n)*(2p-1)/2+1/2

But atm idk how to compute Q(n) nicely for general p.
Taking a break from playing Mafia.
User avatar
Aisa
Aisa
she/her, they/them
Mafia Scum
User avatar
User avatar
Aisa
she/her, they/them
Mafia Scum
Mafia Scum
Posts: 2838
Joined: December 19, 2013
Pronoun: she/her, they/them
Location: Europe

Post Post #244 (ISO) » Fri Mar 31, 2023 3:14 pm

Post by Aisa »

Perfect!
In post 243, biancospino wrote: But atm idk how to compute Q(n) nicely for general p.
Whoops - the answer is I wrote the question at 2 am and didn't realise you'd need to compute Q(n) for general p to get this part. I don't know if there's a nice formula for it (:
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2183
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #245 (ISO) » Fri Mar 31, 2023 11:49 pm

Post by biancospino »

Image

I've asked wolfram and it appears that the formula is really not that nice lol. Clearly one has that, for fixed n, Q(n;p) must be an even polinomial of degree 2n in (p-1/2) with Q(n;0)=Q(n;1)=1 and Q(n;1/2)=comb(2n,n)/2^(2n) (since Q(n;1/2) is then equal to the chance that there is as many heads in the first pile as
tails
in the second (equal) pile, which happens iff there are n heads total), but other than that it seems real ugly
Taking a break from playing Mafia.
User avatar
Aisa
Aisa
she/her, they/them
Mafia Scum
User avatar
User avatar
Aisa
she/her, they/them
Mafia Scum
Mafia Scum
Posts: 2838
Joined: December 19, 2013
Pronoun: she/her, they/them
Location: Europe

Post Post #246 (ISO) » Sat Apr 01, 2023 3:29 am

Post by Aisa »

Yeahhh not sure what there is to say except
what is the
hypergeometric function
?? Sorry if you wasted any time on that.

Here is another one.

The following are examples of sets of integers such that their sum is the same as their product:
(2, 2)
(1, 2, 3)
(1, 1, 2, 4)

Find such a set with 2023 elements.

Spoiler: Follow-up question
Are there infinitely many such sets?

User avatar
Mitillos
Mitillos
He
Mafia Scum
User avatar
User avatar
Mitillos
He
Mafia Scum
Mafia Scum
Posts: 2300
Joined: August 23, 2012
Pronoun: He
Contact:

Post Post #247 (ISO) » Sat Apr 01, 2023 4:56 am

Post by Mitillos »

Solution to Euler's hypergeometric differential equation. It has a wikipedia page, if you want to learn more.

Anyway, for your problem, (2, 2023, 1 (repeated 2021 times)).
Yes, (2, n, 1 (repeated n - 2 times)). Also (3, n, 1 (repeated 2n - 3 times)). Also (k, n, 1 (repeated kn - n - k times)). Also (2 (repeated k times), 1 (repeated 2^k - 2k times)). Also (2 (repeated k times), 3 (repeated n times), 1 (repeated 2^k * 3^n - 2k - 3n times)). And so on.
You don't have ambiguity; you have
options
.
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2183
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #248 (ISO) » Sat Apr 01, 2023 9:35 am

Post by biancospino »

Unless you're asking if there are infinitely many such sets with exactly 2023 elements, in which case the answer is no (if we're talking positive integers. Otherwise (n,-n, 0 2021 times) always works).

For suppose that A is such (multi)set, and let M=max(A). Note that, for each a>b>1 and 0<c<b, one has (a+c)-ac>(a+b)-ab; so by using this repeatedly and replacing each element of A that is greater than 1 with 1, except for the (possibly not strictly) second-largest element with 2 and keeping the largest unaltered (N.B.: since M+2022>M always, there must exist an element of A, other than M, greater than one), one gets
M+2+2021>=2M
M<=2023

And so, there clearly are at most 2023^2023 such sets. Note that this upper limit is very clearly very generous (and the actual number is surely way, way lower), but it's finite.
Taking a break from playing Mafia.
User avatar
Aisa
Aisa
she/her, they/them
Mafia Scum
User avatar
User avatar
Aisa
she/her, they/them
Mafia Scum
Mafia Scum
Posts: 2838
Joined: December 19, 2013
Pronoun: she/her, they/them
Location: Europe

Post Post #249 (ISO) » Sun Apr 02, 2023 11:47 am

Post by Aisa »

Both the answers look good to me ^^.
I was asking if these sets in were finite in general, without the constraint they have to have 2023 elements, but I think bianco's answer is also correct.
Post Reply

Return to “The Whole Sort of General Mish Mash”