Question: Poker test -using C programming language Generate four digits at a time, and repeat 1000 time (a thousand sets of 4 digits). Tabulate the sets
Poker test -using C programming language
Generate four digits at a time, and repeat 1000 time (a thousand sets of 4 digits). Tabulate the sets as: i) all the same (e.g. 4444), ii) 3 digits the same (e.g. 4443, 3444 or 4344), iii) two pairs (e.g. 4334, 4433), iv) one pair (e.g. 4324 or4342), or v) none identical. In theory we would expect frequencies of 1, 36, 27, 432 & 504 respectively for a thousand sets of numbers (i.e. 4000 digits). You will not necessarily get those exact numbers.
(You are not going to use random but rand(). This function returns a pseudo-random integer between 0 and RAND_MAX, which his is defined in stdlib.h. You should not replace it with a constant since its value may vary with implementation.our code will therefore look something like this: randon_number = (int) (10.0*rand()/(RAND_MAX + 1.0));)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
