Skip to document

Coin - Coin

Coin
Course

Software Engineering (CS391)

174 Documents
Students shared 174 documents in this course
Academic year: 2021/2022
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
Fayoum University

Comments

Please sign in or register to post comments.

Preview text

####### El-Shorouk Academy

####### Higher Institute for Computer & Term : First

####### Information Technology

####### Year: 3rd

####### Department of Computer sciences

####### Instructor : Dr shaaban

Computer modeling & simulation

COIN PROBLEM

฀ Use the one-digit Random Number (6, 3, 5, 0, 8) to
generate random observations for:
a) Throwing fair coin.
b) Throwing a biased coin, assuming that probability of
tail=30%.(unfair coin)
?? Implement c# programs to simulate these two problems ??

a)

Random numbers that are one-digit are from 0 -------> 9 [ten integer numbers].

Because the coin is fair, then the probability of head equal to the probability of tail =

50% , Means “P(Head)=50% & P(Tail)=50% “.

- Theoretical probability of Head ( H )= 50 %= 0.

- Theoretical probability of Tail ( T ) = 50 % = 0.

Means that , the random numbers that indicate to head are five numbers (50%) , say :

0,1,2,3,4 and the random numbers that indicate to tail are the other five numbers

which are: 5,6,7,8,9.

H -----> 0, 1, 2, 3, 4 0.

T -----> 5, 6, 7, 8, 9 0.

No. of .trails = 5 ฀ According to the number of random numbers that given in that

problem ( we have in that problem 5 random numbers then no of trails = 5 )

Then:-

(6, 3, 5, 0, 8 ) -------Random observations---------> (T, H, T, H, T )

Simulated probability of head = no. of repeating head / no. of trials.

Simulated probability of( head)=2/5=0.

Simulated probability of tail = no. of repeating tail / no. of trials.

Simulated probability of (tail)=3/5=0.

Error = Theoretical prob - Simulated prob * 100

Theoretical prob

Error of head = 0 – 2/5 * 100 = 20 %

0.

Unfair Coin

b)

Random numbers that are one-digit are from 0 -------> 9 [ten integer numbers].

Because the coin is unfair, then the probability of head isn’t equal to the probability

of tail , then from the given probability the probability of head = 70 % , because the

probability of tail = 30 % ( given ).

Then let the random numbers that indicate to head are seven numbers (70%) , say :

(0,1,2,3,4,5,6) and the random numbers that indicate to tail are the other three

numbers which are: (7,8,9).

- Theoretical probability of head = 70 % = 0.

- Theoretical probability of tail = 30 % = 0.

H -----> 0, 1, 2, 3 , 4 , 5 , 6 0.

T -----> 7, 8, 9 0.

Then:-

(6, 3, 5, 0, 8 ) -------Random observations---------> (H, H, H, H, T )

No .Of. trails = 5 ( because the number of random numbers is 5 numbers )

Simulated probability of head = no. of repeating head / no. of trials.

Simulated probability of( head)=4/5=0.

Simulated probability of tail = no. of repeating tail / no. of trials.

Simulated probability of (tail)=1/5=0.

Error= Theoretical prob - Simulated prob * 100

Theoretical prob

Error of head = 0 – 0 * 100 = 14 %

0.

####### Error of tail = 0 – 0 * 100 = 33 %

####### 0.

Conclusion:

  • Error of head = 14 % which means that the probability of head increased by

####### 14 %, because the theoretical probability = 0 and then after compute simulated

####### probability it become = 0 then it increased ( 0 ฀ 0 ) , means also the simulated

####### probability is greater than theoretical probability.

  • Error of tail = 33 % which means that the probability of tail decreased by 33.

####### % , because the theoretical probability = 0 and then after compute simulated

####### probability it become = 0 then it decreased ( 0 ฀ 0 ) , means also the simulated

####### probability is smaller than theoretical probability.

Was this document helpful?

Coin - Coin

Course: Software Engineering (CS391)

174 Documents
Students shared 174 documents in this course

University: Fayoum University

Was this document helpful?
El-Shorouk Academy
Higher Institute for Computer & Term : First
Information Technology
Year: 3rd
Department of Computer sciences
Instructor : Dr.farouk shaaban
Computer modeling & simulation
COIN PROBLEM
Use the one-digit Random Number (6, 3, 5, 0, 8) to
generate random observations for:
a) Throwing fair coin.
b) Throwing a biased coin, assuming that probability of
tail=30%.(unfair coin)
?? Implement c# programs to simulate these two problems
??
Page 1 of 5