Old 07-26-2017, 01:38 PM   #1
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Math Question - Probability

Let's say you had a number line with all real numbers between 1 and 5. If you were to randomly select a bunch of numbers within this range, the average result would become closer to three the larger the sample size became. So the expected value of this scenario is 3.

My question though, is what if you take N random numbers generated and keep the best result? What is the relationship between N and the expected maximum result within the list of outputs?
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 01:43 PM   #2
Dinglesberry
longing
FFR Veteran
 
Dinglesberry's Avatar
 
Join Date: Dec 2007
Location: Ontario, Canada
Posts: 2,680
Default Re: Math Question - Probability

N/2

EDIT: i think it might be π

Last edited by Dinglesberry; 07-26-2017 at 01:43 PM..
Dinglesberry is offline   Reply With Quote
Old 07-26-2017, 01:48 PM   #3
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

Quote:
Originally Posted by Dinglesberry View Post
N/2

EDIT: i think it might be π
If it was N, I'd have an expected max value of 6 after 6 rolls, but no single result
can go over 5
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 01:53 PM   #4
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

I'm not quite sure how to get there, but my intuition is that if you graphed the answer, it would have a horizontal asymptote at y=5
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 02:06 PM   #5
inDheart
Picker @ JAX2
FFR Simfile Author
 
inDheart's Avatar
 
Join Date: Aug 2011
Posts: 505
Default Re: Math Question - Probability

what is the "best" result?
inDheart is offline   Reply With Quote
Old 07-26-2017, 02:11 PM   #6
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

Quote:
Originally Posted by inDheart View Post
what is the "best" result?
Sorry that isn't very mathy lol

Later I spell it out a bit better, saying the expected maximum value, I mean the expected maximum number from the pool of N random real numbers between 1 and 5. So if you picked 100 random real numbers between 1 and 5, how close to 5 is the expected maximum value? How do I find an equation for the maximum expected value for N random numbers.
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 02:23 PM   #7
SKG_Scintill
Spun a twirly fruitcake,
FFR Simfile AuthorFFR Veteran
 
SKG_Scintill's Avatar
 
Join Date: Feb 2009
Age: 31
Posts: 3,865
Default Re: Math Question - Probability

just tried it empirically with some quick code

Code:
$array = array();
for ($i = 0; $i < 1000; $i++) {
	$highest = 0;
	for ($j = 0; $j < 100; $j++) {
		$rand = mt_rand(1,5);
		if ($rand > $highest) {
			$highest = $rand;
		}
	}
	array_push($array, $highest);
}
$sum = 0;
foreach ($array as $num) {
	$sum += $num;
}
echo $sum / sizeof($array);

the $j < [num] is the amount of numbers I take before I take the best result
here's the result for different amounts
1: 3.089
2: 3.811
3: 4.162
4: 4.436
5: 4.577
10: 4.892
100: 5

so yes, it goes to 5

doesn't give a mathematical relationship but whatever I was bored
__________________





Quote:
Originally Posted by bluguerilla
So Sexy Robotnik (SKG_Scintill) {.0001/10} [--]
___
. RHYTHMS PR LAYERING
. ZOMG I HAD TO QUIT OUT TERRIBLE
.

Last edited by SKG_Scintill; 07-26-2017 at 02:25 PM..
SKG_Scintill is offline   Reply With Quote
Old 07-26-2017, 02:34 PM   #8
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

I found something close -
Y = nth root(.5) * (Maximum value)

Does this seem correct? It has a max value of 5, but N=2 gives 3.53

Edit:// If you pick two numbers, you're asking, at what value are the product of these two probabilities 50%? So having two probabilities of sqrt .5 (.7071...) multiplied together gives probability .5. The same would go for 3, 4, 5, or N numbers.

Is this reasoning sound?
__________________



Last edited by TheSaxRunner05; 07-26-2017 at 02:53 PM.. Reason: Fixed formula
TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 02:55 PM   #9
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

I edited my old post to hell, so I'm making a new post. My previous error was including the minimum and maximum value in the formula.
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 03:40 PM   #10
MarcusHawkins
Constantly Improving!
FFR Veteran
 
MarcusHawkins's Avatar
 
Join Date: Jun 2013
Age: 24
Posts: 1,204
Send a message via Skype™ to MarcusHawkins
Default Re: Math Question - Probability

Simple.

(Max Value + Min Value) / 2

