forked from rohitg00/ai-engineering-from-scratch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.json
More file actions
64 lines (64 loc) · 2.58 KB
/
Copy pathquiz.json
File metadata and controls
64 lines (64 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
"questions": [
{
"stage": "pre",
"question": "What is the imaginary unit i defined by?",
"options": [
"i = sqrt(2)",
"i^2 = -1",
"i = -1",
"i^2 = 1"
],
"correct": 1,
"explanation": "The imaginary unit i is defined by the property i^2 = -1. It extends the real number line into a 2D plane. Geometrically, multiplying by i is a 90-degree rotation — two multiplications (i^2) give a 180-degree rotation, which is -1."
},
{
"stage": "pre",
"question": "What does Euler's formula e^(i*theta) equal?",
"options": [
"theta + i",
"cos(theta) + i*sin(theta)",
"sin(theta) + cos(theta)",
"i^theta"
],
"correct": 1,
"explanation": "Euler's formula states e^(i*theta) = cos(theta) + i*sin(theta). This connects complex exponentials to trigonometry and shows that e^(i*theta) traces the unit circle as theta varies."
},
{
"stage": "post",
"question": "What is the result of (3 + 2i)(1 + 4i)?",
"options": [
"3 + 8i",
"4 + 6i",
"-5 + 14i",
"5 + 14i"
],
"correct": 2,
"explanation": "Using FOIL: (3)(1) + (3)(4i) + (2i)(1) + (2i)(4i) = 3 + 12i + 2i + 8i^2 = 3 + 14i + 8(-1) = 3 + 14i - 8 = -5 + 14i."
},
{
"stage": "post",
"question": "Why are complex numbers used in Rotary Position Embedding (RoPE) for transformers?",
"options": [
"Complex numbers compress the position encoding to use less memory",
"Multiplying query/key vectors by complex rotations encodes relative position as a rotation angle",
"Complex numbers are required by the attention softmax function",
"RoPE uses imaginary numbers to handle negative positions"
],
"correct": 1,
"explanation": "RoPE multiplies query and key vectors by complex rotation matrices e^(i*m*theta) where m is the position. The relative position between two tokens becomes a rotation angle, and attention naturally becomes sensitive to relative (not absolute) position through complex multiplication."
},
{
"stage": "post",
"question": "The N-th roots of unity are N equally spaced points on the unit circle. What is their sum?",
"options": [
"N",
"1",
"0",
"N/2"
],
"correct": 2,
"explanation": "The N roots of unity are e^(2*pi*i*k/N) for k = 0, ..., N-1. They are symmetrically distributed around the unit circle, so their vector sum cancels out to zero. This symmetry property is what makes the DFT invertible."
}
]
}