Please include code where asked to write code and code's output screenshot. 1- Say you want...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Please include code where asked to write code and code's output screenshot. 1- Say you want to write python code that calculates x modulo y wherex and y are two integer variables. Then it assigns the value of y to x and the modulo result to y. It also prints the values of x and y. A python code segment (one line) with a missing line is given below. Write that missing line. x = 200 y = 100 # Missing line print(fx: {x}.y:{y}') 2- You are given with a string variable x="Hello World". Write a python code segment that prints "eoo" 3- Consider the following python code to print integer number from 0 to 10. for j in range(0,10) print(j) This code has some issues, mention those issues. 4- Write a python code that takes an integer from a keyboard (denoted by variable x). If the number is less than 99 and even, your program calculates its factorial (x!) and prints the factorial value in your screen. If the number is less than 99 and is odd, your program prints. "this is an odd number". If the number is greater than 99, it prints "the number is too big". 5- Consider you have the set of data comprising the heights (in meters) ofa group of people and their corresponding weights (in kg) given in Table 1. Table 1: Height and actual weight. Height [m] 1.6 1.65 1.7 1.73 1.8 Weight [Kgs] 60 65 72.3 75 80 a. Using python, plot a chart/graph height vs weight. x-axis should be "height in m" and y-axis should be "Weights in Kgs. b. From your plotted chart/graph. do you see any correlation between the weights and the heights for this group of people? If yes, mention what kind of correlation you observe. c. Now say you want to use the data in the table and predict the weight of another person based on his/her height that is given to you. In order to do so. one option is that you draw 6-a straight line through the points in your plotted graph and use that line to predict the weight of another person given his/her height. This is called linear regression which is a linear approach for modelling the relationship between a scalar dependent variable of Y ("weight" in this case) and one or more explanatory variables (or independent variables, X) which is "height" in this case. In order to draw a straight line, you can use the equation: Y = ax + b. Assuming values for a = 103 and b = -104, using Python plot a straight line in the same chart/graph height vs weight that you plotted for Question a. d. Using Y = ax + b where a = 103 and b = -104. predict weights (Y) corresponding to following heights (X) and fill in column 2 of Table 2 given below. Table 2: Height vs predicted weights Predicted Weights [Kgs] Height [m] 1.6 1.65 1.7 1.73 1.8. 1.76 (this height is not given on table 1) e. Do you observe any error i.e.. the difference between actual weight in Table 1 and predicted weight in Table 2 for given heights in Table 1? Write down errors for each height given in Table 1. If you use another set of values of a and b, what is your opinion about the errors? Will they be changed or not? If like, you can check by repeating Questions d) and e) with another set of values of a and b. Please include code where asked to write code and code's output screenshot. 1- Say you want to write python code that calculates x modulo y wherex and y are two integer variables. Then it assigns the value of y to x and the modulo result to y. It also prints the values of x and y. A python code segment (one line) with a missing line is given below. Write that missing line. x = 200 y = 100 # Missing line print(fx: {x}.y:{y}') 2- You are given with a string variable x="Hello World". Write a python code segment that prints "eoo" 3- Consider the following python code to print integer number from 0 to 10. for j in range(0,10) print(j) This code has some issues, mention those issues. 4- Write a python code that takes an integer from a keyboard (denoted by variable x). If the number is less than 99 and even, your program calculates its factorial (x!) and prints the factorial value in your screen. If the number is less than 99 and is odd, your program prints. "this is an odd number". If the number is greater than 99, it prints "the number is too big". 5- Consider you have the set of data comprising the heights (in meters) ofa group of people and their corresponding weights (in kg) given in Table 1. Table 1: Height and actual weight. Height [m] 1.6 1.65 1.7 1.73 1.8 Weight [Kgs] 60 65 72.3 75 80 a. Using python, plot a chart/graph height vs weight. x-axis should be "height in m" and y-axis should be "Weights in Kgs. b. From your plotted chart/graph. do you see any correlation between the weights and the heights for this group of people? If yes, mention what kind of correlation you observe. c. Now say you want to use the data in the table and predict the weight of another person based on his/her height that is given to you. In order to do so. one option is that you draw 6-a straight line through the points in your plotted graph and use that line to predict the weight of another person given his/her height. This is called linear regression which is a linear approach for modelling the relationship between a scalar dependent variable of Y ("weight" in this case) and one or more explanatory variables (or independent variables, X) which is "height" in this case. In order to draw a straight line, you can use the equation: Y = ax + b. Assuming values for a = 103 and b = -104, using Python plot a straight line in the same chart/graph height vs weight that you plotted for Question a. d. Using Y = ax + b where a = 103 and b = -104. predict weights (Y) corresponding to following heights (X) and fill in column 2 of Table 2 given below. Table 2: Height vs predicted weights Predicted Weights [Kgs] Height [m] 1.6 1.65 1.7 1.73 1.8. 1.76 (this height is not given on table 1) e. Do you observe any error i.e.. the difference between actual weight in Table 1 and predicted weight in Table 2 for given heights in Table 1? Write down errors for each height given in Table 1. If you use another set of values of a and b, what is your opinion about the errors? Will they be changed or not? If like, you can check by repeating Questions d) and e) with another set of values of a and b.
Expert Answer:
Related Book For
Ethics in Accounting A Decision Making Approach
ISBN: 978-1118928332
1st edition
Authors: Gordon Klein
Posted Date:
Students also viewed these general management questions
-
You are asked to write policies and procedures for managing the receiving area. Identify the topic areas that you would include:
-
Write a program to print Hello World 25 times without writing a single line in the main function except system(pause).
-
You are given two discrete random variables X, Y that assume the possible values 0, 1 according to the following joint distribution: (a) What are the marginal distributions of X and Y? (b) Are X and...
-
Austin and Anya Gould are a middle-aged couple with two childrenRusty, age 13, and Sam, age 11whom they adopted this year. They also bought a new home in the area to give the children a yard in which...
-
Presented below is the December 31 trial balance of New York Boutique. Instructions(a) Construct T-accounts and enter the balances shown.(b) Prepare adjusting journal entries for the following and...
-
Gonzo Co. owns a building in Georgia. The building's historical cost is $970,000, and $440,000 of accumulated depreciation has been recorded to date. During 2017, Gonzo incurred the following...
-
Amazon.com, Inc. is the world's leading online retailer selling books, music, DVDs, videos, toys, electronics, software, video games, and home improvement products. The following foot- note appeared...
-
On November 1, 2013, Norwood borrows $ 200,000 cash from a bank by signing a five-year installment note bearing 8% interest. The note requires equal total payments each year on October 31. Required...
-
For the year ended December 31, 2020, Flint Ltd. reported income before income taxes of $102,000. In 2020, Flint Ltd. paid $60,000 for rent; of this amount, $20,000 was expensed in 2020. The...
-
Suppose that the change in a portfolio value for a one-basis-point shift in the 1-year, 2-year, 3-year, 4-year, 5-year, 7-year, 10-year, and 30-year rates are (in $ million) +5, 3, 1, +2, +5, +7, +8,...
-
Give different types of file system in brief. OR Explain different types of file implementation.
-
Josiah decides to lease a $24,000 vehicle for two years. It is estimated that the car will be resold in two years at a price of $14,500. The interest being charged is 3%. His state does not have...
-
There are two companies, AA and BB, each with current annual earnings of $2 per share and book value of $15 per share. AA trades for $20 per share and BB trades for $30 per share. (a) According to...
-
Its pretty straightforward. Basically, we need to pick 3 international market entry methods that fit our chosen company (coca cola) into the country we have previously chosen (Mexico & Australia)....
-
When I have a few valuable resources under my belt, I can begin gradually expanding my network by adding new people to it. How do you plan on doing this? Any particular social mediaplatforms you plan...
-
Formulate a first draft of an elevator pitch for your company. Be sure to address: What exactly does your company do? Why are you and your team qualified to do this? How does your company do what it...
-
x be a normal randome variable with mean m=5, and standart deviation 2. use pnorm() function to calculate the probabilyty that 3= < x = < 6. Calculation in r
-
7. Baladna wants to analyze process that includes delivery by suppliers, production inside the company, transportation to to its customers and information systems. Then it also wants to find out...
-
Varda operates a financial advisory firm that gives advice to small business owners. Varda prepared a loan amortization schedule that assisted Gupta in winning a court judgment against Nguyen for...
-
Your former accounting professor recently contacted you because she knows that you currently work for an accounting firm that performs compilation services for several privately held mining...
-
When an auditor performed an inventory count at a privately-owned medical supply company, it observed that some of the waste from radioactive isotopes produced at that facility three years appeared...
-
What forensic technique was used by CocaCola to prosecute the secretary who was convicted for attempting to sell product information to Pepsi? a. Invigilation b. Interviews c. Videotape d. Net worth...
-
\( \qquad \) refers to a company pulling revenues into the distribution channel fraudulently. a. Constructive intent b. Channel stuffing c. Gaming strategy d. Big bath e. Double play
-
The \( \qquad \) theory says that covert aspects of fraud may be as important as overt aspects. a. Backdating b. Invigilation c. Graphology d. Iceberg e. Game
Study smarter with the SolutionInn App