programming shuffles
>Can the procedures used in soft programming replicate the procedure used by the dealer in shuffling???? and, Obtain the same patterns (or whatever) that the dealer???<
Are you asking the algorythm of the "computer random shuffle?"
Are you asking how to program a riffle? How "technical" do you want to get on the riffle? IOW, do you want to account for the fact that the cards tend to drop at different rates depending on how deep you are into the two "picks?" Or, are you willing to assume, as I did 25 years ago when I was doing what you are trying to do now, that the drop rates vary so much from dealer to dealer, and from the start of a dealer's shift to the end of the same dealer's shift, than an overall average drop rate is the best way to go?
Here is the drop rate I ended up using:
int rnd3( )
{...int tmp;
....if ( !( tmp = ( rnd( ) & 15 ) ) )
........return 3;
....else if ( !( tmp & 3 ) )
........return 2;
....else return 1;
}
Of the 16 possible binary values for "tmp":
0000 returns 3;
0100, 1000 and 1100 return 2;
and all the rest return 1.
Thus the average "drop" size becomes 1.3125 cards, which is almost exactly what my research showed was the average drop size of a flesh-and-blood dealer riffling two half-deck picks using a "fine" shuffle.
Also, I do not use the "rnd( )" function -- the period is too short. Instead, I use the "r250( )" function which was written up in Dr. Dobbs Journal, and which is available on the internet. Try a Google search on "r250 +programming" or "r250 +random." The period for this RNG is 2^250 - 1, which is more than adequate for any program you would ever live long enough to be able to run.