The "Project Risk Management" course transformed me from a passive observer of risk to a proactive risk management champion. Here are some key learnings that will forever change my approach to projects:
The Proactive Mindset: I transitioned from simply reacting to problems to anticipating and mitigating them. The course emphasized the importance of proactive risk identification through techniques like brainstorming, SWOT analysis, and FMEA (Failure Mode and Effect Analysis). This allows for early intervention and prevents minor issues from snowballing into major roadblocks.
Risk Assessment and Prioritization: I learned to assess the likelihood and impact of each identified risk. The course introduced qualitative and quantitative risk analysis methods, allowing me to prioritize risks based on their potential severity. This empowers me to focus resources on the most critical threats to project success.
Developing Response Strategies: The course equipped me with a toolbox of risk response strategies. I learned about risk avoidance, mitigation, transference, and acceptance strategies, allowing me to choose the most appropriate approach for each risk. For example, I can now advocate for additional training to mitigate a knowledge gap risk or build buffer time into the schedule to address potential delays.
Communication and Monitoring: The course highlighted the importance of clear communication regarding risks. I learned to effectively communicate risks to stakeholders, ensuring everyone is aware of potential challenges and mitigation plans. Additionally, I gained valuable insights into risk monitoring and tracking, allowing for continuous evaluation and adaptation as the project progresses.
In essence, "Project Risk Management" equipped me with the knowledge and tools to navigate the inevitable uncertainties of projects. By embracing a proactive approach, I can now lead projects with greater confidence, increasing the chances of achieving successful outcomes.
1. Time and Space Complexity
Designing an efficient algorithm for a program plays a crucial role
in a large scale computer system.
Time complexity and space complexity are the two most
important considerations for deciding the efficiency of an
algorithm.
The time complexity of an algorithm is the number of
instructions that it needs to run to completion.
The space complexity of an algorithm is the amount of
memory that it needs to run to completion.
The analysis of running time generally has received more
attention than memory because any program that uses huge
amounts of memory automatically requires a lot of time.
Eng. Abdulahi Time and Space Complexity
2. Time Complexity
In analyzing algorithm we will not consider the following
information although they are very important.
1 The machine we are executing on.
The machine language instruction
set.
The time required by each machine instruction
The translation, a compiler will make from the source to the
machine language.
2
3
4
The exact time we determine would no apply to many machines.
There would be the problem of the compiler which could vary
from machine to machine.
It is often difficult to get reliable timing figures because of clock
limitations and a multi-programming or time sharing
environment.
We will concentrate on developing only the frequency count for
all statements.
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 2/ 50
3. Time Complexity
1: x ← x + 1
1: for I ← 1 to n do
▷Frequency count is 1
▷Frequency count is n+1
▷Frequency count is n
2: x ← x + 1;
3: end for
1: for I ← 1 to n do ▷Frequency count is n+1
▷Frequency count is n(n+1)
▷Frequency count is n2
2: for J ← 1 to n do
3: x ← x + 1;
4: end for
5: end for
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 3/ 50
4. Space Complexity
The space needed by a program is the sum of the following components.
Fixed space requirement: The component refers to space
requirement that do not depend on the number and size of the
program’s inputs and outputs. The fixed requirements include the
instruction space (space needed to store the code), space for
simple variables, fixed size structured variable and
constants.
Variable space requirement: This component consists of the
space needed by structured variables whose size depends on the
particular instance i, of the problem being solved. It also includes
the additional space required when a function uses recursion.
The space requirement S(P) of an algorithm P may therefore be written
as S(P) = c + SP, where c and SP are the constant and instance
characteristics, respectively. First, we need to determine which
instance characteristics to use for a give problem to reduce the space
requirements.
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 4/ 50
5. Space Complexity
Algorithm 2 Square of the given Number
1: procedure GETSqUARE(n)
2: return n*n
3: end procedure
We can solve the problem without consuming any extra space,
hence the space complexity is constant.
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 5/ 50
6. Space Complexity
Algorithm 3 Sum of array elements
1: procedure CALCULAT E SUM(A,n)
2: sum ← 0
3: for i ← 0 to n −1 do
4: sum ← sum + A[i]
5: end for
6: end procedure
n, sum and i take constant sum of 3 units, but the variable A is an array,
it’s space consumption increases with the increase of input size n.
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 6/ 50
7. Basics
The main idea of asymptotic analysis is to have a measure of
efficiency of algorithms that doesn’t depend on machine
specific constants.
Asymptotic analysis of an algorithm refers to defining the
mathematical boundation/framing of its run-time
performance.
It doesn’t require algorithms to be implemented and time
taken by programs to be compared.
Asymptotic notations are mathematical tools to represent
time complexity of algorithms for asymptotic
analysis.
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 7/ 50
8. O (Big-Oh) notation
Big-Oh is used as a tight upper-bound on the growth of an
algorithm’s effort (this effort is described by the function f(n)).
Let f(n) and g(n) be functions that map positive integers to positive
real numbers. We say that f(n) is O(g(n)) or f(n) ∈O(g(n)), if
there exists a real constant c > 0 and there exists an integer constant
n0 ≥1 such that f(n) ≤cg(n) for every integer n ≥n0.
In other words O(g(n)) = {f(n): there exist positive constants c and
n0 such that 0 ≤f(n) ≤cg(n) for all n ≥n0}
Figure 2.2: f(n) ∈O(g(n))
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 8/ 50
9. O (Big-Oh) notation
Question1:Consider the function f(n) = 6n+ 135. Clearly. f(n) is non-
negative for all integers n ≥0. We wish to show that f(n)=O(n2).
According to the Big-oh definition, in order to show this we need to find
an integer n0, and a constant c > 0 such that for all integers, n ≥n0, f(n)
= c(n2)
Answer: Suppose we choose c = 1, and f(n) = cn2.
⇒ 6n+135 = cn2 = n2 [Since c = 1] n2-6n-135 = 0
⇒ (n-15)(n+9) = 0
Since (n+9) > 0 for all values n ≥0, we conclude that (n-15) = 0
0
⇒ n0 = 15 for c = 1 √
For c = 2, n = (6 + 1116)/4 ≈9.9
√
For c = 4, n0 = (6 + 2196)/8 ≈6.7
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 9/ 50
10. Ω (Big-Omega) notation
Big-Omega (Ω) is the tight lower bound notation.
Let f(n) and g(n) be functions that map positive integers to positive
real numbers. We say that f(n) is Ω(g(n)) or f(n) ∈Ω(g(n)) if there
exists a real constant c > 0 and there exists an integer constant n0 ≥
1 such that f(n) ≥cg(n) for every integer n ≥n0.
In other words Ω(g(n)) = {f(n): there exist positive constants c and
n0 such that 0 ≤cg(n) ≤f(n) for all n ≥n0}.
Figure 2.3: f(n) ∈Ω(g(n))
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 10/ 50
11. Ω (Big-Omega) notation
Question 2:Consider the function f(n)= 3n2-24n+72. Clearly f(n) is
non-negative for all integers n ≥0. We wish to show that f(n) = Ω(n2).
According to the big-omega definition, in order to show this weneed to
find an integer n0,and a constant c > 0 such that for all integers n = n0,
f(n) = cn2.
Answer: Suppose we choosc c = 1, Then f(n) = cn2
⇒ 3n2-24n+72 = n2
⇒ 2n2-24n+72 = 0
⇒ 2(n-6)2 = 0
Since (n-6)2 = 0, we conclude that n0 = 6.
So we have that for c = 1 and n ≥6, f(n) = cn2. Hence f(n) = Ω(n2).
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 11/ 50
12. θ (Theta) notation
Let f(n) and g(n) be functions that map positive integers to positive
real numbers. We say that f(n) is θ(g(n)) or f(n) ∈θ(g(n)) if and
only if f(n) ∈O(g(n)) and f(n) ∈Ω(g(n))
θ(g(n)) = {f(n): there exist positive constants c1, c2and n0 such
that 0 ≤c1g(n) ≤f(n) ≤c2g(n) for all n ≥n0}
Figure 2.6: f(n) ∈θ(g(n))
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 12/ 50
13. Types of Time Complexities
Time complexity usually depends on the size of the algorithm and
input.
The best-case time complexity of an algorithm is a measure of the
minimum time that the algorithm will require for an input of size n.
The worst-case time complexity of an algorithm is a measure of the
maximum time that the algorithm will require for an input of size n.
After knowing the worst-case time complexity, we can guarantee that
the algorithm will never take more than this time.
The time that an algorithm will require to execute a typical input
data of size n is known as average-case time complexity.
We can say that the value that is obtained by averaging the running
time of an algorithm for all possible inputs of size n can determine
average-case time complexity.
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 13/ 50
14. Rules for Complexity Analysis
Algorithm 4 Prefix-sum
1: procedure PREFIX-SUM(A,n)
2: for i ← n −1 to 0 do
sum ← 0
for j ← 0 to i do
sum ← sum + A[j]
end for
3:
4:
5:
6:
7: A[i] ← sum
8: end for
9: end procedure
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 14/ 50
15. Rules for Complexity Analysis
Table 3.3: Time Complexity calculation of Prefix-sum algorithm
Stateme
nt
Frequency Count Time
1 1 O(1)
2 n+1 O(n)
3 n O(n)
4 (n+1) + n + ....+ 2 O(n2)
5 n + (n-1) + ...+ 1 O(n2)
6 n + (n-1) + ...+ 1 O(n2)
7 n O(n)
8 n O(n)
9 1 O(1)
f(n) (n+1)(n+2)/2 + n(n+1) + 4n + 2 O(n2
)
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 15/ 50
16. Space Complexity Analysis
Example 1
In Algorithm 2, the variable noccupies a constant 4Bytes of
memory. The function call and return statement come under the
auxiliary space and let’s assume 4 Bytes all together.
The total space complexity is 8 Bytes. Algorithm 2 has a space
complexity of O(1).
Example 2
In Algorithm 3, the variables n, sum, and i occupy a constant 12
Bytes of memory. The function call, initialisation of the for loop
and write function all come under the auxiliary space and let’s
assume 4 Bytes all together.
The total space complexity is 4n + 16 Bytes. Algorithm 3 has a
space complexity of O(n).
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 16/ 50
17. Space Complexity Analysis
Algorithm 5 Factorial of a number
1: procedure FACTORIAL (n)
2: fact ← 1
3: for i ← 1 to n do
4: fact ← fact + i
5: end for
6: return fact
7: end procedure
The variables n, fact, and i occupy a constant 12 Bytes of memory. The
function call, initializingthe for loop and returnstatement all come
under the auxiliary space and let’s assume 4 Bytes all together.
The total space complexity is 16 Bytes. Algorithm 5 has a space
complexity of O(1).
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 17/ 50
18. Space Complexity Analysis
Algorithm 6 Recursive: Factorial of a number
1: procedure FACTORIAL (n)
2: if (n ≤1) then
3: return 1
4: else
5: return n ∗
FACTORIAL(n −1)
6: end if
7: end procedure
The variable n occupies a constant 4 Bytes of memory. The function
call, if and else conditions and return statement all come under the
auxiliary space and let’s assume 4 Bytes all together.
The total space complexity is 4n+4 Bytes. Algorithm 6 has a space
complexity of O(n).
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 18/ 50
19. Space Complexity Analysis
Algorithm 7 Summation of two numbers
1: procedure ADDITION(a, b)
2: c ← a+ b
3: write c
4: end procedure
The variables a, band c occupy a constant 12Bytes of memory. The
function call, if and else conditions and write function all come under
the auxiliary space and let’s assume 4 Bytes all together.
The total space complexity is 16 Bytes. Algorithm 7 has a space
complexity of O(1).
Dr. Ashutosh Satapathy Time and Space Complexity September 25, 2022 19/ 50