Page 1 of 1 [ 5 posts ] 

SplendidSnail
Veteran
Veteran

User avatar

Joined: 2 Jul 2017
Age: 43
Gender: Male
Posts: 887
Location: Canada

22 Nov 2017, 10:18 pm

This has been bugging me a lot today for no good reason, and I feel like I should be able to figure this out, because the pattern is obvious.
When x = 0, y = 0
When x = 1, y = 50
When x = 2, y = 75
When x = 3, y = 87.5

I'm looking for an equation whereby by plugging in an arbitrary value for x, I can calculate y without having to first calculate all previous Y values leading up to it.


_________________
Level 1 Autism Spectrum Disorder / Asperger's Syndrome.


Trogluddite
Veteran
Veteran

User avatar

Joined: 2 Feb 2016
Age: 53
Gender: Male
Posts: 3,075
Location: Yorkshire, UK

22 Nov 2017, 10:37 pm

y = 100 - (100 / (2^x))


_________________
When you are fighting an invisible monster, first throw a bucket of paint over it.


SplendidSnail
Veteran
Veteran

User avatar

Joined: 2 Jul 2017
Age: 43
Gender: Male
Posts: 887
Location: Canada

22 Nov 2017, 10:50 pm

Nice! Thanks!

In case anyone's wondering, I'm pretty sure this is the equation for the following:

If you roll a die with an infinite number of sides 0 times, there is a 0% chance of rolling at least one 1.

If you roll a die with an infinite number of sides the same number of times as there are sides, there is a 50% chance of rolling at least one 1.

If you roll a die with an infinite number of sides twice as many times as there are sides, there is a 75% chance of rolling at least one 1.

If you roll a die with an infinite number of sides three times as many as there are sides, there is an 87.5% chance of rolling at least one 1.

If figured out those odds by writing a program to do a simulation with dice of various numbers of sides, but wanted to know how to calculate it rather than having to simulate it.


And, when rolling a die the number of times as there are sides, as the number of sides increases, the odds of rolling at least one 1 approach 50%.


_________________
Level 1 Autism Spectrum Disorder / Asperger's Syndrome.


Trogluddite
Veteran
Veteran

User avatar

Joined: 2 Feb 2016
Age: 53
Gender: Male
Posts: 3,075
Location: Yorkshire, UK

22 Nov 2017, 11:02 pm

You're welcome. :D

I can tell I'm an engineer rather than a statistician - the number series wasn't too bad, but the dice roll probabilities have me completely baffled, I wouldn't know even where to begin! If I see an infinity when I'm coding for audio processing, I kill it dead!


_________________
When you are fighting an invisible monster, first throw a bucket of paint over it.


kokopelli
Veteran
Veteran

User avatar

Joined: 27 Nov 2017
Gender: Male
Posts: 3,657
Location: amid the sunlight and the dust and the wind

29 Nov 2017, 5:38 pm

SplendidSnail wrote:
This has been bugging me a lot today for no good reason, and I feel like I should be able to figure this out, because the pattern is obvious.
When x = 0, y = 0
When x = 1, y = 50
When x = 2, y = 75
When x = 3, y = 87.5

I'm looking for an equation whereby by plugging in an arbitrary value for x, I can calculate y without having to first calculate all previous Y values leading up to it.


For what it's worth, given any such finite set of pairs of numbers with distinct x values, it is trivial to come up with a function that hits each pair exactly.

Since you used x and y above, I'll use w as my variable here:

f(w)=a*w^3+b*w^2+c*w+d.

SInce f(0)=0, d=0.

We then get a system of three linear equations in three unknowns:

f(1)=a+b+c=50
f(2)=8a+4b+2c=75
f(3)=27a+9b+3c=87.5

and solve for a, b, and c.

The problem is that you end up with a polynomial of degree 3 that meets the values for 0, 1, 2, 3 precisely, but anything else is all over the place.

I remember encountering this problem in high school. Without understand the consequences of using an nth degree polynomial, I used a chart of speeds through a quarter mile for a motorcycle from a motorcycle magazine and expected to get a simple equation that would show the speed at any time between the points as well. For example, the speed at 1.75 seconds. Once I got the equation and plotted it out (by hand -- no computers available in 1969 to do it) it quickly became obvious that the result was useless after all that work. It couldn't predict any speed at any time other than on those given initially.

So just giving a set of points on a curve and asking for the curve that meets those points is kind of useless. Of course, the latter explanation of where you are getting those numbers narrows down what you are looking for.