Docsity

CS 121 Computation Lab I - Lab 1 Directions and Problems - Prof. Bruce W. Char, Lab Reports of Computer Science

Toggle sidebar
bg1
2. 2.
1. 1.
• •
• •
1. 1.
• •
2. 2.
• •
Lab 1
CS 121 Computation Lab I
Fall 2008
Professor Bruce Char
Department of Computer Science
Drexel University
Lab 1 Directions and Problems
The instructor will introduce themselves and present a brief overview of course,
Maple, and the lab. (20-25 minutes)
Notes
Listen to the instructor's introduction and Maple demo. Be attentive to the details of the
demo as someone who will soon have to do those actions yourself.Ask questions if you want
clarification.
The lab staff will hand out verification sheets along with these directions. (In later weeks,
these directions will be posted on-line and you'll just read them from your partner's screen.)
With your lab partner, work on part 1, below. (20-25 minutes)
Problems -- Part 1
Sit down with your lab partner and if you haven't previously met, introduce yourself to them.
Write both of your names down on the verification sheet in the space provided:
All of the partners should log onto a computer. The lab staff will give a short demo of how
to do this.
Everyone should try doing the computations on their own computer. To gain more
confidence that you are getting the right answer, look at what your partners are getting. Get
their help if they appear to be more successful than you. Sometimes just talking about what
problems you are facing may produce useful insight towards overcoming them. If there is a
problem that you can't collectively resolve, call the lab staff over and get some help.
Write down the selected answers on the verification sheet. Have a staff member come over
to sign the verification sheet for part 1. Be prepared to show your work to the staff member,
and to explain how you got your answers. This is also the opportunity to clear up any
questions or uncertainties you may have at this point.
1.a) Get Maple to calculate the sum of 2+2. Presumably you will be able to tell whether or not
you got the right answer pretty easily.
b) What is exact fraction you get from adding together 1
2,1
3, and 1
4? What is exact fraction
you get from adding together 1
2,1
3, and 1
4? What about the sum of 1
2,1
3, 1
4,3
2,4
3 and
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download CS 121 Computation Lab I - Lab 1 Directions and Problems - Prof. Bruce W. Char and more Lab Reports Computer Science in PDF only on Docsity!

Lab 1

CS 121 Computation Lab I

Fall 2008

Professor Bruce Char Department of Computer Science Drexel University

Lab 1 Directions and Problems

The instructor will introduce themselves and present a brief overview of course,

Maple, and the lab. (20-25 minutes)

Notes

Listen to the instructor's introduction and Maple demo. Be attentive to the details of the demo as someone who will soon have to do those actions yourself.Ask questions if you want clarification. The lab staff will hand out verification sheets along with these directions. (In later weeks, these directions will be posted on-line and you'll just read them from your partner's screen.)

With your lab partner, work on part 1, below. (20-25 minutes)

Problems -- Part 1

Sit down with your lab partner and if you haven't previously met, introduce yourself to them. Write both of your names down on the verification sheet in the space provided: All of the partners should log onto a computer. The lab staff will give a short demo of how to do this. Everyone should try doing the computations on their own computer. To gain more confidence that you are getting the right answer, look at what your partners are getting. Get their help if they appear to be more successful than you. Sometimes just talking about what problems you are facing may produce useful insight towards overcoming them. If there is a problem that you can't collectively resolve, call the lab staff over and get some help. Write down the selected answers on the verification sheet. Have a staff member come over to sign the verification sheet for part 1. Be prepared to show your work to the staff member, and to explain how you got your answers. This is also the opportunity to clear up any questions or uncertainties you may have at this point.

1.a) Get Maple to calculate the sum of 2+2. Presumably you will be able to tell whether or not you got the right answer pretty easily.

b) What is exact fraction you get from adding together

, and

? What is exact fraction

you get from adding together

, and

? What about the sum of

and

? Note that if you are doing a calculation that is highly similar to a previous one, cutting and

pasting can save you some effort entering the second expression.

  1. Use Maple to perform the following exact calculations. To enter π, you can select the letter from the Common Symbols palette on the left hand side of the Maple window (it's a few segments below the Expression palette). Note that Maple does not regard Π as the same as π.

To enter e , the base of the natural logarithm, use the e a^ from the expression palette, or the e from the "Common Symbols" palette. Typing "e" from the keyboard unfortunately does not produce the same result -- that kind of e Maple will regard as an symbol for an algebraic unknown like x or y.

a)

