Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: KyriakosCH on Wed 08/07/2020 12:20:29

Title: Question about probabilities
Post by: KyriakosCH on Wed 08/07/2020 12:20:29
(https://i.imgur.com/p76Vejb.png)

Let's assume that you have three empty boxes. You are given an infinite number of balls, but only of x number of types, and asked to present all possible arrangements (ball of type x1 in box + ball off type x2 etc). Eg, if you only have one ball type, the first arrangement is singular, given you can only fill the boxes in one way:
Box A has ball type x1, box 2 also type x1, same for box3.
If, on the other hand, you were given two types of balls, the full set of possible arrangements would have been 8, because each box could have 2 types and each of those types would form a set with each distinct arrangement for the remaining boxes, ie 2X2X2= 8. Likewise, for type=3, you have 3^3, and for type=n you have n^3.

Now, my question:

Someone asks you to do all these arrangements, up to nx (with x being an arbitrarily large integer). Then asks you to choose one case for each arrangement (so for n=2, you choose just one of the 8 possible cases), and add all those single cases as probabilities. What in essence you would be adding up is the probability of each single case, but for a continuum of cases (from n=1 to n=x). In practice what is that probability about, if expressed as a single effect instead of a continuum?
It obviously is not the probability of getting all those specific single cases if the arrangement was run for the entire continuum, given that this has an upper bound at the smallest singular probability of the individual cases.

Just asking for a stupid game I am making. Or I'll go with that anyway :P
Title: Re: Question about probabilities
Post by: Khris on Wed 08/07/2020 12:42:02
Here's my take based on what I understood:

With three boxes and n types, the possibilities are n^3.
So the probability for each case is 1 in n^3.

1 - 1
2 - 0.125
3 - 0.037...
4 - 0.015625

Given how fast the number approaches zero, the sum of all these possibilities looks to be about 1.2: https://ideone.com/lRLnZi
Title: Re: Question about probabilities
Post by: KyriakosCH on Wed 08/07/2020 14:13:01
Yes, but the issue is what exactly would the sum be (if it expresses something tied to probability) for n cases. Eg what is the sum about if it is arbitrarily close to 1.2 and we want to express it as a probability tied to the set of n in such arrangements for three free spaces?

As you said, there is only 1 case for the selected singular probabilities to happen. But what does the addition of those (which gives close to 1.20... for n --> infinity) express as a probability?
Title: Re: Question about probabilities
Post by: Khris on Wed 08/07/2020 14:45:04
The probability would basically be the average, right?
That's very very small even for small n, and basically 0 for infinity.

I don't see the point of calculating any of this; it's basically calculating the chances of guessing a 3-digit lock correctly on the first try while increasing the number of digits per wheel. It gets vanishingly small pretty quickly.

What's the in-game use-case here?
Title: Re: Question about probabilities
Post by: KyriakosCH on Wed 08/07/2020 14:53:26
Quote from: Khris on Wed 08/07/2020 14:45:04
The probability would basically be the average, right?
That's very very small even for small n, and basically 0 for infinity.

I don't see the point of calculating any of this; it's basically calculating the chances of guessing a 3-digit lock correctly on the first try while increasing the number of digits per wheel. It gets vanishingly small pretty quickly.

What's the in-game use-case here?

The idea in the game is that the person has to indeed find a way to guess correctly for all n, in one try - else they lose.
But I was trying to actually have a notion of what the sum of all singular (ie successful) guess would mean... So, for example, what would it mean if n=3, so the person would have to guess correctly for n=1,n=2,n=3? There's only one case this would happen, but (assuming n is large), what does (roughly) 1,20 mean?

(I need to think of the answer not to use the math - that doesn't need this answer. The answer is needed for the concept :) )

edit: one idea I had (but I am not sure if it is correct...) is that 1,20 would be the number of times you would certainly choose the correct case (the only correct case), if the experiment was run for all n. If n=2 (n=[1,2]), the sum is 1+1/8= 1.125, so a 1,125 guaranteed correct answer if the experiment runs for all n with n=1,2. But I am not confident this is a correct notion... I mean obviously the 1 comes from n=1, not from the continuum, and I want to express this as having to do with the continuum of all n.
Title: Re: Question about probabilities
Post by: heltenjon on Wed 08/07/2020 15:26:13
This could be done like a impossible problem requiring lateral thinking. If you change the problem into
Spoiler
being virtually impossible with different coloured balls, then you could make the solution manipulating the balls, e.g. painting them all the same colour.
[close]
Could be this was your idea all along.  ;)
Title: Re: Question about probabilities
Post by: KyriakosCH on Wed 08/07/2020 15:30:19
Quote from: heltenjon on Wed 08/07/2020 15:26:13
This could be done like a impossible problem requiring lateral thinking. If you change the problem into
Spoiler
being virtually impossible with different coloured balls, then you could make the solution manipulating the balls, e.g. painting them all the same colour.
[close]
Could be this was your idea all along.  ;)

