From 93761d8c249d0fe481da7baf0986fa1bafd3b951 Mon Sep 17 00:00:00 2001 From: Andrew Lin Date: Sat, 20 Aug 2022 11:04:48 -0700 Subject: [PATCH] Corrections for Ranges chapter. --- quarto/precalc/ranges.qmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quarto/precalc/ranges.qmd b/quarto/precalc/ranges.qmd index 60320a5..e6a95f6 100644 --- a/quarto/precalc/ranges.qmd +++ b/quarto/precalc/ranges.qmd @@ -320,7 +320,7 @@ In this example, we use the fact that `rem(k, 7)` returns the remainder found fr sum(k for k in 1:100 if rem(k,7) == 0) ## add multiples of 7 ``` -The same `if` can be used in a comprehension. For example, this is an alternative to `filter` for identifying the numbers divisble by `7` in a range of numbers: +The same `if` can be used in a comprehension. For example, this is an alternative to `filter` for identifying the numbers divisible by `7` in a range of numbers: ```{julia} @@ -330,7 +330,7 @@ The same `if` can be used in a comprehension. For example, this is an alternativ #### Example: Making change -This example of Stefan Karpinski comes from a [blog](http://julialang.org/blog/2016/10/julia-0.5-highlights) post highlighting changes to the `Julia` language with version `v"0.5.0"`, which added features to comprehensions that made this example possible. +This example of Stefan Karpinski's comes from a [blog](http://julialang.org/blog/2016/10/julia-0.5-highlights) post highlighting changes to the `Julia` language with version `v"0.5.0"`, which added features to comprehensions that made this example possible. First, a simple question: using pennies, nickels, dimes, and quarters how many different ways can we generate one dollar? Clearly $100$ pennies, or $20$ nickels, or $10$ dimes, or $4$ quarters will do this, so the answer is at least four, but how much more than four? @@ -506,7 +506,7 @@ Does vector addition work? as expected? In particular, is the result of `(1:4) + yesnoq(true) ``` -What if parenthese are left off? Explain the output of `1:4 + 2:5`? +What if parentheses are left off? Explain the output of `1:4 + 2:5`? ```{julia}