Skip to content

Commit

Permalink
A11y-U8 fix lists - done U8
Browse files Browse the repository at this point in the history
  • Loading branch information
jkangEDC committed Dec 10, 2024
1 parent f9f6be1 commit fce9b86
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>Contar árboles</h2>
<img class="imageRight noshadow" src="/bjc-r/img/7-recursion/tree-level9.jpg" alt="imagen de árbol fractal" title="imagen de árbol fractal" />
<ol>
<li>
Abre tu proyecto "U7L1-Árbol". ¿Cuántos segmentos de línea hay en un árbol de cada nivel? Completa esta tabla. (Puedes contar a simple vista o usar Snap<em>!</em> para contar). </li>
Abre tu proyecto "U7L1-Árbol". ¿Cuántos segmentos de línea hay en un árbol de cada nivel? Completa esta tabla. (Puedes contar a simple vista o usar Snap<em>!</em> para contar).
<table class="center bordered" summary="tabla que muestra el número de segmentos de línea de un ÁRBOL en un nivel dado">
<tr>
<th scope="col" style="font-weight:normal;"><var>nivel</var></th>
Expand Down Expand Up @@ -54,8 +54,8 @@ <h2>Contar árboles</h2>
<li><img class="inline" src="/bjc-r/img/icons/talk-with-your-partner.es.png" alt="Habla con tu compañero" title="Habla con tu compañero" />¿Cómo se compara la cantidad de segmentos en un nivel con la cantidad de segmentos en el nivel anterior?
</li>
<li>Construya un bloque que tenga un número de árbol como entrada y la cantidad de segmentos en ese nivel como salida
</li>
<img class="indent" src="/bjc-r/img/8-recursive-reporters/treecounter.es.png" alt="segmentos de árbol (7) reporta 127" title="segmentos de árbol (7) reporta 127" /><br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/treecounter.es.png" alt="segmentos de árbol (7) reporta 127" title="segmentos de árbol (7) reporta 127" /><br />
</li>
</ol>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ <h2>Counting Trees</h2>
</table>
</li>
<li><img class="inline" src="/bjc-r/img/icons/talk-with-your-partner.png" alt="Talk with Your Partner" title="Talk with Your Partner" /> How does the number of segments in one level compare to the number of segments in the previous level?</li>
<li>Build a block whose input is a tree number and whose output is the number of segments in that level:</li>
<img class="indent" src="/bjc-r/img/8-recursive-reporters/treecounter.png" alt="segments in tree (7) reporting 127" title="segments in tree (7) reporting 127"/><br />
<li>Build a block whose input is a tree number and whose output is the number of segments in that level:
<img class="indent" src="/bjc-r/img/8-recursive-reporters/treecounter.png" alt="segments in tree (7) reporting 127" title="segments in tree (7) reporting 127"/><br />
</li>
</ol>
</div>

Expand Down Expand Up @@ -115,6 +116,8 @@ <h2>Counting Trees</h2>
<img class="indent" src="/bjc-r/img/8-recursive-reporters/trianglecounter.png" alt="triangles in level (5) fractal reporting 121" title="triangles in level (5) fractal reporting 121"/>
</li>
<li><div class="saveAs"><span class="text">"U8L1-Recursive-Reporters"</span><img src="/bjc-r/img/icons/save-this-as.png" alt="Save your work as U8L1-Recursive-Reporters" title="Save your work as U8L1-Recursive-Reporters" /></div></li>
</ol>
</div>

<div class="todo">Do we need this commented out content? --MF, 6/22/20</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ <h2>Escribir reporteros recursivos</h2>
La función factorial <em>n</em>! se define como el producto de los números enteros de 1 a <em>n</em>.
</p>
<ol>
<li>El valor de 9! es 362.880. Encuentra el valor de 10!.</li>
<div class="sidenoteBig"> No olvides el consejo de Betty: <em>¡Los casos base son importantes!</em></div>
<li>El valor de 9! es 362.880. Encuentra el valor de 10!.
<div class="sidenoteBig"> No olvides el consejo de Betty: <em>¡Los casos base son importantes!</em></div>
</li>
<li>Describe la relación entre 37! y 36!.</li>
<li>Usa estas ideas para construir un <code>factorial</code> bloque usando un reportero recursivo.</li>
</ol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ <h2>Writing Recursive Reporters</h2>
The factorial function, <em>n</em>!, is defined to be the product of the integers from 1 to <em>n</em>.
</p>
<ol>
<li>The value of 9! is 362,880. Find the value of 10!.</li>
<div class="sidenoteBig">Don't forget Betty's advice: <em>base cases are important!</em></div>
<li>The value of 9! is 362,880. Find the value of 10!.
<div class="sidenoteBig">Don't forget Betty's advice: <em>base cases are important!</em></div>
</li>
<li>Describe the relationship between 37! and 36!.</li>
<li>Use these ideas to build a <code>factorial</code> block using a recursive reporter.
</li>
Expand Down Expand Up @@ -68,8 +69,8 @@ <h2>Writing Recursive Reporters</h2>

