hw2.pdf - Stat 155 Spring 2017 Homework 1 Problem 1 Find...

This preview shows page 1 - 2 out of 5 pages.

Stat 155, Spring 2017Homework 1Problem 1Find the Sprague-Grundy value of each position, and justify oyur solution.Solution:Any position with a nonzero SG number is anNposition, and any position with anSG number of 0 is aPposition. We now find the SG function of this subtraction game.n= 0,1 will be given the value 0 by the Sprague-Grundy function.n= 2,3 will be given thevalue 1, since 2 can be subtracted from each to result in 0 and 1, andn= 4,5 will be given thevalue 2, since 2 or 4 can be subtracted from either to result in 0,2 or 1,3. Becausen= 6 can eitherresult inn= 2 orn= 4 after one subtraction, neither of which have a SG number of 0, son= 6has an SG number of 0.n= 7 can result in either 0,3,or 5, after subtracting, which meansn= 7has an SG number of 3. Sincen= 8 can result in 1,4,or 6, which have SG numbers of 0,2,and 0respectively,n= 8 has an SG number of 1.n= 9 does not point to any of 0,1,or 6, and thus ithas a SG value of 0.n= 10 points to either 3,6,or 8, which have values of 1,0,1, respecitvely. Thus,n= 10 has anSG value of 2.n= 11 points to 4,7,9, which have SG values of 2,3,0, son= 11 has an SG valueof 1.n= 12 points to 5,8,10, none of which have an SG value of 0, son= 12 has an SG value of0.n= 13 points to 6,9,11, which have values of 0,0,1, son= 13 has an SG value of 2.n= 14points to 7,10,12, which haveSGvalues of 3,2,0, son= 14 has an SG value of 1.This is summarized in the table below:n01234567891011121314g(n)001122031021021We can characterize this pattern forn8 asg(x) =g(x) = 0x0(mod3)g(x) = 2x1(mod3)g(x) = 1x2(mod3)We can prove this using strong induction. For our base case, we show thatn= 8. . .14 all followthis pattern. This has already been verified above.Now suppose thatg(n) accurately describes the SG numbers forn= 8,9, . . . , k-1. We wishto show thatg(k) is correct. We have three cases.Suppose thatk0(mod3).Thenk-2,k-4, andk-7 have SG values of 2, 1, and 1,respectively, by modular arithmetic; therefore,n=kwill have an SG number of 0.Suppose thatk1(mod3).Thenk-2,k-4, andk-

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture