This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: % %% Problem 3 % f = n; f while(f ~= 0) digit = rem(f,10); f = floor(f/10); disp(digit) end e type revint t revint(15601) revint(9834672) revint(1011) r %% Problem 4 % type pascal_row t pascal_row(10) pascal_row(20) p %% Problem 5a % %Since S(N+1) is the total number of moves for the first configuration, %we must sum the total number of moves in the following manner: %S(N) + 1 + S(N) = 2*S(N) + 1. This only makes sense due to the amount of %configurations there are.Therefore, S(N+1) = 2*S(N) + 1. % %% Problem 5b % type towersteps t towersteps(1) towersteps(2) towersteps(3) towersteps(10) towersteps(64) t %% Problem 5c % seconds_in_one_year = 60*60*24*365; end_of_world = (towersteps(64)) / seconds_in_one_year e %% Problem 5d % type towers t towers(3,1,2) towers(4,1,2) t %% Problem 6 % type elect t elect(1:7) elect(1:10) elect(1:57)...
View Full Document
This note was uploaded on 02/18/2010 for the course ENGINEERIN 7 taught by Professor Patzek during the Spring '08 term at University of California, Berkeley.
- Spring '08