@@ -500,20 +500,20 @@ pass:[\begin{equation}\phi = \frac{n_{11}n_{00}-n_{10}n_{01}}{\sqrt{n_{1\bullet}
500500
501501endif::tex_target[]
502502
503- The notation (!html _n_~01~!)(!tex pass:[$n_{01}$]!) indicates the
503+ The notation (!html _n_~01~!)(!book pass:[$n_{01}$]!) indicates the
504504number of measurements where the first measurement (pizza) is false
505505(0) and the second measurement (squirrelness) is true (1). In this
506- example, (!html _n_~01~!)(!tex pass:[$n_{01}$]!) is 4.
506+ example, (!html _n_~01~!)(!book pass:[$n_{01}$]!) is 4.
507507
508- The value (!html _n_~1•~!)(!tex pass:[$n_{1\bullet}$]!) refers to the
508+ The value (!html _n_~1•~!)(!book pass:[$n_{1\bullet}$]!) refers to the
509509sum of all measurements where the first variable is true, which is 10
510- in the example table. Likewise, (!html _n_~•0~!)(!tex pass:[$n_{\bullet0}$]!)
510+ in the example table. Likewise, (!html _n_~•0~!)(!book pass:[$n_{\bullet0}$]!)
511511refers to the sum of the measurements where the squirrel variable is false.
512512
513513(((correlation)))(((phi coefficient)))So for the pizza table, the part
514514above the division line (the dividend) would be 1×76 - 9×4 = 40, and
515515the part below it (the divisor) would be the square root of
516- 10×80×5×85, or (!html √340000!)(!tex pass:[$\sqrt{340000}$]!). This
516+ 10×80×5×85, or (!html √340000!)(!book pass:[$\sqrt{340000}$]!). This
517517comes out to _ϕ_ ≈ 0.069, which is tiny. Eating ((pizza)) does not
518518appear to have influence on the transformations.
519519
@@ -557,13 +557,13 @@ console.log(phi([76, 9, 4, 1]));
557557translation of the _ϕ_ formula into JavaScript. `Math.sqrt` is the
558558square root function, as provided by the `Math` object in a standard
559559JavaScript environment. We have to sum two fields from the table to
560- get fields like (!html n~1•~!)(!tex pass:[$n_{1\bullet}$]!) because
560+ get fields like (!html n~1•~!)(!book pass:[$n_{1\bullet}$]!) because
561561the sums of rows or columns are not stored directly in our data
562562structure.
563563
564564(((JOURNAL data set)))Jacques kept his journal for three months. The
565565resulting ((data set)) is available in the coding sandbox for this
566- chapter(!tex (http://eloquentjavascript.net/code[_eloquentjavascript.net/code_])!),
566+ chapter(!book (http://eloquentjavascript.net/code[_eloquentjavascript.net/code_])!),
567567where it is stored in the `JOURNAL` variable, and in a downloadable
568568http://eloquentjavascript.net/code/jacques_journal.js[file].
569569
@@ -1206,7 +1206,7 @@ console.log(range(5, 2, -1));
12061206----
12071207endif::html_target[]
12081208
1209- !!solution !!
1209+ !!hint !!
12101210
12111211(((summing (exercise))))(((array,creation)))(((square
12121212brackets)))Building up an array is most easily done by first
@@ -1234,7 +1234,7 @@ It might also be worthwhile to use a different default step, namely,
12341234`range(5, 2)` returns something meaningful, rather than getting stuck
12351235in an ((infinite loop)).
12361236
1237- !!solution !!
1237+ !!hint !!
12381238
12391239=== Reversing an array ===
12401240
@@ -1271,7 +1271,7 @@ console.log(arrayValue);
12711271----
12721272endif::html_target[]
12731273
1274- !!solution !!
1274+ !!hint !!
12751275
12761276(((reversing (exercise))))There are two obvious ways to implement
12771277`reverseArray`. The first is to simply go over the input array from
@@ -1296,7 +1296,7 @@ briefly hold on to one of the elements, overwrite that one with its
12961296mirror image, and then put the value from the local variable in the
12971297place where the mirror image used to be.
12981298
1299- !!solution !!
1299+ !!hint !!
13001300
13011301=== A list ===
13021302
@@ -1366,7 +1366,7 @@ console.log(nth(arrayToList([10, 20, 30]), 1));
13661366----
13671367endif::html_target[]
13681368
1369- !!solution !!
1369+ !!hint !!
13701370
13711371(((list (exercise))))(((linked list)))Building up a list is best done
13721372back to front. So `arrayToList` could iterate over the array backward
@@ -1397,7 +1397,7 @@ zeroeth element of a list, you simply take the `value` property of its
13971397head node. To get element _N_ + 1, you take the __N__th element of the
13981398list that's in this list's `rest` property.
13991399
1400- !!solution !!
1400+ !!hint !!
14011401
14021402[[exercise_deep_compare]]
14031403=== Deep comparison ===
@@ -1437,7 +1437,7 @@ console.log(deepEqual(obj, {here: {is: "an"}, object: 2}));
14371437----
14381438endif::html_target[]
14391439
1440- !!solution !!
1440+ !!hint !!
14411441
14421442(((deep comparison (exercise))))(((typeof operator)))(((object)))(((=== operator)))Your test for whether you are dealing with a
14431443real object will look something like `typeof x == "object" && x !=
@@ -1458,4 +1458,4 @@ of the properties are compared by a recursive call to `deepEqual`.
14581458best done by immediately returning false when a mismatch is noticed
14591459and returning true at the end of the function.
14601460
1461- !!solution !!
1461+ !!hint !!
0 commit comments