<div class="forYouToDo">
<p>Word processing programs count the number of words and letters in documents. One way to count the number of letters in a phrase is to use a recursive reporter.</p>
<div class="commentBig">Can we use a phrase that is more familiar to the high schooler's experience? --MF Such as? These are the first words of the Declaration of Independence. I do not want to use the Pledge of Allegiance. -BK</div>
<ol start="4">
<div class="commentBig">Can we use a phrase that is more familiar to the high schooler's experience? --MF Such as? These are the first words of the Declaration of Independence. I do not want to use the Pledge of Allegiance. -BK</div>
<li>The phrase <strong>"in the course of human events"</strong> has 24 letters. How many letters are there in the phrase <strong>"When in the course of human events"</strong>?</li>
<li>Recursion always needs a base case to stop the script from calling itself forever. What sort of base case might we use for this situation?</li>
<li>
Expand All @@ -82,6 +83,7 @@ <h2>Writing Recursive Reporters</h2>
Create your own version of the <code>join words</code> block. This block inputs a list and outputs a string sentence, with spaces:<br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/myjoinwords.png" alt="my join words(list{We, the. People, of, the, United, States}) reporting -We the People of the United States" title="my join words(list{We, the. People, of, the, United, States})reporting -We the People of the United States" />
</li>
</ol>
<!-- <p>Then, compare your work to the real <code>join words</code> block.</p> -->
<div class="todo">
<p>Again, I am concerned with teaching recursion as "a more complicated way to do what you already know how to do." I don't think <code>my join words</code> works because it can be done so much more quickly <em>non-recursively</em> by using <code>combine</code>. I <em>do</em> like <code>letter count</code> though because it <em>does</em> simplify the code. --MF<br />
Expand All @@ -90,7 +92,6 @@ <h2>Writing Recursive Reporters</h2>
</p>
<p>I need a suggestion to change this. Or is the suggestion to delete the join-words task? Any other things to replace it? Also we should use "empty?" when possible, not "length = 0". -BK</p>
</div>
</ol>
</div >

<p>The list operations <code>all but first of</code> and <code>in front of</code> are frequently used in recursive reporters.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ <h2>Listing the Subsets</h2>
<div class="forYouToDo" id="first">
<ol>
<li>Write down all the subsets of {Apple, Orange, Banana}. How many are there?</li>
<li>Write down all the subsets of {Pretzel, Apple, Orange, Banana}. Try to do this with as little work as possible.</li>
<div class="todo">Add a question that gets at how 2 is just an augmentation of 1. --MF, 6/17/20
<img class="imageRight" src="/bjc-r/img/icons/talk-with-your-partner.png" alt="Talk with Your Partner" title="Talk with Your Partner" />Describe how you did it.</div>
<li>Write down all the subsets of {Pretzel, Apple, Orange, Banana}. Try to do this with as little work as possible.
<div class="todo">Add a question that gets at how 2 is just an augmentation of 1. --MF, 6/17/20
<img class="imageRight" src="/bjc-r/img/icons/talk-with-your-partner.png" alt="Talk with Your Partner" title="Talk with Your Partner" />Describe how you did it.</div>
</li>