C

b) sin

π 3

c) ln e^8 (You should get 2 2 .)

d) 1 C

C

(You should get 2.

e) log 55 >

i = 0

10 i (You should get 1 .)

  1. A state lottery allows you to pick six numbers from the numbers from 1 to 52 to win.

Use Maple exact arithmetic to calculate the exact odds of winning. This can be done by using

the "choose" function from the expression palette:

a b

means "the number of ways you can

choose b things from a things". For example, if the lottery asked you to pick three numbers

from the numbers from 1 to 6, the chances of winning would be 1 out of

  1. Calculate 2^3

4

. Note that 23

4 = 8^4 = 4096. Why doesn't Maple give that as its answer?

  1. Get Maple to reproduce this plot:

log 10 sin

x^2 C 1

x

K 1 0 1 2 3 4 5 6

K 20

K 10

Lab 1 , Problem 4 a

Maple TA demo by the instructor. (5 minutes)

Take Maple TA quiz 0 (5 minutes)

Notes

Maple TA requires a separate log in than Blackboard Vista or Drexel One. The userid should be your Drexel One userid (e.g. egk23) and the password should be your Drexel student ID number (e.g. 10096739). You can change your Maple TA password after you log in. To recapitulate what you are seeing in the demo, using Maple TA involves a) Entering the proper URL address into your web browser, and seeing the Maple TA front page. b) Selecting the proper course from the list provided. This list changes over the term, so be attentive to course announcements about changes. c) Logging into the course. d) Selecting the quiz you want to take. e) Answering the questions of the quiz. f) Hitting the "grade" button so that Maple TA records a score for you. If you don't do this when you are finished, then you may not receive credit for taking the quiz. If you forget to do this, you can log in again (any time up to the quiz deadline) and do it. g) Logging off Maple TA by hitting the red "x in a box" icon in the middle of the left hand side of the Maple TA quiz page. Quiz 1 will go up at the end of this week (September 26 and be due 5pm on Friday October 3.). This quiz will count towards your grade. You may take Quiz 1 at any time up until the deadline. You may take the quiz again as many times as you wish before the deadline.

The quiz server will only handle 70 simultaneous users and will turn away the excess, so don't wait until the last moment to take the quiz. You will be given credit for only that part of the quiz that you finish before the deadline.

If there is a catastrophic system failure, the deadline will be adjusted. An announcement will be made on Blackboard and the course website.

6.6. Extra credit problem (If you finish part 2 early)

Problem -- extra credit

Do this for Lab extra credit if you have finished parts 1 and 2 with plenty of time to spare. In general, doing extra credit will bump your score for this lab beyond 100%. The final grade for the course includes the weighted sum of lab grades for this course, so by doing extra credit you will be smoothing out any deficiencies you may be incurring in other parts of the course such as the exam or the quizzes.

Unless stated otherwise, extra credit is available only if done in the student's assigned lab session, and is not available in make-up labs. It may be possible to get partial extra credit even if you do not completely finish the extra credit work.

Explore a mathematical phenomenon jotting notes and observations as you go. In a fresh Maple document, show the trail of your computation and your written explanation of what you found and how you found it.

Here's the problem. Consider the following sequence of expressions:

2 C
2 C
2 C

What is the next fraction in this sequence?

What is the next one after that?

Can you predict what the next one after that is without computing it first? Write down your prediction and your reasons for it.

Problem -- extra extra credit

If you've finished the extra credit problem, this one may take a little longer to do. It is meant for people who already know something about recursive programming or recurrence relations -- or who are superaccurate typists.

What is the 47th number in the sequence? (We aren't interested in approximations, we want the exact fraction .) If you've finished the extra credit problem in the lab, then come back in two weeks with the answer to this problem and an explanation of how you can with just a little more computer time and no more typing get almost any number in the sequence, and you will get three points extra extra credit.

You will get five points extra extra credit if you use Maple to get the 47th number, or any other number in the sequence.