Page 1 of 1
Random number in dealer how to generate a random number within limits
#1
Posted 2016-February-15, 14:18
I recently discovered the option to program criteria for the hands generated to practice bidding with my partner. I must say, that I am excited!
One thing I am missing though is a random number generator. Nothing advanced, just the possibility to generator a random integer from a discrete uniform distribution, like a number between 0 and 9, all outcomes the same probability.
I have tried rand() and other C-like things without luck. Its gotta be there somehow, since the cards can be shuffled :-)
Is this possible?
One thing I am missing though is a random number generator. Nothing advanced, just the possibility to generator a random integer from a discrete uniform distribution, like a number between 0 and 9, all outcomes the same probability.
I have tried rand() and other C-like things without luck. Its gotta be there somehow, since the cards can be shuffled :-)
Is this possible?
#2
Posted 2016-February-15, 15:27
J Lodahl, on 2016-February-15, 14:18, said:
I recently discovered the option to program criteria for the hands generated to practice bidding with my partner. I must say, that I am excited!
One thing I am missing though is a random number generator. Nothing advanced, just the possibility to generator a random integer from a discrete uniform distribution, like a number between 0 and 9, all outcomes the same probability.
I have tried rand() and other C-like things without luck. Its gotta be there somehow, since the cards can be shuffled :-)
Is this possible?
One thing I am missing though is a random number generator. Nothing advanced, just the possibility to generator a random integer from a discrete uniform distribution, like a number between 0 and 9, all outcomes the same probability.
I have tried rand() and other C-like things without luck. Its gotta be there somehow, since the cards can be shuffled :-)
Is this possible?
As far as I know, Dealer doesn't expose this kind of low level primitive, however, there are a bunch of useful higher level functions.
If you can give me a better idea what you are trying to do, I can probably suggest something reasonable.
If worst comes to worst, you can back out a random number generator using "hascard", but this seems like a stupid thing to do
Alderaan delenda est
#3
Posted 2016-February-15, 18:11
Could you give an example of why you want the rand() function ?
I have used dealer for more than 20 years now, and never needed that function
Thorvald
I have used dealer for more than 20 years now, and never needed that function
Thorvald
Thorvald Aagaard
Mobile : +45 22 99 55 25
http://www.netbridge.dk
http://www.thorvald.dk
Mobile : +45 22 99 55 25
http://www.netbridge.dk
http://www.thorvald.dk
#4
Posted 2016-February-16, 13:10
Thank you for your fast replies and interest.
If you think Why would you need this here are three examples:
1 Generate a hand fulfilling the specified criteria or with a given probability generate a hand which almost fulfils the criteria. I find this better training than all hands are fulfilling.
2. Generate a normal opening hand 11-21 HCP but even out the distribution so that more hands than normal are "good hands" (think part of a condition like e.g. hcp(north)>=11+r where r is random 0-10)
Or just
3. Generate a NT opening hand, equally likely to be 1NT or 2NT
Does this make sense?
I see the point of using available functions for pseudo-random but dont see how?
If you think Why would you need this here are three examples:
1 Generate a hand fulfilling the specified criteria or with a given probability generate a hand which almost fulfils the criteria. I find this better training than all hands are fulfilling.
2. Generate a normal opening hand 11-21 HCP but even out the distribution so that more hands than normal are "good hands" (think part of a condition like e.g. hcp(north)>=11+r where r is random 0-10)
Or just
3. Generate a NT opening hand, equally likely to be 1NT or 2NT
Does this make sense?
I see the point of using available functions for pseudo-random but dont see how?
#5
Posted 2016-February-16, 14:01
J Lodahl, on 2016-February-16, 13:10, said:
Thank you for your fast replies and interest.
If you think Why would you need this here are three examples:
1 Generate a hand fulfilling the specified criteria or with a given probability generate a hand which almost fulfils the criteria. I find this better training than all hands are fulfilling.
2. Generate a normal opening hand 11-21 HCP but even out the distribution so that more hands than normal are "good hands" (think part of a condition like e.g. hcp(north)>=11+r where r is random 0-10)
Or just
3. Generate a NT opening hand, equally likely to be 1NT or 2NT
Does this make sense?
I see the point of using available functions for pseudo-random but dont see how?
If you think Why would you need this here are three examples:
1 Generate a hand fulfilling the specified criteria or with a given probability generate a hand which almost fulfils the criteria. I find this better training than all hands are fulfilling.
2. Generate a normal opening hand 11-21 HCP but even out the distribution so that more hands than normal are "good hands" (think part of a condition like e.g. hcp(north)>=11+r where r is random 0-10)
Or just
3. Generate a NT opening hand, equally likely to be 1NT or 2NT
Does this make sense?
I see the point of using available functions for pseudo-random but dont see how?
From the sounds of things you want to create discrete sets of hands and then mix them together based on some kind of PDF.
It's probably possible to do this within Dealer. Personally, I'd just use Dealer to pipe 100 hands of type foo to file A.
Pipe another 100 hands of type bar to file B and then use awk or PERL or some such to blend the files.
Alderaan delenda est
#10
Posted 2016-February-17, 11:06
hrothgar, on 2016-February-17, 09:35, said:
Sorry, when I said PDF I meant "Probability Density Function"
OK :-) That makes so much more sense. In the context talking about files I didn't get that. Also I was not aware of the possibility to read files with hands into BBO.
So it is a possibility to generate different kinds of hands, into separate files and then "blend" hands from the files in some post-script into a new file and load the blended file into BBO?
#11
#12
Posted 2016-February-17, 18:09
hrothgar, on 2016-February-17, 12:11, said:
yes
How do you upload the output from dealer ? (Maybe its more Where do you upload the output file from dealer ?)
Thorvald Aagaard
Mobile : +45 22 99 55 25
http://www.netbridge.dk
http://www.thorvald.dk
Mobile : +45 22 99 55 25
http://www.netbridge.dk
http://www.thorvald.dk
#14
Posted 2016-February-26, 01:52
I would like to conclude on the topic.
I endende up with a very simple sum of hascard as indikator:
Rand=hascard(east,2C)+hascard(east,3S)+hascard(east,4D)+hascard(east,5H)+hascard(east,6D)+hascard(east,7S)+hascard(west,2H)+hascard(west,3C)+hascard(west,4H)+hascard(west,5S)+hascard(west,6C)+hascard(west,7D)
Rand is then binomial(12,25%) Strictly speaking the indicators are not independent, since they depend on the conditions for the hands in general but I have testet this on a simulation and absolutely no problem. Rand also have some slight correlation to the hand you are dealt, but I have never thought of that in the examples I have tried.
One example where I use this is:
SkipSmall=((Rand>=2) and (hcp(north)+hcp(south)<=24))
Just to giv you one specific.
Thanks all for the warm welcome in the forum.
Jĝrn
I endende up with a very simple sum of hascard as indikator:
Rand=hascard(east,2C)+hascard(east,3S)+hascard(east,4D)+hascard(east,5H)+hascard(east,6D)+hascard(east,7S)+hascard(west,2H)+hascard(west,3C)+hascard(west,4H)+hascard(west,5S)+hascard(west,6C)+hascard(west,7D)
Rand is then binomial(12,25%) Strictly speaking the indicators are not independent, since they depend on the conditions for the hands in general but I have testet this on a simulation and absolutely no problem. Rand also have some slight correlation to the hand you are dealt, but I have never thought of that in the examples I have tried.
One example where I use this is:
SkipSmall=((Rand>=2) and (hcp(north)+hcp(south)<=24))
Just to giv you one specific.
Thanks all for the warm welcome in the forum.
Jĝrn
Page 1 of 1