dist2: Three Distances in a Cartesian Coordinate System

Exercise template for computing the Manhattan, Euclidean, and maximum distance (cloze with three numeric answers) between two randomly-drawn points in a Cartesian coordinate system.

Name:
dist2
Type:
Related:
Description:
Computing three different distance measures between the same two randomly-drawn points by using Manhatten, Euclidean, and maximum distance.
Solution feedback:
Yes
Randomization:
Random numbers and graphics
Mathematical notation:
Yes
Verbatim R input/output:
No
Images:
Yes
Other supplements:
No
Template:
Raw: (1 random version)
PDF:
dist2-Rnw-pdf
dist2-Rmd-pdf
HTML:
dist2-Rnw-html
dist2-Rmd-html

(Note that the HTML output contains mathematical equations in MathML. It is displayed by browsers with MathML support like Firefox or Safari - but not Chrome.)

Demo code:

library("exams")

set.seed(1090)
exams2html("dist2.Rnw")
set.seed(1090)
exams2pdf("dist2.Rnw")

set.seed(1090)
exams2html("dist2.Rmd")
set.seed(1090)
exams2pdf("dist2.Rmd")