Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Always the same average for random numbers!?

Hello :)

I am using a random number generation with a Randomize statement at the
beginning of the procedure.
My formula is Int ( 10 * Rnd + 1 ) to get a number between 1 and 10.

Thing is I have been trying this formula on 30 * 65536 cells and for each
session I get a 6.11 average. Most of the time it changes after the third
figure (like 6.114 instead of 6.112) but I am very surprised by the
similarity of the results...

Is that supposed to happen or am I doing something wrong?

Thanks
T_D
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Always the same average for random numbers!?


With that number of random samples approximately the same number of each
number 1 to 10 would always be produced with a random number generator. (The
law of probability). Use the Countif function to count the number of
occurrences of each number and you will find that you have almost equal
occurrences of each number 1 to 10.

Worksheet function example counts the number of occurrences of 1.
=COUNTIF($A$1:$AD$65536,1)
Change the parameter 1 to 2, 3, 4 etc for the other numbers.

However, what does surprise me is your end average result. I dont think
that is the correct average of that number of random samples from 1 to 10.
The average of the numbers 1 to 10 is 5.5 and I would expect something
similar for a large number of random numbers between 1 and 10.

--
Regards,

OssieMac


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Always the same average for random numbers!?

Average should alway be close to 5.5, that is (10 + 1) / 2.
The more you do the closer you get.
So, you are doing something wrong to get 6.11 or similar.
Are you not doing CLng (in VBA) instead of Int?
Due to the rounding that would give you your average figures.

RBS


"The Dude" <f_com2°AT°yahoo°DOT°fr wrote in message
...
Hello :)

I am using a random number generation with a Randomize statement at the
beginning of the procedure.
My formula is Int ( 10 * Rnd + 1 ) to get a number between 1 and 10.

Thing is I have been trying this formula on 30 * 65536 cells and for each
session I get a 6.11 average. Most of the time it changes after the third
figure (like 6.114 instead of 6.112) but I am very surprised by the
similarity of the results...

Is that supposed to happen or am I doing something wrong?

Thanks
T_D


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to average random cells with out counting zero? Alex Excel Worksheet Functions 2 April 30th 09 06:16 PM
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
Can Excel pick random numbers from 1-300 and not repeat numbers? Julian Excel Discussion (Misc queries) 1 June 7th 06 07:17 AM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM


All times are GMT +1. The time now is 02:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"