<li>
<div class="todo">MARY Note to self: this is hard. for example, in base case (subsets of empty list), you have to report a list containing the empty list. Add a question that gets at the base case. </div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ <h2>Generalizing the <code>Map</code> Pattern</h2>
Occasionally a problem comes up that doesn't <em>exactly </em>match the <code>map</code> pattern, but comes close. In that case, you can't use <code>map</code>, but your understanding of the pattern still helps. Here's an example:<br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/odds.png" alt="odd numbered items of (data){if(empty? (data)){report(empty list)} else{if(empty? (all but first of (data))){report(data)} else{report((item(1) of (data)) in front of (odd numbered items of(all but first of (all but first of (data)))))}}}" title="odd numbered items of (data){if(empty? (data)){report(empty list)} else{if(empty? (all but first of (data))){report(data)} else{report((item(1) of (data)) infront of (odd numbered items of(all but first of (all but first of (data)))))}}}" /><br />
Fill in the blanks: This script is just like the map pattern except for ______ (base case) and _____ (in the recursive case).
<div class="todo">
<p>Shouldn't <code>pairup</code> come before <code>odd numbered</code>? --MF, 9/26/18</p>
<p>BH:that's ok, but take ALL the text from #2 and move it here with this. --MF, 6/17/20</p>
<p>The fill in the blank is not something we’ve seen before in the curriculum. Seems out of place. --Michelle via MF, 4/22/22<ul><li>I don't really agree, but I'm open to discuss. --MF, 4/22/22</li></ul></p>
</div>
</li>
<div class="todo">
<p>Shouldn't <code>pairup</code> come before <code>odd numbered</code>? --MF, 9/26/18</p>
<p>BH:that's ok, but take ALL the text from #2 and move it here with this. --MF, 6/17/20</p>
<p>The fill in the blank is not something we’ve seen before in the curriculum. Seems out of place. --Michelle via MF, 4/22/22<ul><li>I don't really agree, but I'm open to discuss. --MF, 4/22/22</li></ul></p>
</div>
<li>
Build the <code>pairup</code> block:<br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/pairup.png" alt="pairup(list{now, here, after, math}), reporting {nowhere, hereafter, aftermath}" title="pairup(list{now, here, after, math}), reporting {nowhere, hereafter, aftermath}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ <h2>Números pares y <code>mantener</code></h2>
<div class="forYouToDo" id="first">
<p><strong>Haz los siguientes ejercicios usando recursividad, no funciones de orden superior. </strong></p>
<ol>
<div class="sidenote">Intenta modificar el código de <code>evens</code>.</div>
<li>
<li>
<div class="sidenote">Intenta modificar el código de <code>evens</code>.</div>
Escriba un bloque <code>termina en-a</code> que tome una lista de palabras como entrada y reporte una lista de esas palabras de la entrada cuya última letra es <em>a</em>.<br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/endse-ex.es.png"
alt="termina en-a(lista{la, lluvia, en, España, es, en, Europa}), reporta {la, lluvia, Europa}"
Expand All @@ -42,7 +42,8 @@ <h2>Números pares y <code>mantener</code></h2>
</ol>
</div>

<div class="takeNote">Crear <code>mapear</code>, <code>mantener</code> y <code>combinar</code> es un gran logro. Sin embargo, cada uno de estos bloques solo generaliza un patrón simple. Algunas personas piensan ni siquiera aprender a <em>usar</em> las funciones de orden superior son en la universidad, ni mucho menos a construirlasn. 🎉 ¡Enhorabuena! 👏 ¡Completaste <em>La belleza y alegría de la Informática</em> (BJC)! 🏆</p>
<div class="takeNote">
<p>Crear <code>mapear</code>, <code>mantener</code> y <code>combinar</code> es un gran logro. Sin embargo, cada uno de estos bloques solo generaliza un patrón simple. Algunas personas piensan ni siquiera aprender a <em>usar</em> las funciones de orden superior son en la universidad, ni mucho menos a construirlasn. 🎉 ¡Enhorabuena! 👏 ¡Completaste <em>La belleza y alegría de la Informática</em> (BJC)! 🏆</p>
</div>

