System Modelling and Simulation
System Modelling and Simulation
SIMULATION
ASSIGNMENTS
SUBMITTED BY:
Sidhanth S Nair
Roll no: 51
TVE21IE060
ASSIGNMENT NO.1
STEPS TO BE FOLLOWED
1.Open a new excel worksheet
2. Generate two sets of 100 random numbers namely X and Y
3. Formulate the condition to be satisfies as below
=IF(A2^2+B2^2<=1,1,0)
ASSIGNMENT NO:2
Q1. Use LCG to generate a sequence of 100 Random numbers with
a=19,m=100,c=0 and Xo=63
Steps to be followed:
1. Open Dev C++ and code as given below.
= 2^31 – 2
=2147483646
Steps to be followed:
1. Open excel and create a new worksheet.
2. In cell B1 ,enter intial value Xo =123457
3. In cell B2, enter the formula to generate the next value in the
sequence using the linear congruential method .The formula used
is
=MOD(7^5*B1,2^31-1)
4. Now click on cell B2 and drag down the fill handle upto the
desired number of cells
5. After completing these steps cells B2 to B101 will contain the
sequence of 100 random numbers generated using LCG
technique.
ASSIGNMENT NO:3
Q1. Develop a LCG of your Own and find the periodicity of that generator.
Steps to be followed:
1. Write a generalised C++ program as given below
2. The generated random numbers are as follows
Steps to be followed:
Steps to be followed: