RU beehive logo ITEC dept promo banner
ITEC 122
2008fall
ibarland

homeinfolecturesexamsarchive

hw07
sums

Due 2008.Oct.29 (Wed)
  1. (2pts) Rosen p.160 #2. (What is a8?)
    1. an = 2n-1
    2. an = 7
    3. an = (-1)n+1
    4. an = -(-2)n
  2. (10pts) Rosen p.161 #14 (5ed: p.236 #14): sums over S={1,3,5,7}.
    Then, repeat parts (a),(b),(d) summing over S′ = [0,100] ∩ Z. (For (b), refer to Table 2 in the book.) Each answer is a number; you don't need to show your work if you're confident about the answer. No calculator required.
  3. (12pts) p.162 #18a-c (5ed p.236 #18a-c) variant: replace "3" with "300" and "2" with "200".
    Leave your answer as arithmetic (i.e. your answer should include terms like “200·301·150”, but it should not include any “…” -- only things you can type into a calculator.)
    You don't need to show your work. (And if you do, clearly circle your answer.)
    Hint: Remember that you can distribute Sigma over addition/subtraction: Σ(f(i)+g(i)) = (Σf(i))+(Σg(i)), regardless of what values i ranges over1 (Put another way: it doesn't matter which order you do additions in.)
  4. In Wii Fit Soccer, you play a goalie; soccer balls are kicked at you, and you get points for every ball you successfully block. (Here's a video trailer.)

    Details:

    1. (1pt) What is the maximum possible score, in this game?
    2. (3pts) Suppose you play the game, and miss exactly one ball. (Way to go!). What is your maximum possible score in this case? Describe how this score would be achieved.
    3. (3pts) Suppose you play the game, and miss exactly one ball. What is your minimum possible score in this case? Describe how this score would be achieved. (Missing which ball would achieve this score?)
    4. (3pts) In a program, we wouldn't want to use magic numbers like 80 and 10; we'd declare named constants name something like N and MAX_PTS_PER_BLOCK, respectively. Give your answers to (a)-(c) above in terms of these terms (Use the names “N” and “m” for these quantities.)
    5. Extra-credit: Prove that these bounds are correct. Hint: Suppose I missed only the ith ball; derive a formula mx(i) for the max number of points achievable (which might have several cases, depending on what i is). Then, show mathematically that in all cases, your answer to part (b) is always ≥ than your formula, for any i. Then do similarly for part (c).

    6. Extra-credit: Implement two functions, maxPossible and minPossible. The description of maxPossible is given here, and minPossible is analogous.
        /** Return the maximum possible Wii Fit Soccer score,
         *  given how many balls were missed.
         * @param n The number of balls in a game.
         * @param k The number of balls missed.  0 ≤ k ≤ n.
         * @param m The maximum number of points possible for a single ball.
         * @return  the maximum possible Wii Fit Soccer score,
         * if exactly k balls were missed.
         */
         int maxPossible( int numMisses, int N, int m )
          
      Although I gave those signatures in Java, you can use any programming language of your choice, but you must provide a solid test suite, and your program must pass the test suite!

1…at least if the index set is finite.      

homeinfolecturesexamsarchive


©2008, Ian Barland, Radford University
Last modified 2008.Dec.13 (Sat)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme