-
Notifications
You must be signed in to change notification settings - Fork 1
/
intro.html
102 lines (102 loc) · 4.61 KB
/
intro.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dyalog APL Workshop</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="oneliners.css" />
<script src="util.js"></script>
<script src="tio-dyalog.js"></script>
<script src="testString.js"></script>
<script src="problems.js"></script>
<script src="pako.min.js"></script>
</head>
<body>
<!-- Add <div class="tab"> for each problem -->
<!-- Tab buttons created by tabs.js -->
<!-- Language bar, input field and submit button included by tabs.js -->
<h1>Part 1: The APL Pocket Calculator</h1>
<div class="tab">
<div class="description">
<ol>
<li>
<h3>A Mathematical Notation</h3>
Use APL to evaluate the following:
<br><br>
<ol type="a">
<li>
<img src="img/Prod100.svg"> (multiply together the first one hundred integers)
</li>
<li>
<img src="img/SumSq.svg"> (add together the first seventeen squared integers)
</li>
<li>
<img src="img/EvenSum100.svg"> (add together the first one hundred even integers)
</li>
<li>
<img src="img/OddSum100.svg"> (add together the first one hundred odd integers)
</li>
<li>
In traditional mathematical notation (TMN), the following equation is true. Why does this return false in APL?
<pre class="apl">
0 = 84 - 12 - 1 - 13 - 28 - 9 - 6 - 15
0
</pre>
</li>
</ol>
</li>
<li>
<h3>Pyramid schemes</h3>
<ol type="a">
<li>
Sugar cubes are stacked in an arrangement as shown by <strong>figure 1</strong>.
<figure>
<img width=200px src="img/SquaredCubes.png" alt="Figure 2. Stacked sugar cubes">
<figcaption><strong>Figure 1.</strong> Stacked sugar cubes</figcaption>
</figure>
This stack has <code class="apl">4</code> <strong>layers</strong> and a total of <code class="apl">30</code> cubes.<br>How many cubes are there in a similar stack with <code class="apl">467</code> <strong>layers</strong>?
</li>
<li>
Now consider the stack in <strong>figure 2</strong>.
<figure>
<img width=280px src="img/OddSquaredCubes.png" alt="Figure 2. Differently stacked sugar cubes">
<figcaption><strong>Figure 1.</strong> Differently stacked sugar cubes</figcaption>
</figure>
The arrangement in <strong>figure 2</strong> has <code class="apl">4</code> <strong>layers</strong> and <code class="apl">84</code> cubes.<br>How many cubes are there in a similar stack with 812 <strong>layers</strong>?
</li>
<li>
Now look at <strong>figure 3</strong>.
<figure>
<img width=280px src="img/CubedCubes.png" alt="Figure 2. Differently stacked sugar cubes">
<figcaption><strong>Figure 3.</strong> This is just a waste of sugar cubes by now...</figcaption>
</figure>
The stack in <strong>figure 3</strong> has <code class="apl">3</code> <strong>"layers"</strong> and <code class="apl">36</code> cubes in total.<br>How many cubes are there in a similar stack with 68 <strong>"layers"</strong>?
</li>
</ol>
</li>
<li>
<h3>What's in a vector?</h3>
<code class="apl">⎕AVU</code> is a list (vector) of numbers (don't worry about what it represents).<br>Find the following properties of <code class="apl">⎕AVU</code>.
<br><br>
<ol type="a">
<li>
Find the sum of all the values in <code class="apl">⎕AVU</code>.
</li>
<li>
Find the product of all the values in <code class="apl">⎕AVU</code>.
</li>
<li>
What is the length of <code class="apl">⎕AVU</code>?
</li>
<li>
Find the mean average value of <code class="apl">⎕AVU</code>.
</li>
</ol>
</li>
</ol>
</div>
</div>
<a class="apl nav right" href="dfns.html">Next →</a>
<a class="apl nav left" href="index.html">← Back</a>
</body>
</html>