You are on page 1of 2

Introduction

Discrete Mathematics involves computations of finite numbers or sets. The field involves analyzing
problems in an orderly manner, or simply creating algorithms as solution to the problems, predicting the
outcome of things given that it is finite, which is also studying probability. Because of the nature of the
field it is useful in creating computer programs because users are required to build algorithms in order
to code and create programs, in a language that the computer can understand. An algorithm should
first be created before building any program, as this can help the user decide and smoothly create a step
by step process for the program, and be able to identify a problem in the program in the early stages of
developing it. The algorithm is basically a blueprint for solving the problem, and is the backbone of the
whole program. Even professional programmers spend a substantial amount of time creating the
algorithm before they start coding, as this creates a vision or a goal on what they want the program to
do.

One of the languages that the programs are written in is Matlab which stands for matrix laboratory and
is a high level programming language. With Matlab programs can be created with the use of functions
script files and other built in functions in Matlab. Matlab is commonly used in work, research, and
education to simulate and create programs that can solve problems, some of these problems are called
machine problems. A machine problem which consists of pseudorandom numbers requires the use of
built in functions in Matlab and knowledge of the topic of pseudorandom numbers. Pseudorandom
numbers are a sequence of random numbers that are generated with the numbers repeating after a
given set of elements are completed, it has four variables which consists of the modulo, increment,
multiplier, and the seed. The seed in a given sequence is the starting value, or can be denoted as X 0 the
next term is computed by multiplying the seed by the multiplier then adding the increment. After the
increment is added the given value is then divided by the modulus and its remainder will become the
next term after the seed. This is done until the sequence of numbers will eventually repeat itself. The
number of elements before the sequence repeats itself is determined by the modulus, and the number
of elements before the repeat is equal to the modulus.
Abstract:

The purpose of the study is to create a program that can generate pseudorandom numbers with the
user having control of the input variables like the multiplier, increment, seed, and modulus. This also
helps in algorithm development as the programmer is given the formula and given the freedom to use
whichever method or approach he/she wants to use to solve the problem. The knowledge of computing
pseudorandom numbers manually can then be applied to the given programming language Matlab and
is intended to test the programmer’s ability to apply his/her knowledge in discrete mathematics and in
Matlab. The machine problem also gives insight and a deeper understanding of how pseudorandom
numbers work, and it helps the programmer discover more functions and ways of using matlab in
creating programs. The machine problem is also a great way to to solve future problems which involves
pseudorandom numbers as the program can be reused to check manual computations or just use the
values that the program gives.

The basic function of the program is to compute pseudorandom numbers by following the formula of
the Linear Congruential Method and generating the pseudorandom numbers, then converting them to
binary numbers. It was discovered that in creating the program that one cannot simply create a
sequence from 1 to 128, as the sequence from 1 to 64 can vary from the values of the sequence in
numbers 65 to 128. Therefore one must display the same values from the sequence 1 to 64 in the
sequence 65 to 128, in order to do this one must create dummy variables wherein the original values of
the multiplier and the seed can be stored, because the original multiplier and seed always changes
values with each element on the sequence. In converting the sequence to binary the mean of all the
values should be computed and if compared to each element if the given element is less than the mean
then that element should be given the value of 0 but if it is greater than the mean then it should be
given a value of 1.

You might also like