# Using randbetween function to apply a decimal advantage

1. ## Using randbetween function to apply a decimal advantage

In studying a card game using Excel I found the randbetween function, but it does not allow negative numbers. I want to in essence flip a coin that has a 1.34% bias. I used randbetween 0 and 200134, set less than 10000 to be a loss and over 10000 to be a win. It should therefore be a win 1.34% more often from my calculations. Was there an easier way to do this?

2. ## Re: Using randbetween function to apply a decimal advantage

How is less than 10,000 equal to 1.34%? Isn't it 10,000 / 200,134 which is about 4.99%?

I would have used 0 and 10,000 as th limits. Any value less than 134 is 1.34%

Edit - on reading your post again I think I misunderstood and you'r weighting one flip at 1.34% higher than the other.

If so the first thing is use 20,134 not 200,134

3. ## Re: Using randbetween function to apply a decimal advantage

First I just want to check if your math is right.
When you say you want the coin to have a 1.34% bias do you mean that 51.34% of tosses on average will result in a "win"? If so, 51.34% of 200134 = 102749, so your breakpoint between a win and a loss would be 102749, not 10000.

Secondly, can't you simply use rnd() then:
if rnd() > 0.5134 "win" else "loss"

4. ## Re: Using randbetween function to apply a decimal advantage

I would not use RANDBETWEEN, but rather Rnd. You have not shown VBA code but you posted in a VBA forum. So here is the code I would use:
Remember--these are pseudo random numbers. So you will not consistently meet your percentage. The bias will approach that percentage over a very large number of trials.

Also this does what your numbers show in the first post but this is not the same as "It should therefore be a win 1.34% more often". If you want the number of wins to be 101.34% of the number of losses then your math is not right.

5. ## Re: Using randbetween function to apply a decimal advantage

I posted in the wrong forum, hope its okay to answer. Thanks for the help on this, I was going to fast, too sloppy. It was fun coming up with the idea though. I love this stuff.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1