NEW
Font size
WorksheetsMathematics and Machine Learning Quiz
Total questions: 60
Worksheet time: 30mins
The expected value of a discrete random variable X is:
∑xᵢ²P(xᵢ)
∑xᵢP(xᵢ)
∑P(xᵢ)²
∑xᵢ/P(xᵢ)
If X ~ Bernoulli(p), the variance is:
p
p(1-p)
p²
√(p(1-p))
The mean and variance of X ~ N(μ, σ²) are:
(0,1)
(1,1)
(μ,σ²)
(0,σ)
The probability P(|Z| > 1.96) with Z ~ N(0,1) is approximately:
0.025
0.05
0.1
0.95
In a hypothesis test with p-value = 0.08 and α = 0.05, the correct conclusion is:
Do not reject H0
Reject H0
Conclusion is unclear
Accept H1
A condition for using the t-distribution is:
Large sample > 100
Binary variable
Normal distribution with unknown variance
Skewed sample
The test statistic in ANOVA is:
Z-score
F-statistic
T-statistic
P-value
A standardized normal distribution has:
Mean = 1, SD = 1
Mean = 0, SD = 1
Mean = 1, SD = 0
Mean = 0, SD = 0
The MLE for the mean μ is:
Median
Sample mean
Sample variance
Mode
If X and Y are independent, then Cov(X, Y) =
E[X] + E[Y]
0
E[XY]
E[X²Y²]
The conditional probability P(A|B) is calculated as:
P(B)/P(A)
P(A ∩ B)/P(B)
P(A) + P(B)
P(A) * P(B)
Bias in a model refers to:
Difference between predicted mean and true value
Variance between model runs
Size of error
Standard error
The Law of Large Numbers states:
Sample mean is normally distributed
Sample mean converges to population mean
Variance becomes zero with large n
Sample sum converges to maximum value
Multicollinearity affects:
Dependent variable
Stability of regression estimates
Number of variables to normalize
Significance level
Chi-square test is used to test:
Mean difference between two groups
Observed vs expected frequencies
Linear correlation
Normal distribution
Probability density function (PDF) is:
Cumulative probability
Derivative of cumulative distribution function (CDF)
Sample mean
Maximum value
Convolution in probability is:
Product of two distributions
Distribution of sum of two independent variables
Maximum of two distributions
Average
A 95% confidence interval for μ means:
95% chance it contains μ
Exact value of μ
Interval always contains μ
Not related to distribution
A correct assumption in linear regression is:
Normal distribution of independent variables
Homoscedasticity of residuals
Outliers do not matter
Multicollinearity is required
Pearson correlation coefficient r lies in:
[-1, 0]
[0, 1]
[0, ∞)
[-1, 1]
In logistic regression, the log-odds is modeled as:
log(y)
1/(1+e^-z)
log((1-p)/p)
log(p/(1-p))
Overfitting occurs when the model:
Is not complex enough
Learns too little from data
Learns both signal and noise
Has high bias
Which algorithm does NOT rely on gradient descent?
Logistic Regression
K-Nearest Neighbors (KNN)
Neural Network
Linear Regression (Gradient)
Boosting works by:
Averaging multiple parallel models
Splitting data and training separately
Training sequentially focusing on previous errors
Selecting the best model
If the number of trees in Random Forest increases significantly:
Accuracy decreases
Overfitting worsens
Variance decreases, bias remains
Regularization increases
The main goal of PCA is to:
Predict target variable
Reduce dimensionality while preserving variance
Increase non-linearity
Identify latent labels
A model with AUC = 0.5 indicates:
Perfect model
High error
No class distinction (random)
Accuracy = 50%
Which activation function often causes vanishing gradient?
Sigmoid
ReLU
Leaky ReLU
Maxout
Which loss function is best for regression?
Cross Entropy
Mean Squared Error (MSE)
Hinge Loss
Binary Log-loss
The main purpose of dropout is to:
Speed up training
Turn off neurons randomly to prevent overfitting
Deepen the model
Remove outliers
Difference between Bagging and Boosting:
Bagging is sequential, Boosting is parallel
Boosting uses only tree models
Bagging reduces variance, Boosting reduces bias
Boosting doesn’t use voting
Gradient Descent converges slowly when:
Learning rate too large
Batch size too small
Loss surface is steep and flat (ill-conditioned)
Loss is convex
Which unsupervised algorithm does NOT require number of clusters?
K-means
Gaussian Mixture
DBSCAN
Agglomerative Clustering
Early stopping helps to:
Increase epochs
Prevent overfitting by stopping training early
Guarantee smallest train loss
Dynamically adjust learning rate
F1-score is:
Average of accuracy and precision
Arithmetic mean of precision and recall
Harmonic mean of precision and recall
Ratio of TP and FN
LSTM addresses which RNN limitation?
Overfitting
Gradient explosion
Vanishing gradient
Small batch size
A key property of L1 regularization is:
Makes deeper models
Feature selection
Reduces sample size
Reduces number of layers
Why normalize data in ML?
To reduce dimensions
To enhance model power
To avoid scale bias in distance/gradient
To reduce noise
Transformers avoid RNN because:
High memory
Can’t capture sequence
Self-attention is more efficient and parallelizable
Can’t be trained
Which algorithm supports both classification and regression?
Logistic Regression
Decision Tree
Naive Bayes
Perceptron
What does the 'attention' mechanism in Transformer models primarily compute?
Word frequency
Word order
Contextual relevance between tokens
Token embeddings
Which of the following best describes the role of the positional encoding in Transformers?
Normalize input embeddings
Improve model parallelism
Inject token order information into embeddings
Remove duplicated tokens
In a decoder-only transformer (e.g., GPT), which attention type is used?
Bidirectional attention
Encoder-decoder attention
Self-attention with full context
Causal (masked) self-attention
Which method allows an LLM to answer questions using external documents without retraining the model?
Fine-tuning
Distillation
Retrieval-Augmented Generation (RAG)
Prompt token compression
Which of the following is a limitation of instruction-tuned LLMs (e.g., GPT-style models)?
Cannot use pretrained embeddings
May hallucinate facts confidently
Unable to answer without GPU
Do not support token streaming
When you use 'few-shot prompting', what is being done?
Training the model with few gradient steps
Providing a few examples in the prompt to guide the response
Using low-resolution embeddings
Limiting the model’s depth
Which technique is used to compress or accelerate inference in large language models?
Prompt injection
Beam search
Quantization
Residual connections
Why is temperature used in LLM text generation?
Control model depth
Penalize repetitions
Control randomness in token sampling
Normalize logits
Which embedding type is best suited for semantic similarity tasks with LLMs?
Bag-of-words
One-hot
Sentence embeddings (e.g., using SBERT)
Token-level logits
What is the main role of the feed-forward network (FFN) in each Transformer block?
Normalize the attention output
Perform gradient clipping
Introduce non-linear transformation to enriched representation
Select the next token directly
What does `df.memory_usage(deep=True)` show?
Total number of rows
Size of numeric columns only
Memory usage of all columns including object internals
Index size only
Which technique best handles large CSVs that exceed memory capacity in Pandas?
pd.read_csv(file)
pd.read_json(file)
Use chunksize parameter in pd.read_csv
Convert to Excel first
What is the purpose of `df.eval('col1 + col2')` in Pandas?
Execute SQL query
Efficiently evaluate expressions on columns
Create lambda functions
Save the DataFrame
In SQL, what does `LAG(salary, 1) OVER (ORDER BY id)` do?
Returns maximum salary
Rank the salary
Returns previous row’s salary
Sum of 2 salaries
Which method is best to apply a custom ranking across grouped rows in Pandas?
df.rank()
df.groupby('group')['val'].rank()
df['val'].cumsum()
df.sort_values().reset_index()
What’s the fastest way to check if any value in a DataFrame is NaN?
df == np.nan
df.isnull().any()
df.isna().values.any()
df.isna().all()
Which function is preferred to aggregate multiple statistics per group in Pandas?
groupby().agg()
groupby().agg({'col1': ['mean','std'], 'col2': 'sum'})
groupby().describe()
groupby().cumsum()
What is the key feature of Arrow format in modern data pipelines?
JSON-friendly
Human-readable
Zero-copy data sharing across languages
Compressed text
Which Pandas method avoids explicit for-loops in conditional column creation?
df.append()
np.where(condition, A, B)
df.map()
df.merge()
Which SQL clause is equivalent to `np.percentile(col, 50)`?
MAX(col)
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY col)
MEDIAN(col)
NTILE(2)
