This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
/
matrix_dimensions.html
67 lines (63 loc) · 2.4 KB
/
matrix_dimensions.html
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
65
66
67
<!DOCTYPE html>
<html data-require="math kmatrix qhints">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Matrix dimensions</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars" data-ensure="!(DIM_1 === 1 && DIM_2 === 1)">
<var id="DIM_1">randRange(1, 4)</var>
<var id="DIM_2">randRange(1, 4)</var>
<var id="MAT_A">makeMatrix(randRange(-2, 4, DIM_1, DIM_2))</var>
<var id="PRETTY_MAT_ID">"\\textbf " + randFromArray("ABCDEF")</var>
<var id="PRETTY_MAT_A">
printSimpleMatrix(MAT_A)
</var>
</div>
<div class="problems">
<div>
<div class="problem">
<p>
<code><var>PRETTY_MAT_ID</var> = <var>PRETTY_MAT_A</var></code>
</p>
</div>
<p class="question">
What are the dimensions of matrix <code><var>PRETTY_MAT_ID</var></code>?
</p>
<div class="solution" data-type="multiple">
<span class="sol short40" data-forms="integer"><var>DIM_1</var></span>
<code>\times</code>
<span class="sol short40" data-forms="integer"><var>DIM_2</var></span>
</div>
</div>
</div>
<div class="hints">
<div class="qhint">
<p>
The first dimension is the number of rows in the matrix. How many rows does <code><var>PRETTY_MAT_ID</var></code> have?
</p>
<span class="qhint-answer"><var>DIM_1</var></span>
<p class="qhint-input">
<input type="text" value="">
<input type="submit" value="Check">
</p>
</div>
<div class="qhint">
<p>
The second dimension is the number of columns in the matrix. How many columns does <code><var>PRETTY_MAT_ID</var></code> have?
</p>
<span class="qhint-answer"><var>DIM_2</var></span>
<p class="qhint-input">
<input type="text" value="">
<input type="submit" value="Check">
</p>
</div>
<div>
So, <code><var>PRETTY_MAT_ID</var></code> is a <var>DIM_1</var> <code>\times</code> <var>DIM_2</var> matrix.
</div>
</div>
</div>
</body>
</html>