Earlier today, I took a practice exam for the CISA. The exam was 20 questions, with 4 questions for each of the 5 domains.

Out of the 20 questions, I answered 17 correct, not missing more than 1 in any of the 5 domains.

Below is the code to produce a Monte Carlo Simulation for a distribution of outcomes for taking the actual 150 question test as of today.We are assuming a normal distribution of outcomes.

Let’s load in the libraries

library(ggplot2)

Now let’s load in the assumptions, based on the quiz performance

totalQuestions <- 150
correctAnswers <- 17
totalQuizQuestions <- 20
simulations <- 10000
passingScore <- 80 # Passing score threshold

Calculate the probability of answering a question correctly

probCorrect <- correctAnswers / totalQuizQuestions

Number of Monte Carlo Simulations, and settings

set.seed(128) # For reproducibility
simulationOutcomes <- rbinom(n = simulations, size = totalQuestions, prob = probCorrect) / totalQuestions * 100

Calculate the average score and percentiles

averageScore <- mean(simulationOutcomes)
percentiles <- quantile(simulationOutcomes, probs = c(0.05, 0.25, 0.5, 0.75, 0.95))
outcomes <- ifelse(simulationOutcomes >= passingScore, "Pass", "Fail")
outcomeCounts <- table(outcomes)

Now let’s print the results:

cat("Average Score:", averageScore, "\n")
Average Score: 85.05193 
cat("Percentiles:\n")
Percentiles:
print(percentiles)
      5%      25%      50%      75%      95% 
80.00000 83.33333 85.33333 87.33333 90.00000 

Optionally, visualize the distribution of scores

library(ggrepel)
# Create a data frame for plotting
simulationData <- data.frame(Score = simulationOutcomes, Outcome = outcomes)

# Aggregate to calculate counts for pass and fail
aggData <- aggregate(Score ~ Outcome, data = simulationData, FUN = length)
textData <- data.frame(x = c(70, 100), y = c(max(table(simulationOutcomes)) * 0.8, max(table(simulationOutcomes)) * 0.8), Outcome = c(paste("Fail:", outcomeCounts["Fail"]), paste("Pass:", outcomeCounts["Pass"])))

# Plot with adjusted text labels using geom_text_repel
ggplot(simulationData, aes(x = Score, fill = Outcome)) +
  geom_histogram(binwidth = 1, alpha = 0.7, position = "identity") +
  scale_fill_manual(values = c("Pass" = "blue", "Fail" = "red")) +
  labs(title = "Distribution of CISA Exam Scores for James based on Quiz Result", subtitle = paste("Average Score:", round(averageScore, 2), "%"), x = "Score (%)", y = "Frequency") +
  geom_text_repel(data = textData, aes(x = x, y = y, label = Outcome), color = "black", size = 5, box.padding = 0.1, point.padding = 0.1) +
  theme_minimal()

LS0tDQp0aXRsZTogTW9udGUgQ2FybG8gU2ltDQpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sNCi0tLQ0KDQpFYXJsaWVyIHRvZGF5LCBJIHRvb2sgYSBwcmFjdGljZSBleGFtIGZvciB0aGUgQ0lTQS4gVGhlIGV4YW0gd2FzIDIwIHF1ZXN0aW9ucywgd2l0aCA0IHF1ZXN0aW9ucyBmb3IgZWFjaCBvZiB0aGUgNSBkb21haW5zLg0KDQpPdXQgb2YgdGhlIDIwIHF1ZXN0aW9ucywgSSBhbnN3ZXJlZCAxNyBjb3JyZWN0LCBub3QgbWlzc2luZyBtb3JlIHRoYW4gMSBpbiBhbnkgb2YgdGhlIDUgZG9tYWlucy4gDQoNCkJlbG93IGlzIHRoZSBjb2RlIHRvIHByb2R1Y2UgYSBNb250ZSBDYXJsbyBTaW11bGF0aW9uIGZvciBhIGRpc3RyaWJ1dGlvbiBvZiBvdXRjb21lcyBmb3IgdGFraW5nIHRoZSBhY3R1YWwgMTUwIHF1ZXN0aW9uIHRlc3QgYXMgb2YgdG9kYXkuV2UgYXJlIGFzc3VtaW5nIGEgbm9ybWFsIGRpc3RyaWJ1dGlvbiBvZiBvdXRjb21lcy4gDQoNCg0KTGV0J3MgbG9hZCBpbiB0aGUgbGlicmFyaWVzDQpgYGB7cn0NCmxpYnJhcnkoZ2dwbG90MikNCmBgYA0KDQpOb3cgbGV0J3MgbG9hZCBpbiB0aGUgYXNzdW1wdGlvbnMsIGJhc2VkIG9uIHRoZSBxdWl6IHBlcmZvcm1hbmNlDQpgYGB7cn0NCnRvdGFsUXVlc3Rpb25zIDwtIDE1MA0KY29ycmVjdEFuc3dlcnMgPC0gMTcNCnRvdGFsUXVpelF1ZXN0aW9ucyA8LSAyMA0Kc2ltdWxhdGlv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