Of course, you can also create (Min Value + Max Value) / 2 and receive the same result.

EDIT: I think I misread your question, and I apologize.

HOWEVER, this is good for finding the average of all possible numbers from your lowest to highest amount, whatever that may be.
__________________

Quote:
Originally Posted by Ghost_Medley View Post

This man is three months too early.
Quote:
Originally Posted by badman7772 View Post
Guess I'll take another Quality Pack please. I won't have Hawkins luck but I'm sure I'll have badluck7772.

Quote:
Originally Posted by _Zenith_ View Post
what the fuck marcus lmao

Quote:
Originally Posted by rushyrulz View Post
You should all thank MarcusHawkins btw

Quote:
Originally Posted by DDRNGGin View Post
Marcus is probably going to be the main man to win this (You will always be my DDR brother for life, MarcusHawkins! )

Quote:
Originally Posted by Sky Kitten View Post
Best Newbie
1st: MarcusHawkins: 4

Up And Coming FFRer
2nd: MarcusHawkins: 3

Last edited by MarcusHawkins; 07-26-2017 at 03:51 PM..
MarcusHawkins is offline   Reply With Quote
Old 07-26-2017, 03:48 PM   #11
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

Quote:
Originally Posted by MarcusHawkins View Post
Simple.

(Max Value + Min Value) / 2

Of course, you can also create (Min Value + Max Value) / 2 and receive the same result.
I don't think you quite get what I'm asking, see my later posts in the thread to see what I mean.

I think I figured it out though.
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 04:04 PM   #12
SKG_Scintill
Spun a twirly fruitcake,
FFR Simfile AuthorFFR Veteran
 
SKG_Scintill's Avatar
 
Join Date: Feb 2009
Age: 31
Posts: 3,865
Default Re: Math Question - Probability

I'm breaking my head lmao

so I may be going completely in the wrong direction
this *should* be the average of your situation

you can see the way it expands for every extra random number you take before you take the highest one
I can't get that expansion written as a product summation
but fk man I only did high school math

fun tho
would like to see someone else just go, you know, the easy route
__________________





Quote:
Originally Posted by bluguerilla
So Sexy Robotnik (SKG_Scintill) {.0001/10} [--]
___
. RHYTHMS PR LAYERING
. ZOMG I HAD TO QUIT OUT TERRIBLE
.

Last edited by SKG_Scintill; 07-26-2017 at 04:06 PM..
SKG_Scintill is offline   Reply With Quote
Old 07-26-2017, 04:16 PM   #13
ilikexd
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Apr 2006
Posts: 3,205
Default Re: Math Question - Probability

The EV of the highest number of N terms between 1 and 5 is the EV of the highest number of N-1 terms + 3/(2^N)

So when you start with 1 term between 1 and 5, you start with 3/(2^0)=3
3+3/(2^1)=4.5
4.5+3/(2^2)=5.25
etc.

Oh never mind, that's just wrong. I need to adjust the numbers.

e: This ends up being the answer for numbers between 0 and 6 though.

Last edited by ilikexd; 07-26-2017 at 04:30 PM..
ilikexd is offline   Reply With Quote
Old 07-26-2017, 04:24 PM   #14
ilikexd
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Apr 2006
Posts: 3,205
Default Re: Math Question - Probability

It should be the EV of the highest number among N terms is the highest number among N-1 terms + 3.2/(2^N). It doesn't apply to the first term though, which is just 3.

3+3.2/(2^2)
3+3.2/4=3.8

3.8+3.2/(2^4)
3.8+3.2/8=4.2

etc.

It should asymptotically approach 5 too.
ilikexd is offline   Reply With Quote
Old 07-26-2017, 04:54 PM   #15
SKG_Scintill
Spun a twirly fruitcake,
FFR Simfile AuthorFFR Veteran
 
SKG_Scintill's Avatar
 
Join Date: Feb 2009
Age: 31
Posts: 3,865
Default Re: Math Question - Probability

got it down to this

k is the highest number you go to (from 1 to "5")
m is the amount of times you take a random number before taking the highest number

...now I gotta think...

edit: darn nathan is that it? :P
edit v2: mine works for the first term
edit v3: looking at yours nathan, I think that's one of the first things that got me troubled, because that approach stops working from 4 and onward I believe
__________________





Quote:
Originally Posted by bluguerilla
So Sexy Robotnik (SKG_Scintill) {.0001/10} [--]
___
. RHYTHMS PR LAYERING
. ZOMG I HAD TO QUIT OUT TERRIBLE
.

