Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Converting recurrence into matrix

Revision en6, by tatya_bichu, 2018-03-25 10:19:44

Solving Problem , I got recurrence as f(n)= @f((n+1)/2) + @f(n-1) ,here @ denotes negation, f(x) is 0 if player with x stones loose and 1 if player left with x stones wins.As n can be high as 1018 so matrix exponentiation would do this,

| @ @ | x | f(n) | = | f(n+1) |
| 1 0 | | f(n/2+1) | | f(n) |

but I am unable to do algebra with this @ operation.

Tags #dynamic-programming, #matrix exponentialtion, large inputs, pattern

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English tatya_bichu 2018-03-25 10:19:44 2 Tiny change: 'with this ~ operation' -> 'with this @ operation'
en5 English tatya_bichu 2018-03-25 10:18:24 32
en4 English tatya_bichu 2018-03-25 10:17:27 4
en3 English tatya_bichu 2018-03-25 10:16:18 4 Tiny change: '1 0 | | f(n/2+1) | | f(n)' -> '1 0 | | f(n/2+1) | | f(n)'
en2 English tatya_bichu 2018-03-25 10:15:50 4
en1 English tatya_bichu 2018-03-25 10:15:24 481 Initial revision (published)