wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Mathematics and Machine Learning Quiz

Total questions: 60

Worksheet time: 30mins

Name
Class
Date
1.

The expected value of a discrete random variable X is:

a)

∑xᵢ²P(xᵢ)

b)

∑xᵢP(xᵢ)

c)

∑P(xᵢ)²

d)

∑xᵢ/P(xᵢ)

2.

If X ~ Bernoulli(p), the variance is:

a)

p

b)

p(1-p)

c)

d)

√(p(1-p))

3.

The mean and variance of X ~ N(μ, σ²) are:

a)

(0,1)

b)

(1,1)

c)

(μ,σ²)

d)

(0,σ)

4.

The probability P(|Z| > 1.96) with Z ~ N(0,1) is approximately:

a)

0.025

b)

0.05

c)

0.1

d)

0.95

5.

In a hypothesis test with p-value = 0.08 and α = 0.05, the correct conclusion is:

a)

Do not reject H0

b)

Reject H0

c)

Conclusion is unclear

d)

Accept H1

6.

A condition for using the t-distribution is:

a)

Large sample > 100

b)

Binary variable

c)

Normal distribution with unknown variance

d)

Skewed sample

7.

The test statistic in ANOVA is:

a)

Z-score

b)

F-statistic

c)

T-statistic

d)

P-value

8.

A standardized normal distribution has:

a)

Mean = 1, SD = 1

b)

Mean = 0, SD = 1

c)

Mean = 1, SD = 0

d)

Mean = 0, SD = 0

9.

The MLE for the mean μ is:

a)

Median

b)

Sample mean

c)

Sample variance

d)

Mode

10.

If X and Y are independent, then Cov(X, Y) =

a)

E[X] + E[Y]

b)

0

c)

E[XY]

d)

E[X²Y²]

11.

The conditional probability P(A|B) is calculated as:

a)

P(B)/P(A)

b)

P(A ∩ B)/P(B)

c)

P(A) + P(B)

d)

P(A) * P(B)

12.

Bias in a model refers to:

a)

Difference between predicted mean and true value

b)

Variance between model runs

c)

Size of error

d)

Standard error

13.

The Law of Large Numbers states:

a)

Sample mean is normally distributed

b)

Sample mean converges to population mean

c)

Variance becomes zero with large n

d)

Sample sum converges to maximum value

14.

Multicollinearity affects:

a)

Dependent variable

b)

Stability of regression estimates

c)

Number of variables to normalize

d)

Significance level

15.

Chi-square test is used to test:

a)

Mean difference between two groups

b)

Observed vs expected frequencies

c)

Linear correlation

d)

Normal distribution

16.

Probability density function (PDF) is:

a)

Cumulative probability

b)

Derivative of cumulative distribution function (CDF)

c)

Sample mean

d)

Maximum value

17.

Convolution in probability is:

a)

Product of two distributions

b)

Distribution of sum of two independent variables

c)

Maximum of two distributions

d)

Average

18.

A 95% confidence interval for μ means:

a)

95% chance it contains μ

b)

Exact value of μ

c)

Interval always contains μ

d)

Not related to distribution

19.

A correct assumption in linear regression is:

a)

Normal distribution of independent variables

b)

Homoscedasticity of residuals

c)

Outliers do not matter

d)

Multicollinearity is required

20.

Pearson correlation coefficient r lies in:

a)

[-1, 0]

b)

[0, 1]

c)

[0, ∞)

d)

[-1, 1]

21.

In logistic regression, the log-odds is modeled as:

a)

log(y)

b)

1/(1+e^-z)

c)

log((1-p)/p)

d)

log(p/(1-p))

22.

Overfitting occurs when the model:

a)

Is not complex enough

b)

Learns too little from data

c)

Learns both signal and noise

d)

Has high bias

23.

Which algorithm does NOT rely on gradient descent?

a)

Logistic Regression

b)

K-Nearest Neighbors (KNN)

c)

Neural Network

d)

Linear Regression (Gradient)

24.

Boosting works by:

a)

Averaging multiple parallel models

b)

Splitting data and training separately

c)

Training sequentially focusing on previous errors

d)

Selecting the best model

25.

If the number of trees in Random Forest increases significantly:

a)

Accuracy decreases

b)

Overfitting worsens

c)

Variance decreases, bias remains

d)

Regularization increases

26.

The main goal of PCA is to:

a)

Predict target variable

b)

Reduce dimensionality while preserving variance

c)

Increase non-linearity

d)

Identify latent labels

27.

A model with AUC = 0.5 indicates:

a)

Perfect model

b)

High error

c)

No class distinction (random)

d)

Accuracy = 50%

28.

Which activation function often causes vanishing gradient?

a)

Sigmoid

b)

ReLU

c)

Leaky ReLU

d)

Maxout

29.

Which loss function is best for regression?

a)

Cross Entropy

b)

Mean Squared Error (MSE)

c)

Hinge Loss

d)

Binary Log-loss

30.

The main purpose of dropout is to:

a)

Speed up training

b)

Turn off neurons randomly to prevent overfitting

c)

Deepen the model

d)

Remove outliers

31.

Difference between Bagging and Boosting:

a)

Bagging is sequential, Boosting is parallel

b)

Boosting uses only tree models

c)

Bagging reduces variance, Boosting reduces bias

d)

Boosting doesn’t use voting

32.

Gradient Descent converges slowly when:

a)

Learning rate too large

b)

Batch size too small

