0% found this document useful (0 votes)
18 views

Mathsassignment

Uploaded by

Venom X
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Mathsassignment

Uploaded by

Venom X
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

MANGALORE INSTITUTE OF TECHNOLOGY & ENGINEERING

Accredited by NAAC with A+ Grade, An ISO 9001: 2015 Certified Institution


(A Unit of Rajalaxmi Education Trust®, Mangalore - 575001)
Autonomous Institution Affiliated to V.T.U., Belagavi, Approved by AICTE, New Delhi

Academic year 2022-23

ASSIGNMENT – 2

Course title : Mathematical Foundations for Computing,


Probability & Statistics.
Course code : 21MATCS41.

Submitted To:
Mr. Sathvik S Nayak
Assistant Professor,
Department of Mathematics.

Submitted From:
Jataniya Mihir P.
4MT21CS058

Date of submission: 19-08-2023


Q1. Discrete Probability Distribution (Poisson-distribution)
A) Introduction to the Real-Life Problem:
Amidst the current recession, the IT industry grapples with a pressing concern –
employee layoffs. Financial constraints and cost-cutting measures have led to the
need for workforce reductions. As part of the HR department, your task is to
analyse the occurrence of layoffs per week, providing insights into the impact of
the recession on the workforce.
Unveiling the Challenge: In an era of economic uncertainty, where the tech
sector's stability is shaken, employee layoffs emerge as a significant predicament.
Your role in human resources places you at the forefront of this issue, tasked with
deciphering the frequency of layoffs within a weekly timeframe. This necessitates
the application of the Poisson distribution, a mathematical approach tailored to
capture the rarity and randomness of such events.
Scenario: analysing the occurrence of employee layoffs per week during an IT
industry recession. The mean rate of employee layoffs is 3. (I) find the
probability of having at most 2 employee layoffs in a week. (II) Find the
probability of having at most 5 employee layoffs in a week.

B) Justification of my choice for this problem:


The Poisson distribution is chosen because it is suitable for modelling the
frequency of rare and independent events, such as employee layoffs, occurring
within fixed time intervals, which aligns with the context of analysing weekly
layoffs during a recession. In practical terms, the discrete nature of count data,
which the Poisson distribution models, is well-suited for quantifying the number
of employee layoffs that occur in a given week. This makes it a valuable tool for
HR departments aiming to gain insights into the impact of the recession on
workforce dynamics, enabling them to make informed decisions based on the
analysis. The assumption of a constant average rate of occurrence over the short
time frame of a week is reasonable given the nature of cost-cutting measures and
financial constraints driving layoffs. This makes the Poisson distribution a
justifiable choice for studying the impact of the recession on workforce
reductions.
Advantages of using the Poisson distribution in this IT industry scenario:
1. It accurately models the count of rare events (layoffs) in a given time
interval.
2. The distribution allows for real-time monitoring of layoffs, providing
immediate feedback on the impact of cost-cutting measures.
3. The Poisson distribution provides a clear framework for predicting the
expected number of employee layoffs, enabling proactive decision-making
and planning.
4. Its simplicity makes it suitable for analysing events in uncertain economic
conditions.
5. Requires only one parameter (λ) to describe the distribution.
C) Manual Solution of the Problem:
(I) find the probability of having at most 2 employee layoffs in a week (x≤2).
Solution:
Using the Poisson distribution formula:
𝑒 −𝜇 ∗ 𝜇𝑥
P(X = x) =
𝑥!
Given 𝜇 = 3:
P(X ≤ 2) = P(X = 0) + P(X = 1) + P(X = 2) =