<div class="takeItFurther">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ <h2>Even Numbers and <code>Keep</code></h2>
<div class="todo"><strong>Fundamental Concern:</strong> The pedagogy here is killing me. Here draw a square with recursion or functionally. WHY?!?!? Don't torture students. Give them a problem where this technique really matters. --MF, 9/26/18</div>
<p><strong>Do the following exercises using recursion, not higher order functions. </strong></p>
<ol>
<div class="sidenote">Try modifying the code from <code>evens</code>.</div>
<li>
Write a block <code>ends-e</code> that takes a list of words as input, and reports a list of those words from the input whose last letter is e.<br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/endse-ex.png" alt="ends-e(list{the, rain, in, Spain, is, in, Europe}), reporting {the, Europe}" title="ends-e(list{the, rain, in, Spain, is, in, Europe}), reporting {the, Europe}" />
<div class="sidenote">Try modifying the code from <code>evens</code>.</div>
Write a block <code>ends-e</code> that takes a list of words as input, and reports a list of those words from the input whose last letter is e.<br />
<img class="indent" src="/bjc-r/img/8-recursive-reporters/endse-ex.png" alt="ends-e(list{the, rain, in, Spain, is, in, Europe}), reporting {the, Europe}" title="ends-e(list{the, rain, in, Spain, is, in, Europe}), reporting {the, Europe}" />
</li>
<li>
Write a block <code>numbers</code> that takes a list of mixed words and numbers as input, and reports a list of just the numbers from the input list.<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ <h2>El triángulo de Pascal y la eficiencia</h2>

<p>Estás a punto de averiguar cuántas llamadas recursivas se necesitan para calcular un valor en el triángulo de Pascal.</p>
<div class="forYouToDo" id="first">
<div class="sidenote">¿Qué podrías insertar dentro del bloque para rastrear esto?</div>
<ol>
<div class="sidenote">¿Qué podrías insertar dentro del bloque para rastrear esto?</div>
<li>Modifica tu bloque <code>pascal</code> para llevar la cuenta de cuántas veces se ejecuta el bloque.</li>
<li>¿Cuántas veces se llama al bloque <code>pascal</code> al calcular <img src="/bjc-r/img/8-recursive-reporters/pascal145.es.png" alt="pascal(14)(5)" title = "pascal (14)(5)" />?</li>
<li>¿Qué ocurre cuando llamas a <img src="/bjc-r/img/8-recursive-reporters/pascal205.es.png" alt="pascal(20)(5)" title="pascal(20)(5)"/>?</li>
Expand All @@ -29,12 +29,13 @@ <h2>El triángulo de Pascal y la eficiencia</h2>
<p>Muchas de las llamadas recursivas son redundantes. Por ejemplo: <img src="/bjc-r/img/8-recursive-reporters/pascal145.es.png" alt="pascal(14)(5)" title="pascal(14)(5)"/> llamará a <img src="/bjc-r/img/8-recursive-reporters/pascal103.es.png" alt="pascal(10)(3)" title="pascal(10)(3)" /> muchas veces, pidiendo la misma información.</p>

<div class="takeItFurther" >
<div class="sidenoteBig">Esta técnica se llama <strong>memoización</strong>. Esto no es un error tipográfico; no hay "r" en la palabra. Cada respuesta grabada es como un "memorándum".</div>
<ol type="A">
<div class="sidenoteBig">Esta técnica se llama <strong>memoización</strong>. Esto no es un error tipográfico; no hay "r" en la palabra. Cada respuesta grabada es como un "memorándum".</div>
<li>Usa una estructura de lista para realizar un seguimiento de los valores ya calculados de <code>pascal</code>, de modo que, cuando se vuelvan a proporcionar las mismas entradas, la función busque el valor guardado en lugar de realizar más llamadas recursivas.</li>
<li>Hay una fórmula directa para <code>pascal</code> que se usa mucho:</li>
<div class="center"><span class="katex"> \text{pascal}(n,r) = \frac{n!}{r!(n-r)!}</span></div>
<p>Crea una versión de <code>pascal</code> que use la fórmula. Compara la eficiencia de esta versión con la versión recursiva y determina si cada versión se ejecuta en tiempo constante, tiempo lineal, tiempo cuadrático o tiempo exponencial.</p>
<li>Hay una fórmula directa para <code>pascal</code> que se usa mucho:
<div class="center"><span class="katex"> \text{pascal}(n,r) = \frac{n!}{r!(n-r)!}</span></div>
<p>Crea una versión de <code>pascal</code> que use la fórmula. Compara la eficiencia de esta versión con la versión recursiva y determina si cada versión se ejecuta en tiempo constante, tiempo lineal, tiempo cuadrático o tiempo exponencial.</p>
</li>
</ol>
</div>

Expand Down
Loading

0 comments on commit fce9b86

Please sign in to comment.