Skip to main content

Pseudocode - New Year's eve

Write algorithm using pseudocode for one of the following actions: Counting down to a the following New Year’s eve in days, hours, minutes, and seconds

Comments

Popular posts from this blog

Osmosis Data Sheet

Data Sheet: Activity - Osmosis Name Course Date Activity Data Code       Procedure I -Test Solution 1: Water Complete the tablesand questions below using your data and information found under the Background tab Data Table I Note: Difference in Final Volumes = Final Volume of Test Sol - Final Volume of Water Trial Starting Volume of Test Solution (L) Starting Volume of Water (L) Final Volume of Test Solution (L) Final Volume of Water (L) Difference in Final Volumes (L) 1 1.28 1.75 1.51 1.52 -0.01 2 1.28 2.00 1.64 1.64 0 Observations and Questions [1] Given that the final heights (and volumes) are the same for the water and test solution, what can you...

Pseudocode - painting a wall

My pseudocode from Module Two: Pseudocode – Painting a Wall MEASURE wall-length MEASURE wall width CALCULATE wall area DETERMINE amount of paint needed for wall-size PURCHASE desired paint and tools (brushes, rollers, pan, etc.) PREPARE work area and tools START painting wall END when painting is complete CLEAN work area and tools STORE tools and any leftover pa​‌‌‌‌‌‌‍‍‍‌‌‍‍‍‌‍‌‍‍​int
Question: prove by induction 2^2 + 4^2 + 6^2 + ... + (2n)^2 = (2n)(2n+1)(2n+2)/6 ANSWER we will use induction on n base case : n=1 we have, 2^2 = 2*3*4/6 = 4 which is true inductive hypothesis let it be true for n = k i.e.,  2^2 + 4^2 + ... + (2k)^2 =   [(2k)(2k+1)(2k+2)]/6 inductive case let n = k+1 then we have 2^2 + 4^2 + .... + (2k)^2 + (2(k+1))^2 =   [(2k)(2k+1)(2k+2)]/6 + (2k+2)^2 =(2k+2)*[(2k)(2k+1)/6 + (2k+2)] =(2k+2)*[ (4k^2+2k)/6 + (12k + 12)/6 ] =(2k+2)*[ (4k^2+14k+12)/6 ] = =(2k+2)*[(2k)(2k+1)/6 + (2k+2)] =(2k+2)*[ (4k^2+2k)/6 + (12k + 12)/6 ] =(2k+2)*[ (4k^2+14k+12)/6 ] = (2k+2)*[ (4k^2 + 8k + 6k + 12)/6 ] = (2k+2)*[ (4k(k + 2) +6(k+2))/6 ] = (2k+2)*[ (4k+6)(k+2)/6 ] =  (2k+2)*[ 2 (2k+3)(k+2)/6  ] =   (2k+2)*[  (2k+3)*2*(k+2)/6  ] =   (2k+2)*[  (2k+3)(2k+4)/6  ] = [(2*(k+1))(2*(k+1)+1)(2*(k+1)+2)]/6 replacing k+1 by m, we get replacing k+1 by m, we get [(2*m)(2*m+1)(2*m+2)]/6 this completes our proof b...