𝑒 −3 ∗ 30 𝑒 −3 ∗ 31 𝑒 −3 ∗ 32
+ + ≈ 0.423
0! 1! 2!
Therefore, the probability of having at most 2 employee layoffs in a week is
approximately 0.4232.
(II) Find the probability of having at most 4 employee layoffs in a week.
P(X ≤ 5) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4) =
𝑒 −3 ∗ 30 𝑒 −3 ∗ 31 𝑒 −3 ∗ 32 𝑒 −3 ∗ 33 𝑒 −3 ∗ 34 𝑒 −3 ∗ 35
= + + + + +
0! 1! 2! 3! 4! 5!
≈ 0.9161
Therefore, the probability of having at most 5 employee layoffs in a week is
approximately 0.9161
D) MATLAB CODE & GRAPHS:
lambda = 3; % Average rate of employee layoffs per week
x = 0:10; % Range of values for x
% Calculate PMF and CDF
pmf = (exp(-lambda) * lambda.^x) ./ factorial(x);
cdf = cumsum(pmf);
% Calculate specific probabilities
prob_at_most_2 = cdf(2+1); % P(X <= 2)
prob_at_most_5 = cdf(5+1); % P(X <= 5)
prob_at_most_8 = cdf(8+1); % P(X <= 8)
% Plot PMF with grid
figure;
stem(x, pmf, 'b', 'LineWidth', 2);
xlabel('Number of Employee Layoffs (x)');
ylabel('P(X = x)');
title('Poisson Distribution PMF for Employee Layoffs');
grid on;
% Plot CDF with grid
figure;
stairs(x, cdf, 'r', 'LineWidth', 2);
xlabel('Number of Employee Layoffs (x)');
ylabel('P(X ≤ x)');
title('Poisson Distribution CDF for Employee Layoffs');
grid on;
fprintf('The probability that at most 2 layoffs occur is: %.4f\n', prob_at_most_2);
fprintf('The probability that at most 5 layoffs occur is: %.4f\n', prob_at_most_5);
fprintf('The probability that at most 8 layoffs occur is: %.4f\n', prob_at_most_8);
OUTPUT:

Probability mass function Graph:

Cumulative distribution function Graph:


E) References:
1. https://chat.openai.com/share/2a3107a1-9e93-4c01-91cb-8a2263a167b8
2. https://www.cirrelt.ca/documentstravail/cirrelt-2007-15.pdf
3. https://www.geeksforgeeks.org/poisson-distribution-formula/
Q2. Continuous Probability Distribution (Normal distribution)
A) Introduction to the Real-Life Problem:
In the realm of digital interfaces, optimizing User Experience (UX) through
Usability Testing is vital. Picture a team improving an e-commerce website's
shopping journey. Usability Testing helps uncover user interaction challenges,
while the normal distribution aids in analysing time spent on key actions, like
product searches. By examining this data, designers can predict common user
behaviour, fine-tune the interface, and create smoother shopping experiences.
The normal distribution's advantages, such as modelling variability and central
tendency, allow the team to identify user preferences, enhance navigation, and
tailor the platform to meet diverse customer needs. As a result, the e-commerce
site becomes more intuitive, efficient, and appealing, illustrating the powerful
impact of combining UX principles with statistical insights from the normal
distribution.
Scenario: consider a hypothetical scenario where a UX team is conducting
usability testing for a new e-commerce website. They are interested in analysing
the time users spend searching for and adding items to their shopping carts. The
team collects data from a sample of users and finds that the mean time spent is 45
seconds, with a standard deviation of 10 seconds. 1) Find the probability that a
randomly selected user will spend between 35 and 55 seconds on these actions.
2) Find the probability that a randomly selected user will spend between 15 and
25 seconds on these actions.
B) Justification of my choice for this problem:
The normal distribution is chosen for its ability to effectively model and analyze
the distribution of user interaction times, such as time spent on product searches,
during Usability Testing. Its appropriateness lies in its common usage in various
real-world scenarios and its well-established statistical properties. By leveraging
the normal distribution, the team can gain insights into the typical and potential
variation in user behaviour, allowing for informed decision-making and
optimization of the e-commerce website's User Experience. Furthermore, normal
distribution's symmetric and bell-shaped curve allows for quick identification of
central tendencies and deviations from the average. This characteristic is
particularly valuable in identifying typical user behaviour, potential outliers, and
understanding the spread of interaction times. Such insights enable the team to
focus their efforts on enhancing the website's features where they are needed the
most.
Advantages of Using the Normal Distribution for UX and Usability Testing:
1. Accurate Representation: Normal distribution mirrors real-world user
behaviour patterns effectively.
2. Usability Benchmark: Deviations highlight potential usability issues or
exceptional experiences.
3. Statistical Credibility: Well-defined properties enhance data-driven
decision-making.
4. Tailored Design: Design adjustments align with user behaviour
patterns.
5. Effective Communication: Common language for interdisciplinary
team collaboration.
6. Enhanced Experience: Resultant designs are more intuitive and user-
centric.