If all the balls are of the same type, then it is just n=1, and yes, there is only one case :)
But in the plot* I am examining there are all the cases available, so n is the set of all natural integers and goes to infinity.
But my issue is that I want to present the concept of the game as having to do with the continuum of n, so the 1,20 would have to be mathematically (or at least notionally...) clearly tied to the continuum of n. I think it is doable, but I haven't thought of it by now... Maybe some kind of logarithm could be used (?) (sadly my uni degree is in philosophy, so my math is really low level :) ).

*it is part of the plot, but I don't want to reveal the rest. It has to do with brain scanning too:

(https://i.imgur.com/V2nDo0u.png)
Title: Re: Question about probabilities
Post by: KyriakosCH on Wed 08/07/2020 18:32:34
A related question:

Assuming this is a game, where one wins only if they guess correctly all the (single for each movement) cases to pass (eg there is only one case for n=1, so you pass anyway, but there is 1/8 chance to pass n=2 etc), wouldn't the probability to guess correctly up to n be probn1 X probn2 X ... probn? So 1/8 probability to pass n1,n2 etc.
So the summation of those x1,x2,x3 should mean something in relation to their multiplication. It is what I am asking.
Title: Re: Question about probabilities
Post by: Khris on Wed 08/07/2020 22:14:42
The sum of the probabilities on its own is kinda meaningless, yes.
Also yes, the product is what tells you the likelihood of achieving a bunch of correct guesses.

It's 1 in (2^3 * 3^3 * 4^3 * 5^3 * ... * n^3), so very, very small even for small n.
For n = 3 it's already 0.46%, for n = 4 it's 0.007%.

I still don't understand what the point of all this is.

Title: Re: Question about probabilities
Post by: KyriakosCH on Thu 09/07/2020 01:07:41
Quote from: Khris on Wed 08/07/2020 22:14:42
The sum of the probabilities on its own is kinda meaningless, yes.
Also yes, the product is what tells you the likelihood of achieving a bunch of correct guesses.

It's 1 in (2^3 * 3^3 * 4^3 * 5^3 * ... * n^3), so very, very small even for small n.
For n = 3 it's already 0.46%, for n = 4 it's 0.007%.

I still don't understand what the point of all this is.



Maybe I am just fishing in the dark pool of the internet, for some helpful idea to make a breakthrough.

After all, all the web is the dark web, if one is dark-minded enough  :=

Then again, it is also a game I am working on (but the premise of the game is the impossible attempt to present the sum as something specific, like for 2 -instead of 3- it is the famous problem of Basel and becomes π^2/6).

I plan to release the game by the end of the month :)
Title: Re: Question about probabilities
Post by: burbigo on Fri 10/07/2020 15:53:46
"After all, all the web is the dark web, if one is dark-minded enough" I totally agree with that honestly !
Title: Re: Question about probabilities
Post by: KyriakosCH on Fri 10/07/2020 19:07:28
 := := :=