Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Random numbers but with a bias

Hi,
I need to populate a test table with some random numbers.
Example : 0 or 1.
I fill in the table with "= Randbetween(0;1)" and that does the trick.

But now I need to bias the data so there is - for example -
twice a many chances of 0 than there is of 1.

How would I do that ?

TIA
Nurrrrthk


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Random numbers but with a bias

=IF(RANDBETWEEN(0,2)=2,1,0)

If random number is 1 or 0, returns 0. If 2, returns 1. This gives the value
of 0 a 2-1 advantage.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"nurrrthk" wrote:

Hi,
I need to populate a test table with some random numbers.
Example : 0 or 1.
I fill in the table with "= Randbetween(0;1)" and that does the trick.

But now I need to bias the data so there is - for example -
twice a many chances of 0 than there is of 1.

How would I do that ?

TIA
Nurrrrthk



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default Random numbers but with a bias

On Wed, 15 Jul 2009 17:24:37 +0200, "nurrrthk"
wrote:

Hi,
I need to populate a test table with some random numbers.
Example : 0 or 1.
I fill in the table with "= Randbetween(0;1)" and that does the trick.

But now I need to bias the data so there is - for example -
twice a many chances of 0 than there is of 1.

How would I do that ?

TIA
Nurrrrthk


Try this formula:

=INT(RANDBETWEEN(0,2)/2)

Hope this helps / Lars-Åke
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Random numbers but with a bias

This works too.
Based on your idea but with an implied IF.


=(RANDBETWEEN(0;10) < 4 ) *1

Testing if RANDBETWEEN(0;10) is smaller than 4, returns TRUE or FALSE,
multiplied by 1 gives 1 or 0.

nurrrthk




"Luke M" a écrit dans le message de news:
...
=IF(RANDBETWEEN(0,2)=2,1,0)

If random number is 1 or 0, returns 0. If 2, returns 1. This gives the
value
of 0 a 2-1 advantage.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"nurrrthk" wrote:

Hi,
I need to populate a test table with some random numbers.
Example : 0 or 1.
I fill in the table with "= Randbetween(0;1)" and that does the trick.

But now I need to bias the data so there is - for example -
twice a many chances of 0 than there is of 1.

How would I do that ?

TIA
Nurrrrthk







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 110
Default Random numbers but with a bias

Nurrrrthk -

=IF(RAND()<(2/3),0,1)

- Mike

http://www.MikeMiddleton.com


"nurrrthk" wrote in message
...
Hi,
I need to populate a test table with some random numbers.
Example : 0 or 1.
I fill in the table with "= Randbetween(0;1)" and that does the trick.

But now I need to bias the data so there is - for example -
twice a many chances of 0 than there is of 1.

How would I do that ?

TIA
Nurrrrthk



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
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
Goal Seek Bias Tina Excel Worksheet Functions 1 March 30th 07 01:16 AM
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 11:18 PM.

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"