I really need help with this python programming assignment
Program Requirements
For part 1, I need a program with 2 functions specifically these
• fib(): Takes a single integer argument num terms greater than or equal to 1 and for each
of the num terms terms of the Fibonacci sequence prints 1) the number of the term—i.e., 1,
2, 3…, 2) the corresponding Fibonacci number, and 3) the ratio of the current and previous Fibonacci
numbers as shown below. The ratio, printed only for x1 and higher, is an approximation
of the golden ratio = 1.61803398875…
• main(): Prompts the user for the number of terms s/he wants to find and calls the void function
fib().
The program giving the following output
1 Enter the number of terms you want to find: 2
2 1 1
3 2 1 1.0
1 Enter the number of terms you want to find: 9
2 1 1
3 2 1 1.0
4 3 2 2.0
5 4 3 1.5
6 5 5 1.66666666667
7 6 8 1.6
8 7 13 1.625
9 8 21 1.61538461538
10 9 34 1.61904761905
The last line of your program should be a call to main(). Don’t forget to include docstrings!
How many terms are needed to obtain an approximation to the golden ratio accurate to 4 decimal
places?
Program Requirements
For part 2,i need the following functions
• get floats(): It take a single integer argument and returns
a list of floats. where it was something like this
def get_floats(n):
lst = []
for i in range(1,n+1):
val = float(input(‘Enter float ‘+str(i)+’: ‘))
lst.append(val)
return lst
• summer(): This non-void function takes a single list argument, and returns the sum of the
list. However, it does not use the sum() function to do so. See “Summing Values the Hard
Way” below for instructions on how to implement this function.
• average(): This non-void function uses the list of numbers returned by get floats() as
its argument and returns the average value, a float, to the calling program. It calls summer()
to sum the values in the list. Its body can actually be a single line: a return statement followed
by the appropriate expression. See the notes below on “Calculating Averages.”
• std dev(): This non-void function takes two arguments, the list of numbers obtained by
get floats() and the average obtained using average(), and returns the standard deviation,
a float value. The function should initialize an accumulator to zero and then use a
for-loop in which the average is subtracted from the list value and the result is squared and
added to the accumulator. After the for-loop has finished looping, the accumulator should be
divided by the number of elements in the list, the square root taken, and the result returned to
the calling function. See the notes below on “Calculating Standard Deviations.”
• main(): Finally, write the void function main(). It should prompt a user for the number
of elements desired in the list and should call the non-void functions get floats(),
average(), and std dev(). Then it should print the average and standard deviation to the
screen. Use the round() function to round off the standard deviation to two decimal places.
Summing Values the HardWay1
summer() takes a single list argument. First you need to initialize an accumulator to zero, then
use a for-loop to add the value of each element in the list, and finally return the total sum to the
calling program. The proper behavior of summer() is demonstrated below.
1The easy way is to use the built-in function sum().
5
1 >>> x = [9, 3, 21, 15]
2 >>> summer(x)
3 48
4 >>> summer([31.12, -16.32, 24.9, 82.0, 14.0])
5 135.7
Calculating Averages
Recall that the average of a list of numbers is simply the sum of the values divided by the number of
values. Mathematically, for a set of numbers x1, x2, · · ·, xN, the average is given by
¯x =
1
N
(x1 + x2 + · · · + xN)
where N is the number of terms in the list. The average, or mean, is often indicated by an overbar—
i.e., ¯x indicates the average of a set of numbers xk. The average is also given by
¯x =
1
N
XN
k=1
xk
where the uppercase Greek letter Sigma () means perform a sum. The expression to the right of
Sigma is what is to be summed. The expression below Sigma initializes a summation index (in this
case k) and the term above Sigma indicates the final value of the summation index.
Calculating Standard Deviations
The standard deviation is a measure of how much fluctuation or deviation there is in a set of numbers
after the average has been subtracted from each of the values2. If all the values in a list are equal to
the average, then the standard deviation is zero. If the standard deviation is large, then it means many
values deviate considerably from the average. The standard deviation is represented by the lowercase
Greek letter sigma (). For a set of numbers x1, x2, · · ·, xN, the standard deviation is given by
=
s
1
N
[(x1 − ¯x)2 + (x2 − ¯x)2 + · · · + (xN − ¯x)2]
where ¯x is the average. Recall that in Python we can square a value z using z ** 2 and we can
calculate the square root using z ** 0.5.
The following three examples demonstrate the results you should obtain for three different sets of
input for your stats.py program. Each of these has the same mean but an increasing standard
deviation. In the first, all the values are the same and hence the standard deviation is zero.
1 Enter the number of list elements: 5
2 Enter float 1: 50
2For further discussion of standard deviation, see <http://en.wikipedia.org/wiki/Standard_deviation>.
6
3 Enter float 2: 50
4 Enter float 3: 50
5 Enter float 4: 50
6 Enter float 5: 50
7 Average = 50.0
8 Standard deviation = 0.0
Here the values are spread out, spanning the range 30 to 70:
1 Enter the number of list elements: 5
2 Enter float 1: 30
3 Enter float 2: 40
4 Enter float 3: 50
5 Enter float 4: 60
6 Enter float 5: 70
7 Average = 50.0
8 Standard deviation = 14.14
In the final example the values range between 10 and 90:
1 Enter the number of list elements: 5
2 Enter float 1: 10
3 Enter float 2: 30
4 Enter float 3: 50
5 Enter float 4: 70
6 Enter float 5: 90
7 Average = 50.0
8 Standard deviation = 28.28
Don’t forget to include docstrings in all your functions!
please double check the indentations
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Preview File Edit View Go Tools Window Help Q Chem 232 Expt 3plq Pdf 1 Page 4
/in Uncategorized /by developercan you please help me to solve these problems. am having difficulty to solve these problems
i Preview File Edit View Go Tools Window Help Q CHEM 232- Expt#3PLQ.pdf (1 page) $47“ ‘ ® Q Search . How would you separate compounds A, B, C and D below and they were mixed using an extraction experiment. Assume the compounds are soluble in dichloromethane and youhave at your disposal HCl, NaOH, NaHCOs. Show your answer in a form of flow chartand include all steps including which layer is which. (12 points) 0 OOCHOH I OH 3N/A B C D . A student had a mixture of benzoic acid and benzil in acetone. He wanted to separate the two compounds using extraction. Would he be able to? If so what procedure would he use? If not, explain why? (4 points) . Space X had just successfiilly docked in the international space station. Besides Ripley, the “astronaut” on board, an extraction experiment was sent to the space station to becompleted for comparison purposes. The experiment was identical to the one youperformed in lab. Would the scientist in the space station be able to perform the experiment if they have all the reagents and necessary glassware? Explain. (4 pts) m Sun’12249PM Q 0 EE MATLABiRZO’I 3b Calendar chlrpsrcsv Screen Shut2019-02…0.56 PM
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Push A 16 5 Kg Box Across A Floor Which Has A Kinetic Frictional Force Of Ff 2
/in Uncategorized /by developerI push a 16.5-kg box across a floor, which has a kinetic frictional force of Ff = 27.5 N. If my push of FA = 32 N gives it an acceleration of 0.35 m/s2 , what is the coefficient of kinetic friction?
Equation(s) to use?
Final Solution?
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Read An Article About That In Order To Determine K For Their Equilibrium At Di
/in Uncategorized /by developerI read an article about that in order to determine K for their equilibrium at different temperatures they needed to know the concentrations of all their reactants and products. They didn’t explain mathematically how they determined the concentrations of each species at the different temperatures. I am wondering if there was any math involved, if so did they assume their determinations were temperature independent and why. If so, isn’t this a problem and did they compensate?
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Do Not Understand This Still Please Explain G Is Related To One Of The
/in Uncategorized /by developerI really do not understand this still. Please explain.
g is related to one of the parent functions f . (a). Identify the parent function f. (b) Describe the sequence of transformations from f to g. (c). Sketch the graph of g. (d). Use the function notation to write in terms of f.
g(x)= -[ x +4 ] + 5 (NOTE: Brackets are really the ABSOLUTE symbol.)
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Need Help With How To Get There Any Thoughts About That
/in Uncategorized /by developer"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Need Help With My Math
/in Uncategorized /by developerI really need help with my math!
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Need Help With Questions Based On The Following Readings William Cronon
/in Uncategorized /by developerI REALLY need help with questions based on the following readings William Cronon’s “The Trouble with Wilderness” and David Foster Wallace’s “Consider the Lobster”.read over the Study questions below and respond to each. Quote examples to support your answers.
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Need Help With These Questions The Rambler Samuel Johnson 1709 1784 Dis
/in Uncategorized /by developerI REALLY need help with these questions
The Rambler, Samuel Johnson (1709-1784) discusses the subject of envy.
1. How does Samuel Johnson use rhetorical strategies and stylistic devices to convey his views about the role of envy in the lives of people in his time?
2.Pick two rhetorical strategies or stylistic devices and respond with a paragraph to each strategy/device.
Thank you so much in advance!!!
The hostility perpetually exercised between one man and another, is caused by the desire of many for that which only few can possess. Every man would be rich, powerful, and famous; yet fame, power, and riches are only the names of relative conditions, which imply the dependence, and poverty of greater numbers.
This universal and incessant competition produces injury and malice by two motives, interest and envy; the prospect of adding to our possessions what we can take from others, and the hope of alleviating the sense of our disparity by lessening others, though we gain nothing to ourselves.
Of these two malignant and destructive powers, it seems probable at the first view, that interest has the strongest and most extensive influence. It is easy to conceive that opportunities to seize what has been long wanted, may excite desires almost irresistible; but surely the same eagerness cannot be kindled by an accidental power of destroying that which gives happiness to another. It must be more natural to rob for gain, than to ravage only for mischief.
Yet I am inclined to believe, that the great law of mutual benevolence is oftener violated by envy than by interest, and that most of the misery which the defamation of blameless actions, or the obstruction of honest endeavours, brings upon the world, is inflicted by men that propose no advantage to themselves but the satisfaction of poisoning the banquet which they cannot taste, and blasting the harvest which they have no right to reap.
Interest can diffuse itself but to a narrow compass. The number is never large of those who can hope to fill the posts of degraded power, catch the fragments of shattered fortune, or succeed to the honors of depreciated beauty. But the empire of envy has no limits, as it requires to its influence very little help from external circumstances. Envy may always be produced by idleness and pride, and in what place will they not be found?
Interest requires some qualities not universally bestowed. The ruin of another will produce no profit to him who has not discernment to mark his advantage, courage to seize, and activity to pursue it; but the cold malignity of envy may be exerted in a torpid and quiescent state, amidst the gloom of stupidity, in the coverts of cowardice. He that falls by the attacks of interest, is torn by hungry tigers; he may discover and resist his enemies. He that perishes in the ambushes of envy, is destroyed by unknown and invisible assailants, and dies like a man suffocated by a poisonous vapor, without knowledge of his danger, or possibility of contest.
Interest is seldom pursued but at some hazard. He that hopes to gain much, has commonly something to lose, and when he ventures to attack superiority, if he fails to conquer, is irrecoverably crushed. But envy may act without expense or danger. To spread suspicion, to invent calumnies, to propagate scandal, requires neither labor nor courage. It is easy for the author of a lie, however malignant, to escape detection, and infamy needs very little industry to assist its circulation.
Envy is almost the only vice which is practicable at all times, and in every place; the only passion which can never lie quiet for want of irritation: its effects therefore are everywhere discover able, and its attempts always to be dreaded.
It is impossible to mention a name which any advantageous distinction has made eminent, but some latent animosity will burst out. The wealthy trader, however he may abstract himself from public affairs, will never want those who hint, with Shylock, that ships are but boards. The beauty, adorned only with the unambitious graces of innocence and modesty, provokes, whenever she appears, a thousand murmurs of detraction. The genius, even when he endeavors only to entertain or instruct, yet suffers persecution from innumerable critics, whose acrimony is excited merely by the pain of seeing others pleased, and of hearing applause’s which another enjoys.
The frequency of envy makes it so familiar, that it escapes our notice; nor do we often reflect upon its turpitude or malignity, till we happen to feel its influence. When he that has given no provocation to malice, but by attempting to excel, finds himself pursued by multitudes whom he never saw, with all the implacability of personal resentment; when as a public enemy, and incited by every stratagem of defamation; when he hears the misfortunes of his family, or the follies of his youth, exposed to the world; and every failure of conduct, or defect of nature, aggravated and ridiculed; he then learns to abhor those artifices at which he only laughed before, and discovers how much the happiness of life would be advanced by the eradication of envy from the human heart.
Envy is, indeed, a stubborn weed of the mind, and seldom yields to the culture of philosophy. There are, however, considerations, which, if carefully implanted and diligently propagated, might in time overpower and repress it, since no one can nurse it for the sake of pleasure, as its effects are only shame, anguish, and perturbation.
It is above all other vices inconsistent with the character of a social being, because it sacrifices truth and kindness to very weak temptations. He that plunders a wealthy neighbor gains as much as he takes away, and may improve his own condition in the same proportion as he impairs another’s; but he that blasts a flourishing reputation, must be content with a small dividend of additional fame, so small as can afford very little consolation to balance the guilt by which it is obtained.
I have hitherto avoided that dangerous and empirical morality, which cures one vice by means of another. But envy is so base and detestable, so vile in its original, and so pernicious in its effects, that the predominance of almost any other quality is to be preferred. It is one of those lawless enemies of society, against which poisoned arrows may honestly be used. Let it therefore be constantly remembered, that whoever envies another, confesses his superiority, and let those be reformed by their pride who have lost their virtue.
It is no slight aggravation of the injuries which envy incites, that they are committed against those who have given no intentional provocation; and that the sufferer is often marked out for ruin, not because he has failed in any duty, but because he has dared o do more than was required.
Almost every other crime is practiced by the help of some quality which might have produced esteem or love, if it had been well employed; but envy is mere unmixed and genuine evil; it pursues a hateful end by despicable means, and desires not so much its own happiness as another’s misery. To avoid depravity like this, it is not necessary that any one should aspire to heroism or sanctity, but only that he should resolve not to quit the rank which nature assigns him, and wish to maintain the dignity of a human being
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Need Help With This Example To Understand How To Solve Future Problems
/in Uncategorized /by developerI really need help with this example to understand how to solve future problems:
Brady Self
Storage purchased land, paying $ 190,000 cash as a down payment and signing a $180,000 note payable for the balance. Brady also had to pay delinquent property tax of $ 5,500, title insurance costing $ 4 ,000, and $ 11,000 to level the land and remove an unwanted building. The company paid $ 59, 000 to add soil for the foundation and then constructed an office building at a cost of $ 550, 000. It also paid $ 53,000 for a fence around the property, $ 20,000 for the company sign near the property entrance, and $ 5,000 for lighting of the grounds.
What is the capitalized cost of each of Brady’s land, land improvements, and building?
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
I Really Need Help With This Python Programming Assignment Program Requirements
/in Uncategorized /by developerI really need help with this python programming assignment
Program Requirements
For part 1, I need a program with 2 functions specifically these
• fib(): Takes a single integer argument num terms greater than or equal to 1 and for each
of the num terms terms of the Fibonacci sequence prints 1) the number of the term—i.e., 1,
2, 3…, 2) the corresponding Fibonacci number, and 3) the ratio of the current and previous Fibonacci
numbers as shown below. The ratio, printed only for x1 and higher, is an approximation
of the golden ratio = 1.61803398875…
• main(): Prompts the user for the number of terms s/he wants to find and calls the void function
fib().
The program giving the following output
1 Enter the number of terms you want to find: 2
2 1 1
3 2 1 1.0
1 Enter the number of terms you want to find: 9
2 1 1
3 2 1 1.0
4 3 2 2.0
5 4 3 1.5
6 5 5 1.66666666667
7 6 8 1.6
8 7 13 1.625
9 8 21 1.61538461538
10 9 34 1.61904761905
The last line of your program should be a call to main(). Don’t forget to include docstrings!
How many terms are needed to obtain an approximation to the golden ratio accurate to 4 decimal
places?
Program Requirements
For part 2,i need the following functions
• get floats(): It take a single integer argument and returns
a list of floats. where it was something like this
def get_floats(n):
lst = []
for i in range(1,n+1):
val = float(input(‘Enter float ‘+str(i)+’: ‘))
lst.append(val)
return lst
• summer(): This non-void function takes a single list argument, and returns the sum of the
list. However, it does not use the sum() function to do so. See “Summing Values the Hard
Way” below for instructions on how to implement this function.
• average(): This non-void function uses the list of numbers returned by get floats() as
its argument and returns the average value, a float, to the calling program. It calls summer()
to sum the values in the list. Its body can actually be a single line: a return statement followed
by the appropriate expression. See the notes below on “Calculating Averages.”
• std dev(): This non-void function takes two arguments, the list of numbers obtained by
get floats() and the average obtained using average(), and returns the standard deviation,
a float value. The function should initialize an accumulator to zero and then use a
for-loop in which the average is subtracted from the list value and the result is squared and
added to the accumulator. After the for-loop has finished looping, the accumulator should be
divided by the number of elements in the list, the square root taken, and the result returned to
the calling function. See the notes below on “Calculating Standard Deviations.”
• main(): Finally, write the void function main(). It should prompt a user for the number
of elements desired in the list and should call the non-void functions get floats(),
average(), and std dev(). Then it should print the average and standard deviation to the
screen. Use the round() function to round off the standard deviation to two decimal places.
Summing Values the HardWay1
summer() takes a single list argument. First you need to initialize an accumulator to zero, then
use a for-loop to add the value of each element in the list, and finally return the total sum to the
calling program. The proper behavior of summer() is demonstrated below.
1The easy way is to use the built-in function sum().
5
1 >>> x = [9, 3, 21, 15]
2 >>> summer(x)
3 48
4 >>> summer([31.12, -16.32, 24.9, 82.0, 14.0])
5 135.7
Calculating Averages
Recall that the average of a list of numbers is simply the sum of the values divided by the number of
values. Mathematically, for a set of numbers x1, x2, · · ·, xN, the average is given by
¯x =
1
N
(x1 + x2 + · · · + xN)
where N is the number of terms in the list. The average, or mean, is often indicated by an overbar—
i.e., ¯x indicates the average of a set of numbers xk. The average is also given by
¯x =
1
N
XN
k=1
xk
where the uppercase Greek letter Sigma () means perform a sum. The expression to the right of
Sigma is what is to be summed. The expression below Sigma initializes a summation index (in this
case k) and the term above Sigma indicates the final value of the summation index.
Calculating Standard Deviations
The standard deviation is a measure of how much fluctuation or deviation there is in a set of numbers
after the average has been subtracted from each of the values2. If all the values in a list are equal to
the average, then the standard deviation is zero. If the standard deviation is large, then it means many
values deviate considerably from the average. The standard deviation is represented by the lowercase
Greek letter sigma (). For a set of numbers x1, x2, · · ·, xN, the standard deviation is given by
=
s
1
N
[(x1 − ¯x)2 + (x2 − ¯x)2 + · · · + (xN − ¯x)2]
where ¯x is the average. Recall that in Python we can square a value z using z ** 2 and we can
calculate the square root using z ** 0.5.
The following three examples demonstrate the results you should obtain for three different sets of
input for your stats.py program. Each of these has the same mean but an increasing standard
deviation. In the first, all the values are the same and hence the standard deviation is zero.
1 Enter the number of list elements: 5
2 Enter float 1: 50
2For further discussion of standard deviation, see <http://en.wikipedia.org/wiki/Standard_deviation>.
6
3 Enter float 2: 50
4 Enter float 3: 50
5 Enter float 4: 50
6 Enter float 5: 50
7 Average = 50.0
8 Standard deviation = 0.0
Here the values are spread out, spanning the range 30 to 70:
1 Enter the number of list elements: 5
2 Enter float 1: 30
3 Enter float 2: 40
4 Enter float 3: 50
5 Enter float 4: 60
6 Enter float 5: 70
7 Average = 50.0
8 Standard deviation = 14.14
In the final example the values range between 10 and 90:
1 Enter the number of list elements: 5
2 Enter float 1: 10
3 Enter float 2: 30
4 Enter float 3: 50
5 Enter float 4: 70
6 Enter float 5: 90
7 Average = 50.0
8 Standard deviation = 28.28
Don’t forget to include docstrings in all your functions!
please double check the indentations
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"