c) Write a function named mm = myMean (x, id) that calls myGeomean and my Harmmean....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
c) Write a function named mm = myMean (x, id) that calls myGeomean and my Harmmean. If id = 1, it will return the geometric mean of the positive numbers of x in mm, if id=2, it will return the harmonic mean of positive numbers of x in mm, and it will return -1 in mm for any other value of id. Verify your function one vector of your choice (with a length n > 5, and the vector must include negative elements) with three different values of id = 1, 2, 3, and print your results. c) Write a function named mm = myMean (x, id) that calls myGeomean and my Harmmean. If id = 1, it will return the geometric mean of the positive numbers of x in mm, if id=2, it will return the harmonic mean of positive numbers of x in mm, and it will return -1 in mm for any other value of id. Verify your function one vector of your choice (with a length n > 5, and the vector must include negative elements) with three different values of id = 1, 2, 3, and print your results.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
re Regular Languages and Finite Automata (a) Let L be the set of all strings over the alphabet {a, b} that end in a and do not contain the substring bb. Describe a deterministic finite automaton...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Data collected at elementary schools in DeKalb County, GA suggest that each year roughly 25% of students miss exactly one day of school, 15% miss 2 days, and 28% miss 3 or more days due to sickness....
-
Pascale Corp. has the following securities (all purchased in 2017) in its investment portfolio on December 31, 2017: 2,500 Anderson Corp. common shares, which cost $48,750; 10,000 Munter Ltd. common...
-
Estimate the Rockwell hardnesses for specimens of an ironcarbon alloy of eutectoid composition that have been subjected to the heat treatments described in parts (b), (d), (f), (g), and (h) of...
-
Compression ratio in diesel engine ranges from: (a) 6 to 10 (b) 10 to 15 (c) 14 to 22 (d) 25 to 40
-
A wire in the shape of semicircle with radius a is oriented in the yz-plane with its center of curvature at the origin (Fig. 28.67). If the current in the wire is I, calculate the magnetic-field...
-
Reliability and validity are cornerstone concepts in quantitative research, while credibility plays a similar foundational role in qualitative research. Understanding these concepts helps to assess...
-
On May 31, 2020, the Corporation gave Bob Jones, a member of the board of directors who also has provided consulting services to the Corporation from time to time, an incentive stock option to...
-
a) Find the remainder and the quotient when 4x-5x+2x+4 is divided by x+2x+1 (10 Marks) b) The age of the followers of a Kenyan political party chosen randomly is given as 58, 45, 73 61, 66, 52, 54,...
-
Walter, Wendel, and Winston Lawson are brothers. In 2023, they are all concerned about the impact of the AMT on the amount of income tax they will have to pay. To help them prepare for any additional...
-
You used an 1/1 ARM to finance an investment property in Oxford. The margin on the loan is 2.7% and the index is the 10-year constant maturity treasury, which is currently at 3.25%. During the prior...
-
List two similarities and differences between conventional Western medicine and complementary and alternative health care practices.
-
Now go to the 'PQR with MC simulation' tab. In it you will find a fully functioning MC simulation model for PQR Corp. (NOTE: If you open this workbook without first opening @RISK you'll see a lot of...
-
The task is to apply the accounting principles and prepare a full set of annual report including Directors Report, Directors Declaration, Audit Report, Financial Statements (excluding Statement of...
-
From 1970 to 1990, Sri Lanka's population grew by approximately 2.2 million persons every five years. The population in 1970 was 12.2 million people.What is the best formula for P, Sri Lanka's...
-
(a) Show that for any scalars a1, 1, . . . , am, n this map h. Rn Rm is a homomorphism. (b) Show that for each i, the i-th derivative operator di/dxi is a linear transformation of Pn. Conclude that...
-
Give the permutation expansion of a general 2 Ã 2 matrix and its transpose. 3-3 2 3 1 2 1 2-2 3 1 3 1 2 1112233 123456 221
-
Find a linearly independent set S so that the span of S, (S), is row space of the matrix B, and S is linearly independent. 2 1 2 34 B=11101
-
Using all the tips presented in this chapter, write your rsum. Aim it at a full-time job, part-time position, or internship that you researched online. Attach the job listing to your rsum. Also...
-
What is the imperative mood, and why is it preferred over the indicative mood?
-
Can workers today be successful if their writing is and remains poor? What could be the career fallout for someone who is unwilling or unable to train to become a better communicator?
Study smarter with the SolutionInn App