c)

Loss surface is steep and flat (ill-conditioned)

d)

Loss is convex

33.

Which unsupervised algorithm does NOT require number of clusters?

a)

K-means

b)

Gaussian Mixture

c)

DBSCAN

d)

Agglomerative Clustering

34.

Early stopping helps to:

a)

Increase epochs

b)

Prevent overfitting by stopping training early

c)

Guarantee smallest train loss

d)

Dynamically adjust learning rate

35.

F1-score is:

a)

Average of accuracy and precision

b)

Arithmetic mean of precision and recall

c)

Harmonic mean of precision and recall

d)

Ratio of TP and FN

36.

LSTM addresses which RNN limitation?

a)

Overfitting

b)

Gradient explosion

c)

Vanishing gradient

d)

Small batch size

37.

A key property of L1 regularization is:

a)

Makes deeper models

b)

Feature selection

c)

Reduces sample size

d)

Reduces number of layers

38.

Why normalize data in ML?

a)

To reduce dimensions

b)

To enhance model power

c)

To avoid scale bias in distance/gradient

d)

To reduce noise

39.

Transformers avoid RNN because:

a)

High memory

b)

Can’t capture sequence

c)

Self-attention is more efficient and parallelizable

d)

Can’t be trained

40.

Which algorithm supports both classification and regression?

a)

Logistic Regression

b)

Decision Tree

c)

Naive Bayes

d)

Perceptron

41.

What does the 'attention' mechanism in Transformer models primarily compute?

a)

Word frequency

b)

Word order

c)

Contextual relevance between tokens

d)

Token embeddings

42.

Which of the following best describes the role of the positional encoding in Transformers?

a)

Normalize input embeddings

b)

Improve model parallelism

c)

Inject token order information into embeddings

d)

Remove duplicated tokens

43.

In a decoder-only transformer (e.g., GPT), which attention type is used?

a)

Bidirectional attention

b)

Encoder-decoder attention

c)

Self-attention with full context

d)

Causal (masked) self-attention

44.

Which method allows an LLM to answer questions using external documents without retraining the model?

a)

Fine-tuning

b)

Distillation

c)

Retrieval-Augmented Generation (RAG)

d)

Prompt token compression

45.

Which of the following is a limitation of instruction-tuned LLMs (e.g., GPT-style models)?

a)

Cannot use pretrained embeddings

b)

May hallucinate facts confidently

c)

Unable to answer without GPU

d)

Do not support token streaming

46.

When you use 'few-shot prompting', what is being done?

a)

Training the model with few gradient steps

b)

Providing a few examples in the prompt to guide the response

c)

Using low-resolution embeddings

d)

Limiting the model’s depth

47.

Which technique is used to compress or accelerate inference in large language models?

a)

Prompt injection

b)

Beam search

c)

Quantization

d)

Residual connections

48.

Why is temperature used in LLM text generation?

a)

Control model depth

b)

Penalize repetitions

c)

Control randomness in token sampling

d)

Normalize logits

49.

Which embedding type is best suited for semantic similarity tasks with LLMs?

a)

Bag-of-words

b)

One-hot

c)

Sentence embeddings (e.g., using SBERT)

d)

Token-level logits

50.

What is the main role of the feed-forward network (FFN) in each Transformer block?

a)

Normalize the attention output

b)

Perform gradient clipping

c)

Introduce non-linear transformation to enriched representation

d)

Select the next token directly

51.

What does `df.memory_usage(deep=True)` show?

a)

Total number of rows

b)

Size of numeric columns only

c)

Memory usage of all columns including object internals

d)

Index size only

52.

Which technique best handles large CSVs that exceed memory capacity in Pandas?

a)

pd.read_csv(file)

b)

pd.read_json(file)

c)

Use chunksize parameter in pd.read_csv

d)

Convert to Excel first

53.

What is the purpose of `df.eval('col1 + col2')` in Pandas?

a)

Execute SQL query

b)

Efficiently evaluate expressions on columns

c)

Create lambda functions

d)

Save the DataFrame

54.

In SQL, what does `LAG(salary, 1) OVER (ORDER BY id)` do?

a)

Returns maximum salary

b)

Rank the salary

c)

Returns previous row’s salary

d)

Sum of 2 salaries

55.

Which method is best to apply a custom ranking across grouped rows in Pandas?

a)

df.rank()

b)

df.groupby('group')['val'].rank()

c)

df['val'].cumsum()

d)

df.sort_values().reset_index()

56.

What’s the fastest way to check if any value in a DataFrame is NaN?

a)

df == np.nan

b)

df.isnull().any()

c)

df.isna().values.any()

d)

df.isna().all()

57.

Which function is preferred to aggregate multiple statistics per group in Pandas?

a)

groupby().agg()

b)

groupby().agg({'col1': ['mean','std'], 'col2': 'sum'})

c)

groupby().describe()

d)

groupby().cumsum()

58.

What is the key feature of Arrow format in modern data pipelines?

a)

JSON-friendly

b)

Human-readable

c)

Zero-copy data sharing across languages

d)

Compressed text

59.

Which Pandas method avoids explicit for-loops in conditional column creation?

a)

df.append()

b)

np.where(condition, A, B)

c)

df.map()

d)

df.merge()

60.

Which SQL clause is equivalent to `np.percentile(col, 50)`?

a)

MAX(col)

b)

PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY col)

c)

MEDIAN(col)

d)

NTILE(2)