lab_13_worksheet

docx

School

Langara College *

*We aren’t endorsed by this school

Course

1050

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

7

Uploaded by GrandGuineaPig4093

Report
Lab 13: Chapter 18, Limitations of Computing. Lab23_Manual.pdf, Limitations of Computing. [100 marks] In all of the problems, you must show your work to qualify for the mark. Type your answer in this worksheet after each question. Submit the PDF version of the completed worksheet with D2L. Lab Readings 1. Chapter 18 – Limitations of Computing 2. Lab 23 Limitations of Computing (Lab23_Manual.pdf) 3. The file Lab_13_Big_O_And_Some_Note.docs which is on D2L as part of this Lab. NOTES The Traveling Sales Person Applet has issues with some of the questions. Do those parts by hand. The Plotter @   https://www.desmos.com/calculator works better than the Plotter Applet. Use the on-line Plotter. Lab Questions Lab 23 Limitations of Computing (Lab23_Manual.pdf) 1. [15] Exercise 1 Value of N when N^N says too big:17. Value of N when N! says too big:23. Value of N when 2^N says too big:66.
f(N)=1000000.0 O (1) f(N1) =500*(N+5) O (1) f(N2) =N*N/100 O(N 2 ) When N= 1, f(N) gives the biggest answer i.e 1000000.0 When N= 3000, f(N1) gives the biggest answer i.e 1502500 When N= 100000, f(N) gives the biggest answer i.e 100000000 The first function is not affected by the value of N because it has no variable in it and is just constant. No function is always larger than the other because they have different equation, and they act according to their own equation. 2. [15] Exercise 2 3. [15] Exercise 3 4. [10] Exercise 4
5. [5] Exercise 5 6. [5] Exercise 6, do Not do Deeper Investigation [5 marks] Stand Alone Exercises Loop/Repetition, Selection/Decision In the following Comments are preceded by “//”: //This is a comment
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1. [7] Convert the following for-loop, which is in pseudocode, to a while-loop in C++ syntax, test and provide what the output will be. Type or copy/paste your code here.You can attach a screen shot of the output or type what the output will be. sum = -5 for (i = 0 to 10) //default step is 1 if (i is even) sum = sum + i else sum = sum + 1 Display “sum is “ + sum
2. [8] What will be the exact output when the following pseudocode is executed count = -2 jj = 16 while (jj > 0) kk = 1 while (kk <= 7 ) if (kk equals jj) count = count + 1 kk = kk + 1 end while jj = jj - 2 end while Display “count = “ + count
Order of Growth, Big-O Notation Reference: See the file Lab_13_Big_O_And_Some_Note.docs which is on D2L as part of this Lab. Find the order of growth of each function and show it in Big-O notation. [5 marks each] 3. f ( n )= 200 n 2 + n 3 + 560 n 2 log n 4. f ( n )= 200 n 2 + n 3 + 560 n 2 log n n 2 5. f ( n )= 200 n 2 + n 3 + 560 n 2 log n n 3 6. f(n) = 200 n 2 + n 3 + 560 n 2 logn n 3 + 13
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Submit the PDF version of the completed worksheet with D2L