C) Manual Solution of the Problem:


1) find the probability that a randomly selected user will spend between 35 and
55 seconds on these actions.
The z-score formula is given by: z= (x−μ)/ σ
 x is the specific value (e.g., interaction time) you want to standardize
 μ is the mean of the distribution.
 σ is the standard deviation of the distribution.
Calculate Z-scores:
For x = 35, z = (35−45)/ 10 = -1.0
For x = 55, z = (55–45)/ 10 = 1.0
Use a standard normal distribution table or calculator to find the cumulative
probabilities:
The cumulative probability for z = -1.0 is approximately 0.1587
The cumulative probability for z = 1.0 is approximately 0.8413
The probability that a randomly selected user will spend between 35 and 55
seconds is the difference between these cumulative probabilities:
P(35 ≤ x ≤ 55 ) = 0.8413 – 0.1587 = 0.6827
The probability that a randomly selected user will spend between 35 and 55
seconds is approximately 0.6827
2) Find the probability that a randomly selected user will spend between 15 and
25 seconds on these actions.
Calculate Z-scores:
For x = 15, z = (15−45)/ 10 = -3.0
For x = 25, z = (25–45)/ 10 = -2.0
Use a standard normal distribution table or calculator to find the cumulative
probabilities:
The cumulative probability for z = -3.0 is approximately 0.0013
The cumulative probability for z = -2.0 is approximately 0.0228
The probability that a randomly selected user will spend between 15 and 25
seconds is the difference between these cumulative probabilities:
P(15 ≤ x ≤ 25 ) = 0.0228 – 0.0013= 0.0214

The probability that a randomly selected user will spend between 15 and 25
seconds is approximately 0.0214
D) MATLAB CODE & GRAPHS:
mu = 45; sigma = 10;
x = linspace(mu - 4*sigma, mu + 4*sigma, 1000);
pdf = normpdf(x, mu, sigma);
cdf = normcdf(x, mu, sigma);
% Specify the lower and upper bounds for the probability calculation
lower_bound = 15; % Set your desired lower bound
upper_bound = 25; % Set your desired upper bound
% Calculate the probability for the specified range
prob_between = normcdf(upper_bound, mu, sigma) - normcdf(lower_bound, mu,
sigma);
% Print the calculated probability using fprintf
fprintf('Probability that user spends between %d and %d seconds: %.4f\n',
lower_bound, upper_bound, prob_between);
% Plot PDF in Figure 1
figure;
plot(x, pdf);
title('PDF - User Interaction Time');
xlabel('Time (seconds)');
ylabel('Probability Density');
grid on;
% Plot CDF in Figure 2
figure;
plot(x, cdf);
title('CDF - User Interaction Time');
xlabel('Time (seconds)');
ylabel('Cumulative Probability');
grid on;
OUTPUT :

Probability density function Graph:

Cumulative distribution function Graph:


E) References:
1. https://chat.openai.com/share/76a978cd-e852-4c87-880b-4ec41a1beffe
2. https://byjus.com/maths/normal-distribution/

You might also like