Python programming A programmer writes a program to calculate a stock indexand incorrectly truncates the indexafter 2
Fantastic news! We've Found the answer you've been seeking!
Question:
Python programming
A programmer writes a program to calculate a stock indexand incorrectly truncates the indexafter 2 decimal places, rather than usingcorrect rounding. In other words a stock valueof 1000.54321 is replaced by 1000.54.
The program is applied in an automated trading program whichrecalculates the stock index everyminute during the normal tradinghours (10am to 4pm) forthe 250 trading days in a year.
Write a Python program to estimate the error in the resultingestimate of the index.
The output from your program should look like this:
Transcribed Image Text:
Instructions Problem A programmer writes a program to calculate a stock index and incorrectly truncates the index after 2 decimal places, rather than using correct rounding. In other words a stock value of 1000.54321 is replaced by 1000.54. The program is applied in an automated trading program which recalculates the stock index every minute during the normal trading hours (10am to 4pm) for the 250 trading days in a year. Write a Python program to estimate the error in the resulting estimate of the index. The output from your program should look like this: Stock Exchange Index Error: ANSWER where ANSWER is the correct answer to the calculation. Prob f X y Z d Р S Instructions Problem A programmer writes a program to calculate a stock index and incorrectly truncates the index after 2 decimal places, rather than using correct rounding. In other words a stock value of 1000.54321 is replaced by 1000.54. The program is applied in an automated trading program which recalculates the stock index every minute during the normal trading hours (10am to 4pm) for the 250 trading days in a year. Write a Python program to estimate the error in the resulting estimate of the index. The output from your program should look like this: Stock Exchange Index Error: ANSWER where ANSWER is the correct answer to the calculation. Prob f X y Z d Р S Instructions Problem A programmer writes a program to calculate a stock index and incorrectly truncates the index after 2 decimal places, rather than using correct rounding. In other words a stock value of 1000.54321 is replaced by 1000.54. The program is applied in an automated trading program which recalculates the stock index every minute during the normal trading hours (10am to 4pm) for the 250 trading days in a year. Write a Python program to estimate the error in the resulting estimate of the index. The output from your program should look like this: Stock Exchange Index Error: ANSWER where ANSWER is the correct answer to the calculation. Prob f X y Z d Р S Instructions Problem A programmer writes a program to calculate a stock index and incorrectly truncates the index after 2 decimal places, rather than using correct rounding. In other words a stock value of 1000.54321 is replaced by 1000.54. The program is applied in an automated trading program which recalculates the stock index every minute during the normal trading hours (10am to 4pm) for the 250 trading days in a year. Write a Python program to estimate the error in the resulting estimate of the index. The output from your program should look like this: Stock Exchange Index Error: ANSWER where ANSWER is the correct answer to the calculation. Prob f X y Z d Р S
Expert Answer:
Answer rating: 100% (QA)
Solution Here we will use round function in Python to estimate th... View the full answer
Related Book For
Probability And Statistics
ISBN: 9780321500465
4th Edition
Authors: Morris H. DeGroot, Mark J. Schervish
Posted Date:
Students also viewed these programming questions
-
Programming instruction: your program should read the data from a file. The file name is provided as command-line argument at execution time. The data file format is as follows: first line has 4...
-
An index model regression applied to past monthly returns in Fords stock price produces the following estimates, which are believed to be stable over time: RF =.10% +1.1 rm If the market index sub...
-
An index model regression applied to past monthly returns in Fords stock price produces the following estimates, which are believed to be stable over time: rF =.10% +1.1rM If the market index...
-
A non reactive/conservative contaminant is dumped on the ground level and it leaches to the groundwater vertically and takes half day for reaching the groundwater by travelling through unsaturated...
-
For the current year ending March 31, Chow Company expects fixed costs of $345,600, a unit variable cost of $32, and a unit selling price of $50. a. Compute the anticipated break-even sales (units)....
-
Use a calculator or program to compute the first 10 iterations of Newtons method when it is applied to the following functions with the given initial approximation. Make a table similar to that in...
-
International Publishing Company has the following selected account balances at June 30, 2007. Prepare the stockholders" equity section of International's balance sheet. Inventory $112.000 Common...
-
Comparative income statements and balance sheets for Coca-Cola are shown below ($ millions). Required: a. Use the following ratios to prepare a projected income statement, balance sheet, and...
-
Beginning inventory balances are as follows: Raw materials Work in process Finished goods on The following events took place during the year: Time left 0:26:16 Hide $15040 $73970 $47930 Purchases of...
-
The following information pertains to the City of Williamson for 2020, its first year of legal existence. For convenience, assume that all transactions are for the general fund, which has three...
-
Salawahan Company had the following machineries that are depreciated under the group depreciation method: Cost Residual Value Depreciable Cost Useful Life Depreciation Equipment A P3,200,000 P200,000...
-
Brand/Background :Roundnet is a net sport-inspired primarily by concepts from volleyball. It was originally created in 1989 by Jeff Knurek although the equipment he created for the game became...
-
Belton, Inc. had the following transactions in 2024, its first year of operations: Issued 33,000 shares of common stock. Stock has par value of $1.00 per share and was issued at $19.00 per share....
-
1. What it means to decompose the income gap in an economic sense. Use examples about decomposing the income gap between same-sex couples and different-sex couples. Specify the factors the income gap...
-
Pharoah Corp.'s sales slumped badly in 2022. For the first time in its history, it operated at a loss. The company's income statement showed the following results from selling 595,500 units of...
-
Data Flow Modeling: (20 points) a. Explain barrier synchronization and its applications in parallel programming b. Compute the following terms using data flow model of computation i. x=3 a + b*b-c...
-
Describe carrier distribution of electrons and holes as a function of energy for (a) an intrinsic (b) n-type and (c) p-type semiconductors qualitatively in terms of density of states and Fermi...
-
Velshi Printers has contracts to complete weekly supplements required by fortysix customers. For the year 2018, manufacturing overhead cost estimates total $600,000 for an annual production capacity...
-
Suppose that a point X1 is chosen from the uniform distribution on the interval [0, 1], and that after the value X1 = X1 is observed, a point X2 is chosen from a uniform distribution on the interval...
-
Suppose that a random sample of four observations is drawn from the Poisson distribution with mean , and let X denote the sample mean. Show that -44 4. Pr (X < (()= = (42 + 1)e
-
Consider a general linear model with n p design matrix Z, and let denote the vector of residuals. (In other words, the ith coordinate of where a. Show that W = DY, where D = I Z(Z'Z)1Z'. b. Show...
-
In planning a new engagement, which of the following is not a factor that affects the CPAs judgment as to the quantity, type, and content of working papers? a. The content of the clients...
-
Discuss the similarities and differences betw1een Maslows hierarchy of needs theory and E.R.G. theory. What insights do you gain from each theory?
-
Discuss the different ways of expressing the need for power as described in McClellands achievement motivation theory. Which of the two types of power do you respond to best? Why?
Study smarter with the SolutionInn App