Consider the change-counting program

Assignment Help Basic Statistics
Reference no: EM131043177

Consider the change-counting program of section 1.2.2. It would be nice to be able to easily change the currency used by the program, so that we could compute the number of ways to change a British pound, for example. As the program is written, the knowledge of the currency is distributed partly into the procedure first-denomination and partly into the procedure count-change (which knows that there are five kinds of U.S. coins). It would be nicer to be able to supply a list of coins to be used for making change.

We want to rewrite the procedure cc so that its second argument is a list of the values of the coins to use rather than an integer specifying which coins to use. We could then have lists that defined each kind of currency
(define us-coins (list 50 25 10 5 1)) (define uk-coins (list 100 50 20 10 5 2 1 0.5))

We could then call cc as follows:
(cc 100 us-coins) 292
To do this will require changing the program cc somewhat. It will still have the same form, but it will access its second argument differently, as follows:

1836_kk.jpg

Define the procedures first-denomination, except-first-denomination, and nomore? in terms of primitive operations on list structures. Does the order of the list coin-values affect the answer produced by cc? Why or why not?

 

Reference no: EM131043177

Questions Cloud

Venture capital than in other types of investment : Explain liquidity risk and relate it specifically to venture capital. Do you believe that liquidity risk is more important or crucial in venture capital than in other types of investment? Explain.
Organization strategic and operational concerns : How can risk managers help bridge the gap between an organization's strategic and operational concerns?
Method of performance measurement : ________________________ is a method of performance measurement that uses several statements describing each attribute to produce a final score for that attribute
What is iriss after-tax cash flow this year from investment : Iris pays 15% in dividends and capital gains taxes and 35% in ordinary income taxes. What is Iris's after-tax cash flow this year from this investment?
Consider the change-counting program : Consider the change-counting program of section 1.2.2. It would be nice to be able to easily change the currency used by the program, so that we could compute the number of ways to change a British pound, for example.
Full subsidizing for his examination : Dr. Phil Hayes has gotten an offer of full subsidizing for his examination on another medication fabricated by Eli Mentin. The medication would be a contender for Prozac without the addressed symptoms of conceivable vicious conduct.
What is the effective annual rate and shop report : Ricky Ripov’s Pawn Shop charges an interest rate of 16 percent per month on loans to its customers. Like all lenders, Ricky must report an APR to consumers. Requirement 1: What rate should the shop report? What is the effective annual rate?
Account of the usage of the medicare and medicaid programs : Insight Enterprises, Inc. (IE) is a multinational social insurance venture with 143 healing centers on four mainlands. IE was begun by Richard K. Eamer, an expense lawyer, in the 1960s. Eamer's advancement of IE was conceivable on account of the u..
Make monthly deposits-retirement account : You are to make monthly deposits of $750 into a retirement account that pays 10 percent interest compounded monthly. Required: If your first deposit will be made one month from now, how large will your retirement account be in 34 years?

Reviews

Write a Review

Basic Statistics Questions & Answers

  Select the appropriate gain to minimize the quantization

a 12-bit ad converter has an input range of plusmn 10 v and is connected to an input amplifier with a programmable gain

  In a random telephone survey to estimate the proportion of

in a random telephone survey to estimate the proportion of households with a personal computer 720 out of 960

  In conducting a survey what do you think is even more

in conducting a survey what do you think is even more important than the size of the sample?

  What is the probability that both students are math majors

The distracted group had an average score that was 10 points lower than the average for the control group. Explain why it is important that the researchers created the two experimental groups in this study by using random assignment.

  Distance and midpoint

Solve for the following items: The point on the x-axis that is equidistant (equal distance)from (10,4) and (6,2).

  Hypothesis test for two population means test

Test the hypothesis that there is no difference in the mean scores of Exam 1 and Exam 2 against the alternative that the average is  greater  for the second exam.

  One point on an interstate highway

A traffic study at one point on an interstate highway shows that vehicle speeds are normally distributed with a mean of 61.3 mph and a standard deviation of 3.3 mph.

  This means that spending a longer amount of time in prison

suppose there is a correlation of 0.87 between the length of time a person is in prison and the amount of aggression

  Describe the economic rationales for various types of

q1. what are the economic rationales for different types of government intervention in health care?q2. explain the

  There are 6 types of rolls available in a bakery in

provide a detail explanation for every case1. there are 6 types of rolls available in a bakery in quantities of dozens

  Describe the problem and present the data

The financial team has assembled to review labor data for a new engine. Designed for efficiency, the new engine's power to weight ratio and low drag geometry promised great things. Dashiell kicked off the meeting. "Folks, this is radical. For the ..

  Solution satisfying initial conditions

Find the unique solution satisfying initial conditions y(1)=0 and y'(1)=1 for

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd