Professional Documents
Culture Documents
Machine Problem
Machine Problem
caylcedric.ronquillo.eng@ust.edu.ph 3
Abstract— The purpose of this paper is to feature the subject profession as it enables them to understand random phenomena
matters in the course, MATH 301: Probability Theory and and effectively predict or control them despite the complexity
Random Processes namely, Probability Mass/Density of these situations.
Function, Cumulative Distribution Function, Laplace The union of these two has become the core for any scientific
Random Variable, and Gaussian Random Variable. A and engineering project. Without probability and statistics
machine problem was made with the aid of Matrix projects done will not be consistent and trustworthy opposite to
Laboratory to emphasize, visualize, and highlight the what it should be.
significance of the said course via a script and a function file This machine problem covers the probability mass/density
that yields the output required. function, cumulative distribution function, Laplace random
variable, and Gaussian random variable and the underlying
Index Terms—Probability Mass/Density Function, concepts behind it are the main content. Explanations and
Cumulative Distribution Function, Laplace Random concepts of the theories mentioned will be discussed in the
Variable, Gaussian Random Variable. latter part of the paper (II. Theory).
For this machine problem, a programming language,
MATLAB or Matrix Laboratory, is to be used. This
I. INTRODUCTION programming environment has functions and programs that
In the field of science and engineering, factors like quantities could help in creating and performing tasks such as computing,
and probabilities are very vital when it comes data gathering. A plotting graphical representations and several others concerning
data, may it be descriptive or quantitative, small-scale or large- functions. This programming environment aids the need for this
scale, are significant specifically in Electronics Engineering. machine problem which is composed of probability
Probability and Statistics are good examples that describe the mass/density function, cumulative distribution function,
Communications track. Laplace random variable, and Gaussian random variable.
In a wide context, Probability theory is basically the study of This machine problem requires knowledge and
random phenomena in which the result varies as it produces comprehension in relation with the topics mentioned earlier. It
outcomes that are formed by essential patterns behind. The aims to further develop the students’ analytical skills, critical
mathematics of probability is made to describe certain thinking and discernment when it comes to complex situations
situations wherein one can’t reproduce the product created by in these subject matters
just repeating the procedures done. Even with the same process
different trials yields to different results which causes the need II. THEORY
for a probability theory that copes up the irregularity of the Random Variable
outcome by observing the system behind. A random variable is a real-valued function which consists
Meanwhile, Statistics deals with the collection, processing, of an experiment with a probability measure defined on a sample
analysis, and interpretation of numerical data that comes crucial space S and assigns a real number to each outcome in the sample
in every aspect of engineering. Statistics plays a major role in space of the experiment. Random variables have two
all branches of engineering specifically electronics engineering classifications, discrete and continuous. It is called discrete
which can be more effective if research, development, and when its range is finite or countably infinite. It is continuous
production are aligned with a substantial data. These numerical when it can take an uncountable infinite number.
data provided by statistical approach are mainly the basis of the
movements to be selected for almost the entire process.
Statistics has become the support of engineers throughout their
Probability Mass Function Erlang Distribution
The Probability Mass Function (PMF) is a probability The Erlang distribution was initially developed by A.K. Erlang
measure that gives probabilities that a random variable can take. to examine the number of telephone calls which might be made
It is written as: at the same time. This distribution is the continuous distribution
of the sum of k independent and identically distributed random
variables each having an exponential distribution. Defined with
positive integers, its PDF is given by
𝒅𝑭𝑿 (𝒙)
𝒇𝑿 (𝒙) =
𝒅𝒙
𝒏
𝑷𝑿 (𝒙) = ( ) (𝒑)𝒙 (𝟏 − 𝒑)(𝒏−𝒙)
𝒙
Fig. 5 Definition of Probability Density Function. [5]
∞
𝑬(𝒙) = ∫ 𝒙𝒇(𝒙)𝐝𝐱
−∞
𝒏 − 𝟏 (𝒑)𝒙−𝟏
𝑷𝑿 (𝒙) = ( ) (𝟏 − 𝒑)(𝒏−𝒙) 𝑬(𝒙) = ∑ 𝒙𝒊 𝑷 (𝒙𝒊 )
𝒙−𝟏
Gaussian Distribution
The Gaussian distribution, commonly known as normal
distribution or the bell-shaped curve, is a continuous function
Fig. 10 Argument with Mean and Variance
in probability theory which approximates the exact binomial
distribution of events.
Fig. 11 Plot of the PMF and CDF of the Binomial distribution
Fig. 13 Plot of the PMF and CDF of the Pascal distribution
Second is the pascal distribution which has the formula
Third and last distribution is the Erlang which has the
mentioned in Fig. 5. The Pascal (k, p) random variable’s “p” is
following formula mentioned in Fig. 3. The Erlang (n, ƛ)
also less than 1 and greater than 0 where its “k” is always
random variable’s “p” is still less than 1 and greater than 0
greater than or equal to 1. A switch function was also used for
where its lambda is greater than 0 and its n is greater than or
this distribution and its error detection only covers incorrect
equal to 1. A switch function was also used for this distribution
parameter inputs unlike the binomial distribution which needs
and its error detection only covers incorrect parameter inputs
the param(1) and range(2) to be equal. If this condition is met
similar in Pascal distribution. If this condition is met by the user
by the user the program will now start and read the coded
the program will now start and read the coded formula for its
formula for Pascal’s PMF. Its CDF will also be read like how
PDF and CDF. An example of an argument including its mean,
the CDF of Binomial distribution works. An example of an
variance, and plot are shown in figures 9 and 10, respectively:
argument including its mean, variance, and plot are shown in
figures 6 and 7, respectively:
𝑎 −𝑎|𝑥−𝑏|
𝑓𝑋 (𝑥) = 𝑒
2 𝑋 =( ∑12
𝑖=1 𝑈𝑖 ) – 6
Fig. 19 The formula of the CDF of the Gaussian (0,1) random variable
Fig. 17 Output plot for Machine Problem no. 2. To do this, the P[X=x] of the Central Limit Theorem
equation is needed, as well as the CDF and PDF of the Gaussian
The second part of the machine problem asks to generate 10,000 (0,1) random variable. P[X=x] is taken by using the histogram
samples using the rand( ) function and estimate its mean and command. The histogram command takes the vector X and gets
variance. To be able to execute the required task, the student the normalization pdf of the said vector. The CDF of the
created an algorithm that makes use of the rand( ) function to Gaussian (0,1) random variable is taken by using a for loop and
generate an array of 10,000 random numbers. After creating the using the equation of the CDF of the Gaussian (0,1) random
array, the min and max values were obtained using the variable seen in Figure 5.
respective MATLAB functions min( ) and max( ). These values
are to be the limits to obtain the mean and the variance. The
mean is then calculated by using the formula for continuous
random variables as mentioned in Fig. 5. Then after getting the
mean, the variance was also acquired by using the formula
mentioned in Fig. 6.
Fig. 20 The formula of the PMF of the Gaussian (0,1) random variable
The PMF of the Gaussian (0,1) random variable is taken by VII. REFERENCES
using the equation of the PDF of the Gaussian Random Variable [1] Hossein Pishro-Nik. Probability Mass Function [Online]. Available:
found in Figure 6. All these four results are plotted by subplot https://www.probabilitycourse.com/chapter3/3_1_3_pmf.php
for comparison. [2] Nist Sematech. Binomial Distribution [Online]. Available:
https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm
[3] Hossein Pishro-Nik. Special Distributions [Online]. Available:
https://www.probabilitycourse.com/chapter3/3_1_5_special_discrete_distr.php
Fig. 21 The graphs of the Central Limit Theorem equation and the
Gaussian (0,1) random variable equation
VIII. DISTRIBUTION OF TASK
VI. CONCLUSION 1. Mendoza – Coding and Documentation for Problem 2,
The focus of this machine problem is to improve the Theory, References
students’ analytical skills relating MATH 301: Probability 2. Ronquillo – Coding and Documentation for Problem 1,
Theory and Random Processes to technical computing. Matrix Abstract, Introduction
Laboratory serves as a prototype of the students’ vision and 3. Petilla – Coding and Documentation for Problem 3,
understanding regarding the course. Obviously, it would help the Conclusion
students’ critical thinking especially in this subject matter but
what’s behind that is that through this machine problem,
students will be more likely to be creative and resourceful. This
means that through this machine problem, students’ are trained
for the outside world specifically having a job. When the time
comes one has a job, resources will not always be readily
available. There will always be something that’s missing, that’s
the job of engineers, to create something out of nothing. Relating
that to this machine problem is that in this paper, students are
required to follow the prescribed format set by the professor. An
Engineer can’t construct or good to say that should not construct
a gadget, building or other significant things in the society
without a neat plan. Residing to a concrete plan is a must when
it comes to safety. With the aid of this computing environment,
students will be able to think and widen their perspective when
it comes to coding. Further analyzation will be implemented for
the program to work. This relation of Math 301 with Matrix
Laboratory will truly show how a Thomasian Electronics
Engineering student analyzes situations deeply.
Each of the three given problems has their own uniqueness to
further improve critical thinking and comprehension.
Documenting the machine problems serves as a guide and
background to the readers. The students explained the topics
well by basing it to the theories and facts. All outputs required
are obtained and the students have improved their writing skills
by cautiously following the prescribed format.
Appendix
Problem 1: Create a function file that plots the probability mass/density function and the cumulative
distribution function of the following random variables.
end
end
Problem 2: Create a script file that plots the probability density function and the cumulative distribution function
of a Laplace (𝒂 = 𝟑,𝒃 = 𝟐) random variable. Using 10,000 samples from rand(), estimate its mean and variance.
%Laplace(3,2)
clc;
clear;
x=10;
y=x;
a=3;
b=2;
z=0;
m=0;
for x=-x:0.01:y
z=z+1;
L(z)=(a/2)*exp(-a*abs(x-b));
end
x=y;
z=0;
for x=-x:0.01:y
z=z+1;
F(z)=integral(@(x) (a/2)*exp(-a*abs(x-b)) ,-Inf,x);
end
subplot(1,2,1)
plot(-y:0.01:y,L,'linewidth',2)
grid on
subplot(1,2,2)
plot(-y:0.01:y,F,'linewidth',2)
grid on
xrand=rand(10000,1);
xmin=min(xrand)*10000;
xmax=max(xrand)*10000;
x=xmin:0.0001:xmax;
Problem 3: a. Create a script file that generates 15,000 samples of the random variable 𝑋.
b. Based from the samples, solve for 𝑃[𝑋 ≤ 𝑥] for 𝑥 = −4,−3,…,3,4.
c. Repeat the previous problem when 𝑋 is a Gaussian (0, 1) random variable and compare the results
clc
clear
%Setting up 15 000 samples of random variable X
for j=1:1:15000
Ui = rand(1,12);
X(j) = sum(Ui) - 6;
end
%Computations for CDF of Central Limit Theorem
h=1;
for j=-4:0.1:4
k=0;
for l=1:1:15000
if (X(l) <= j)
k=k+1;
end
end
Y(h)=k;
Z(h)=j;
h=h+1;
end
for i=1:1:81
if Y(i) > 0
P(i) = Y(i)/15000;
else
P(i) = 0;
end
end
%Plotting CDF of Central Limit Theorem
subplot(2,2,1)
plot(Z,P)
title('Central Limit Theorem')
xlabel('x')
ylabel('P[X<=x]')