Last edited by SKG_Scintill; 07-26-2017 at 04:58 PM..
SKG_Scintill is offline   Reply With Quote
Old 07-26-2017, 04:59 PM   #16
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

Quote:
Originally Posted by ilikexd View Post
It should be the EV of the highest number among N terms is the highest number among N-1 terms + 3.2/(2^N). It doesn't apply to the first term though, which is just 3.

3+3.2/(2^2)
3+3.2/4=3.8

3.8+3.2/(2^4)
3.8+3.2/8=4.2

etc.

It should asymptotically approach 5 too.
May I ask where the 3.2 constant comes from? I'm a little confused where that number comes from.
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 05:05 PM   #17
ilikexd
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Apr 2006
Posts: 3,205
Default Re: Math Question - Probability

Quote:
Originally Posted by SKG_Scintill View Post
edit v3: looking at yours nathan, I think that's one of the first things that got me troubled, because that approach stops working from 4 and onward I believe
that's a shame, i had bruteforced 3, 3.8, and 4.2 as the answers for n=1,2,3 with very long arithmetic and assumed a relation there

why don't you just run your program a bunch of times and take the average results so an equation can be fitted to them?
ilikexd is offline   Reply With Quote
Old 07-26-2017, 05:13 PM   #18
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Math Question - Probability

Here's my line of thinking: The probability of a single random number being above or below 3 is 50%. There is 50% of the range on the left and 50% of the range to the right.

It gets more complicated when you add a second probability. I'm looking for the product of two numbers that equals .5, so I take the sqr root of .5 - or .707

This number means the highest of two individual random numbers has a 50% chance of being in the top 29.3% percentile of all possible random numbers. If I take the .707 and multiply by 5, the max value, I get ~3.535 for an expected value.

For three numbers, I'm asking what three probabilities multiplied together reach 50% probability. The cubic root of .5 is .793, multiplied by 5 is ~3.968.

If this line if reasoning is incorrect, it would be helpful to me to know where the logical flaw lies, so I better understand it.
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 07-26-2017, 05:47 PM   #19
SKG_Scintill
Spun a twirly fruitcake,
FFR Simfile AuthorFFR Veteran
 
SKG_Scintill's Avatar
 
Join Date: Feb 2009
Age: 31
Posts: 3,865
Default Re: Math Question - Probability

@Nathan: I made a code that does my formula to give you the average number instead
using 1 to 5, up to 10 times before taking the highest number
Code:
<?php

for ($m = 1; $m <= 10; $m++) {
	$res = 0;
	for ($n = 1; $n <= 5; $n++) {
		$part = $n * (pow($n,$m) - pow($n-1,$m));
		$res += $part;
	}
	$avg = $res / pow(5, $m);
	echo $avg . '<br/>';
}

here are the results:
3
3.8
4.2
4.4336
4.584
4.68704
4.76064
4.81477376
4.85544192
4.88647424

edit: tried to use wolframalpha to see what it could do with my formula, but it's giving me some harmonic number series, which I know nothing of
here's the formula I know nothing of

k, n and m being variables, H being... something mathematical

edit v2: for now I'll keep it at this formula, reposting it so I can at least sleep
k is highest number (1 to "5")
n is current number in summation
m is amount of times before taking highest number
average =
__________________





Quote:
Originally Posted by bluguerilla
So Sexy Robotnik (SKG_Scintill) {.0001/10} [--]
___
. RHYTHMS PR LAYERING
. ZOMG I HAD TO QUIT OUT TERRIBLE
.

Last edited by SKG_Scintill; 07-26-2017 at 06:10 PM..
SKG_Scintill is offline   Reply With Quote
Old 07-26-2017, 08:01 PM   #20
SKG_Scintill
Spun a twirly fruitcake,
FFR Simfile AuthorFFR Veteran
 
SKG_Scintill's Avatar
 
Join Date: Feb 2009
Age: 31
Posts: 3,865
Default Re: Math Question - Probability

heh in my formula's case 0^0 = 1
__________________





Quote:
Originally Posted by bluguerilla
So Sexy Robotnik (SKG_Scintill) {.0001/10} [--]
___
. RHYTHMS PR LAYERING
. ZOMG I HAD TO QUIT OUT TERRIBLE
.
SKG_Scintill is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:39 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution