CSC 170 Introduction to Numerical Methods Student Name Answer Key Sample Test 1 Section ___ Date _______ All problems are worth 10 points for a total of 100 points. (1) Assuming that the following URL is a valid internet address, match the correct address component with the letters A through F . http://D.C.A/E/B#F (2) E directory A C domain B B file C F internal link D D server E A suffix F Match the UNIX command on the left with the correct description on the right. (A) rm (A) delete a file from within a directory (H) pwd (B) a full - screen UNIX editor (E) mv (C) travel to a directory within the file hierarchy (D) mkdir (D) create a directory in the file hierarchy (G) man (E) modify the name or directory location of a file (F) ls (F) display file names within a directory (J) exit (G) display online information about a command (B) emacs (H) display the entire path to the current directory (I) cp (I) create a copy of a file in a different directory or under a different name (C) cd (J) logout from current shell session (C) Copyright 2005 by P.E.P. Page 1 of 5 CSC 170 Introduction to Numerical Methods Sample Test 1 Student Name Answer Key (3) Section ___ Date _______ List 4 software tools that can be used to create a Web page. MS FrontPage, MS Visual Studio, Macromedia Dreamweaver, Notepad, MS Expression, Netscape Composer (4) What is the purpose of the information that is placed in the <BODY> area of a web page? This is the actual information, data, words, that are within the Web page and are displayed to the user. (5) Define the following acronyms. TCP / IP MPEG TCP / IP GIF FTP URL HTML WWW Transmission Control Protocol / Internet Protocol ( a means by which we transfer Web Page and file information ) Motion Pictures Experts Group ( a graphics file format ) Graphics Interchange Format ( a graphics file format ) File Transfer Protocol ( one of the TCP / IP protocols ) Uniform Resource Locator ( an Internet Web site address ) Hypertext Markup Language ( the language of the Internet ) World Wide Web ( formed in 1989 ) MPEG GIF FTP URL HTML WWW For the next four problems, you must show the calculations that lead to your answer. One - half credit will be awarded for your work and one-half credit will be awarded for your answer. (6) Express in decimal, the binary number 101101.1101 . 1 25 32 0 24 16 1 23 8 1 22 4 0 21 2 1 20 1 . . . 1 2 1 1/2 1 2 2 1/4 0 2 3 1/8 1 2 4 1 / 16 32 + 8 + 4 + 1 . 1 / 2 + 1 / 4 + 1 / 16 45.8125 (7) Express in binary, the decimal number 324.8125000 . From the prior problem, we know that 0.81250 refers to decimal binary 1101. Hence we only have to convert the integer portion, namely 324 . 1 28 256 0 27 128 1 26 64 0 25 32 0 24 16 0 23 8 1 22 4 0 21 2 0 20 1 324 – 256 = 68 68 – 64 = 4 Hence, our answer is : 101000100.1101 (C) Copyright 2005 by P.E.P. Page 2 of 5 Introduction to Numerical Methods CSC 170 Sample Test 1 Student Name Answer Key (8) Section ___ Date _______ Show how the decimal number 3,162 would be expressed as a 16 - bit binary integer. 0000 1 2 11 2048 (9) 1 2 10 1024 0 29 512 0 28 256 1100 0 27 128 1 26 64 0101 0 25 32 1010 1 24 16 1 23 8 0 22 4 1 21 2 0 20 1 Show how the decimal number 3,162 would be expressed as a 16 - bit binary integer using two's complement notation. Step 1 is to write the original decimal number in a binary number format 0000 1100 0101 1010 Step 2 is to change the numbers: a 1 becomes a 0, a 0 becomes a 1 1111 0011 1010 0101 Step 3 add 1 to the result in Step 2 above 1111 0011 1010 0110 http://www.vb-helper.com/tutorial_twos_complement.html (10) Verify the result. Convert the hexadecimal number 3B7A into a decimal number. 3B7A 3 16 3 3 * 4096 = 12288 B 16 2 11 * 256 = 2816 7 16 1 7 * 16 = 112 A 16 0 10 * 1 = 10 12288 + 2816 + 112 +10 = 15,226 Hexadecimal Decimal 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (C) Copyright 2005 by P.E.P. Page 3 of 5 CSC 170 Introduction to Numerical Methods Student Name Answer Key Sample Test 1 Section ___ Date _______ For questions (11) - (15) , consider the exponential growth model: y N 0 e (11) Re - write the y N 0 e y m N 0e (12) (13) . such that it satisfies the point ( x m , y m ) . kxm Re - write the y N 0 e y n N 0e kx kx kx such that it satisfies the point ( x n , y n ) . kxn Given your answer for (11) , take the natural logarithms of both sides transforms this to a linear equation. ln ( y m ) ln ( N 0 e k x m ) ln ( y m ) ln ( N 0 ) ln ( e k x m ) ( since the logarithm of a product is the sum of the logarithms ) ln ( y m ) ln ( N 0 ) k x m ( since the natural logarithm of a base e expression just the exponent ) (14) Given your answer for (12) , take the natural logarithms of both sides transforms this to a linear equation. ln ( y n ) ln ( N 0 e k x n ) ln ( y n ) ln ( N 0 ) ln ( e k x n ) ( since the logarithm of a product is the sum of the logarithms ) ln ( y n ) ln ( N 0 ) k x n ( since the natural logarithm of a base e expression just the exponent ) (15) Given your answers for (13) and (14) , rearrange the system of equations to solve for k. ln ( y m ) ln ( N 0 ) k x m ln ( y n ) ln ( N 0 ) k x n subtracting the above equations yields ln ( y m ) ln ( y n ) k x m k x n or ln ( y m ) ln ( y n ) k ( x m x n ) (C) Copyright 2005 by P.E.P. Page 4 of 5 CSC 170 Introduction to Numerical Methods Student Name Answer Key Sample Test 1 Section ___ Date _______ or k ( x m x n ) ln ( y m ) ln ( y n ) from which k ( ln ( y m ) ln ( y n ) ) / ( x m x n ) (C) Copyright 2005 by P.E.P. Page 5 of 5