#Niche video game probability question

33 messages · Page 1 of 1 (latest)

latent vine
#

There's a 41% chance for 0
52% chance for 1
6% chance for 5
1% chance for 10

Assuming I roll these odds 12 times, how would I calculate the average return and it's standard deviation

(If you're curious about the video game it's The Binding of Isaac's Wooden Nickel item)

subtle flowerBOT
#
  1. Wait patiently for a helper to come along.
  2. Once someone helps you, say thank you and close the thread with:
+close
  1. Feel free to nominate the person for helper of the week in #helper-nominations
  2. Do not ping the mods, unless someone is breaking the rules.
  3. If you're happy with the help you got here, and the server overall, you can contribute financially as well:
latent vine
#

HES FAST

rancid python
#

Also, since this is a simple discrete distribution, you can also easily model the distribution of pennies from any number of throws by convolving the distribution with itself a bunch of times. Should be easy if you know coding.

#

If you don't, I can try coding it up. Shouldn't be hard.

latent vine
#

hmph im not much of a coder but i am an excel gremlin

#

E(x) is expected return and σ is sigma?

rancid python
rancid python
#

I'll try coding it.

rancid python
# latent vine hmph im not much of a coder but i am an excel gremlin

Ok, done. Here's the Scilab code, values and PMF. Sorry for taking so long, took a while to figure out how to rotate x-axis labels.
For Y = X1 + ... + X12:
E(Y) = 11.04
σ(Y) ≈ 5.107

n = input('Number of rolls of Wooden Nickel: ');
seq = [1];
x = 0:(length(roll) - 1);
EX = sum(x.*roll);
sigmaX = sqrt(sum(((x - EX)^2).*roll));
disp('Expected value', n*EX);
disp('Standard deviation', sqrt(n)*sigmaX);
for i=1:n
    seq = convol(seq, roll)
end
x = 0:(length(seq) - 1);
bar(x, seq, 1);
a = gca();
a.tight_limits = "on";
a.x_ticks.labels = "$\rotatebox{90}{"+string(x)'+"}$";
a.font_size = 3;
xtitle('P = f(N)', 'Pennies', 'Probability')```
#

As seen from the PMF, the mode is 7.

latent vine
#

holy crap i wouldve never figured this out

#

thank you

rancid python
#

You're welcome!

#

Oh, wait. I think I didn't paste the whole code.

#

Ok, it's good now.

#

Almost left out the most crucial part 😅

latent vine
#

how come there are so many 0s in the [roll]

#

or does that just simulate a roll

rancid python
#

Which are 0, since there aren't any coins with those values.

latent vine
#

ohhh

#

that makes sense

#

also what do the periods mean

#

in EX = sum(x.roll);

#

for example

#

is this just coding stuff? i suck at coding

rancid python
#

Transpose.

#

As in, if u and v are column vectors, then u·v = u^T v.

#

Anyway, I actually adapted this code from a program I wrote to model MS peaks.