๐ Scenario: You are part of a project team planning a new software product. To manage risks effectively, you need to list potential risks, assign their probability and impact scores, and then identify which risks need urgent attention.
๐ฏ Goal: Build a simple risk analysis table that shows each risk with its probability and impact scores, and then filter out the high-risk items that need immediate focus.
๐ What You'll Learn
Create a dictionary called risks with exactly these entries: 'Data loss': 0.3, 'Security breach': 0.6, 'Performance lag': 0.4, 'User error': 0.2, 'Hardware failure': 0.5
Create a dictionary called impact with exactly these entries: 'Data loss': 9, 'Security breach': 10, 'Performance lag': 6, 'User error': 3, 'Hardware failure': 7
Create a variable called threshold and set it to 4.0
Create a dictionary called high_risks that includes only risks where the product of probability and impact is greater than threshold
๐ก Why This Matters
๐ Real World
Risk analysis helps project teams focus on the most critical risks that could affect project success.
๐ผ Career
Understanding how to quantify and filter risks is essential for project managers, software engineers, and quality assurance professionals.
Progress0 / 4 steps
1
Set up the risk probabilities dictionary
Create a dictionary called risks with these exact entries: 'Data loss': 0.3, 'Security breach': 0.6, 'Performance lag': 0.4, 'User error': 0.2, 'Hardware failure': 0.5
Software Engineering
Hint
Use curly braces {} to create the dictionary with the exact keys and values.
2
Set up the impact scores dictionary
Create a dictionary called impact with these exact entries: 'Data loss': 9, 'Security breach': 10, 'Performance lag': 6, 'User error': 3, 'Hardware failure': 7
Software Engineering
Hint
Use a dictionary to map each risk to its impact score exactly as given.
3
Set the risk threshold value
Create a variable called threshold and set it to the float value 4.0
Software Engineering
Hint
Just assign the number 4.0 to the variable named threshold.
4
Identify high-risk items
Create a dictionary called high_risks that includes only the risks where the product of probability from risks and impact from impact is greater than threshold. Use a dictionary comprehension with variables risk and prob iterating over risks.items().
Software Engineering
Hint
Use a dictionary comprehension to filter risks where probability times impact is greater than threshold.
Practice
(1/5)
1. What does risk analysis in software engineering primarily combine?
easy
A. The programming language and the software framework
B. The cost of the project and the team size
C. The number of developers and the project deadline
D. The likelihood of a problem and its potential impact
Solution
Step 1: Understand risk analysis components
Risk analysis involves assessing how likely a problem is and how severe its consequences could be.
Step 2: Identify what is combined
The two main factors combined are probability (likelihood) and impact (severity).
Final Answer:
The likelihood of a problem and its potential impact -> Option D
Quick Check:
Risk = Probability x Impact [OK]
Hint: Risk = chance of problem x how bad it is [OK]
Common Mistakes:
Confusing risk with project cost
Mixing team size with risk factors
Thinking risk depends on programming language
2. Which formula correctly calculates the risk score in risk analysis?
easy
A. Risk score = Probability - Impact
B. Risk score = Probability + Impact
C. Risk score = Probability x Impact
D. Risk score = Impact รท Probability
Solution
Step 1: Recall risk score calculation
The risk score is calculated by multiplying the probability of an event by its impact.
Step 2: Evaluate each formula
Addition, subtraction, or division do not correctly represent risk score calculation.
Final Answer:
Risk score = Probability x Impact -> Option C
Quick Check:
Risk score uses multiplication [OK]
Hint: Multiply chance and impact for risk score [OK]
Common Mistakes:
Adding probability and impact instead of multiplying
Dividing impact by probability
Subtracting values instead of combining
3. Given a risk with probability 0.3 and impact 8, what is the risk score?
medium
A. 8.3
B. 2.4
C. 0.375
D. 24
Solution
Step 1: Identify given values
Probability = 0.3, Impact = 8.
Step 2: Calculate risk score by multiplying
Risk score = 0.3 x 8 = 2.4.
Final Answer:
2.4 -> Option B
Quick Check:
0.3 x 8 = 2.4 [OK]
Hint: Multiply probability and impact numbers [OK]
Common Mistakes:
Adding instead of multiplying
Multiplying in reverse order but miscalculating
Confusing decimal multiplication
4. A project manager calculates risk score as Probability + Impact instead of Probability x Impact. What is the main error?
medium
A. Using addition instead of multiplication for risk score
B. Ignoring the impact value
C. Using probability as a percentage
D. Calculating risk score twice
Solution
Step 1: Identify the calculation mistake
The manager added probability and impact instead of multiplying them.
Step 2: Understand correct risk score formula
Risk score must be calculated by multiplying probability and impact to reflect combined effect.
Final Answer:
Using addition instead of multiplication for risk score -> Option A
Quick Check:
Risk score = Probability x Impact, not addition [OK]
Hint: Risk score needs multiplication, not addition [OK]
Common Mistakes:
Adding values instead of multiplying
Forgetting to include impact
Misinterpreting probability scale
5. A software project has three risks with these values: Risk A (0.2, 10), Risk B (0.5, 3), Risk C (0.1, 15). Which risk should be prioritized based on risk score?
hard
A. Risk A
B. Risk B
C. Risk C
D. All have equal priority
Solution
Step 1: Calculate risk scores for each risk
Risk A: 0.2 x 10 = 2.0 Risk B: 0.5 x 3 = 1.5 Risk C: 0.1 x 15 = 1.5
Step 2: Compare risk scores to prioritize
Risk A has the highest score of 2.0.
Final Answer:
Risk A -> Option A
Quick Check:
Risk A score = 2.0 > others [OK]
Hint: Pick risk with highest score [OK]
Common Mistakes:
Choosing risk with highest probability only
Choosing risk with highest impact only
Assuming all risks have equal priority
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.