Variance for accumulator. Validate that the following code, which adds the methods var() and stddev() to Accumulator, computes both the mean and variance of the numbers presented as arguments to addDataValue(): public class Accumulator { private double m; private double s; private int N; public void addDataValue(double x) { N++; s = s + 1.0 * (N-1) / N * (x - m) * (x - m); m = m + (x - m) / N; } public double mean(

Answers

Answer 1

Using the knowledge of computational language in JAVA it is possible to write a code that Validate that the following code, which adds the methods var() and stddev() to Accumulator, computes both the mean and variance of the numbers presented as arguments to addDataValue()

Writting the code:

import java.util.*;

public class Accumulator {  

private static double m;  

private static double v;  

private static double st;  

private static  double s[]=new double[5];

private static int N;

private static int count =0;

public static void main(String[] args) {

// TODO Auto-generated method stub

Random r = new Random();

System.out.println("hello world");

for(int i=0;i<5;i++) {

   double randomvalue = r.nextDouble();

addDataValue(randomvalue);

}

for(int i=0;i<s.length;i++) {

   System.out.println("dataValue:"+s[i]);

}  

mean();

System.out.println("mean:"+m);

var();

System.out.println("variance:"+v);

stddev();

System.out.println("standard deviation:"+st);

}

public  static void addDataValue(double value) {     // addes data values to array

 s[count]=value;

 count++;

}

public static double mean() {        // returns mean

double sum=0.0;

for(int i=0;i<s.length;i++) {

   sum+=s[i];

}

m = sum/s.length;

return m;

}  

public static double var() {    //returns variance

double mm = mean();

    double t = 0;

    for(int i=0;i<s.length;i++) {

        t+= (s[i]-mm)*(s[i]-mm);

}

    v= t/(s.length-1);

     return v;  

}

public static  double stddev() {        // returnsn the stardard deviation

st= Math.sqrt(var());

return st;

}

}

See more about JAVA at brainly.com/question/12975450

#SPJ1

Variance For Accumulator. Validate That The Following Code, Which Adds The Methods Var() And Stddev()

Related Questions

2. Mr. Motladiile is an innovative businessman who came up with an idea of creating a system that can generate electricity using magnets, and he teamed up with Mr. Tangeni who is the sole engineer of the system. Due to finances the project halted, however Mr. Tangeni felt that he was under paid despite the effort he has put leading the project, he then thought of creating the system and sell it to the highest bidder.
a) Explain the protection that Mr. Motladiile can put in place to prevent reproduction of the design and for how long will it last

Answers

Answer:I DONT THE ANSER PLEASE HELP ME

Explanation:PLEASE

Which of these statements about Active Directory (AD) are true? Check all that apply.
a. AD includes a tool called the Active Directory Authentication Center, or ADAC.
b. AD is incompatible with Linux, OS X, and other non-Windows hosts.
c. AD can ""speak"" LDAP.
d. AD is used as a central repository of group policy objects, or GPOs.

Answers

All of the statements about Active Directory (AD) that are true include the following:

c. AD can ""speak"" LDAP.

d. AD is used as a central repository of group policy objects, or GPOs.

What is Group Policy Object?

Group Policy Object can be defined as a set of Group Policy settings of the Microsoft Windows NT operating systems that is designed and developed to define what a computer system should look like.

Additionally, Group Policy Object (GPO) controls and sorts all of the end user and computer account features and working environment in general. In order to sort a computer system into a group, it is very essential and important that you set a group sorting criteria, so as to sort systems by IP Address.

In conclusion, Active Directory (AD) can manage Lightweight Directory Access Protocol (LDAP) and it is generally used by network administrators and engineers as a central repository of group policy objects (GPOs).

Read more on Active Directory here: brainly.com/question/28900362

#SPJ1

The programmer wants to change this code so that a third background image appears when the player presses the “B” button. What does the programmer need to do?

Answers

Answer:

i think its B but im not sure

Explanation:

Distinguish between composition and inheritance.

Answers

Answer:

compotsition: The combining of distinct parts or elements to form a whole

Inheritance: The action of inheriting something

Explanation:

Boolean Algebra
Simplify AB'(D'+C'D)+B(A+A'CD) and show all work.

Answers

Answer: B details to simplify A'B(D' + C'D) + B(A + A'CD) start with ( D' +C'D) = (D' + C') likewise (A + A'CD) = (A + CD) This gives A'B(D' + C') + B(A + CD)= ...

4 answers

·

1 vote:

[math]A'B (D'+C'D) + B (A+ A'CD)[/math] [math]= A'B (D'+D)(D'+C') + B (A+ A')(

Explanation:

how do you fill different data into different cells at a time in Excel

Answers

The way that you fill different data into different cells at a time in Excel are:

Click on one or a lot of cells that you want to make use of as the basis that is needed for filling additional cells. For a set such as 1, 2, 3, 4, 5..., make sure to type 1 and 2 into the 1st two cells. Then pull the fill handle .If required, select Auto Fill Options. and select the option you want.

How do you make a group of cells auto-fill?

The first thing to do is to place the mouse pointer over the cell's bottom right corner and hold it there until a black + symbol appears. Drag the + symbol over the cells you wish to fill in while clicking and holding down the left mouse button. Additionally, the AutoFill tool rightly fills up the series for you.

Note that  Excel data entering  can be automated and this can be done by: On the Data tab, select "Data Validation," then click "Data Validation." In the Allow box, select "List." Enter your list items in the Source box, separating them with commas. To add the list, click "OK." If you wish to copy the list along the column, use the Fill Handle.

Learn more about Excel from

https://brainly.com/question/25879801
#SPJ1

Real estate management software

Answers

Answer:

nTireFM

Explanation:

is a comprehensive system for real estate vendors with unique and reliable needs. Real Estate Management Software simplifies your life as a real estate investor monitors the financial performance of each rental property

Can someone help me with this worksheet?

Answers

Answer:

Here are the answers

Explanation:

how adobe photoshop can improve productivity of a organization

Answers

Adobe photoshop allows the process of editing an image to go by much quickly. Instead of taking days, it could take a few hours instead with adobe photoshop

And one well written paragraph, explain how you can put raw data into excel and turn it into something useful that could be used in different Microsoft office applications.

Answers

The way that you can put raw data into excel and turn it into something useful that could be used in different Microsoft office applications are:

Open the Excel file into which the data is to be imported.Now, select the Data tab on the ribbon.Select  the Get Data option. Select From File > From Text/CSV.Through the use of the explorer, Select a CSV file. Lastly, Select the Load button.

What is excel about?

Excel is said to often used to save, analyze, a well as report on large volume of data.

Note that It is often used as a tool by accounting teams for the recording of financial analysis, as well as been used by professional to manage a list of and unwieldy form of datasets. Examples of Excel applications are balance sheets, budgets, etc.

Learn more about Microsoft office applications from

https://brainly.com/question/15131211
#SPJ1

A computer chip is
an example of hardware or software?

Answers

Answer: A system on a chip consists of both the hardware, described in § Structure, and the software controlling the microcontroller, microprocessor or digital signal processor cores, peripherals and interfaces.

i think it’s hardware

if you want to assign a user the permission to create schema and run ALTER or any user, what role should you assign to that user?
A. dp_backupoperator
B. db_accessadmin
C. db_securityadmin
D. db_datawriter

Answers

As a database administrator, if you want to assign a user the permission to create schema and run ALTER or any user, the role should you assign to that user is "db_accessadmin" (Option B)

What does it mean to run ALTER?

In SQL, the ALTER command is used to modify a table, view, or the whole database. The ALTER command in SQL allows us to add, change, and delete constraints, columns, and indexes.

It is to be noted that SQL is a computer language developed for managing data in a relational database management system or for stream processing in a relational database management system.

Learn more about database administrator:
https://brainly.com/question/13040754
#SPJ1

are all counting and calculations done in the system unit

Answers

The ALU (Arithmetic Logic Unit), located in the system unit, is the component of the computer utilized for calculations and comparisons.

Describe ALU.

Arithmetic-logic unit (ALU) definition Arithmetic and logic operations are performed on the operands in computing instruction words by an arithmetic-logic unit, a component of a central processing unit. Some processors separate the ALU into an arithmetic logic unit (AU) and an arithmetic logic (LU).

What are the primary purposes of an ALU?

Simple multiplication, division, addition, subtraction, addition, and logic operations like OR and AND are all performed by the ALU. The data and instructions for the program are stored in memory. Data and instructions are retrieved by the control unit from memory.

TO know more about Arithmetic Logic Unit visit:

https://brainly.com/question/14247175

#SPJ10

For questions 1-3, consider the following code:



x = int(input("Enter a number: "))




if x != 7:

print("A")




if x >= 10:

print("B")




if x < 10:

print("C")




if x % 2 == 0:

print("D")


What is output if the user types in 10? Click all that apply.

Group of answer choices

D

A

C

B

Answers

Answer:

B

Explanation:

because 10 ranges between the x>=10

Which of the following is the correct binary representation of the number 2?

Answers

Answer:

10 i think

Explanation:

When collecting and sharing information, the company must meet all _________________________ for the type of data being collected.
A US laws
B State Laws
C Federal Laws
D Federal or State Laws

Answers

Answer: D Federal and State Laws

Explanation: U.S. Privacy Act of 1974-this act established rules and regulations regarding U.S. government agencies collection, use, and disclosure of personal information.

The Federal Trade Commission govern the collection, use, and disclosure of personal data.

HIPPA- Health Insurance Portability and Accountability provide healthcare and health insurance protection

Answer: D

Explanation:

Which device is not considered a computer?

a smartphone
an analog controller

Answers

Answer:

An analog controller is not considered a computer because you just move around the controls. You don't stare at a screen like a smartphone, so it is not a computer.

Explanation:

Why does internet privacy matter?

Answers

Answer:

Internet privacy is important because of the abundant amount of scammers, hackers, and others who want to exploit your information. It is also important to protect your personal information and browsing history, since these can be manipulated in many different ways.

Explanation:

1. What's the minimum RAM requirements to install or upgrade to Windows 11?
1 GB for 32-bit or 2 GB for 64-bit
O4 GB
8 GB

Answers

Answer:

4 GB

Explanation:

You need 4 gigabytes (GB) or greater. Storage: 64 GB* or greater available storage is required to install Windows 11. Extra storage space might be required to download updates and enable specific features. According to Windows 11 system requirements, my 4 GB ram is enough to upgrade my pc from windows 10 to windows 11.

This is rigged. I think I'm gonna faint.

Answers

The primary characteristics of the given devices are:

A mouse is a(n) input device.

A printer is a(n) output device.

What is a device?

A device is a piece of hardware or equipment in a computer system that performs computing functions. A device is a physical piece of hardware or software that performs one or even more computing functions within a computer system. It can either provide input to the computer or accept output from it. A device is any electronic element that has some computing capability and can install firmware or third-party software. Devices include your computer's speakers, disc drive, printer, microphone, modem, and mouse. They can all be replaced or installed separately.

To learn more about device

https://brainly.com/question/27013190

#SPJ13

Answer:

The answers are input and output, respectively.

Explanation:

you have a 10vdg source available design a voltage divider ciruit that has 2 vdc , 5vdc , and 8 vdc available the total circuit current is to be 2mA

Answers

If you try to divide 10V in three voltages, the sum of the three voltages must be equal to the total voltage source, in this case 10V. Having said this, 2 + 5 + 8 = 15V, and your source is only 10V. So you can see is not feasible. You can, for example, have 2V, 5V and 3V, and the sum is equal to 10V. Before designing the circuit, i.e, choosing the resistors, you need to understand this. Otherwise, I suggest you to review the voltage divider theory.

For instance, see IMG2 in my previous post. If we were to design a single voltage divider for the 5VDC, i.e, 50% of the 10V source, you generally choose R1 = R2., and that would be the design equation.

You have entered a URL into a browser and have received a 404 error. Which type of error did you receive?

Answers

Answer:

in redirect pages

Explanation:

the e page can not be down

Answer:

a 404 error is "File not found." This can happen when a file is deleted or there is an error in a hyperlink. It can also happen if a file is copied and the original deleted.

Explanation:

1. What operating system are you using on your computer?

Answers

Answer:

Windows

Explanation:

Flexible and convenient

Given numStack: 23, 26, 94 (top is 23)
What does Peek(numStack) return?

Answers

Using the knowledge in computational language in python it is possible to write a code that create a program that takes a string as an argument into its constructor.

Writting the code:

import java.util.*;

public class Expression

{

 Scanner in = new Scanner(System.in);

 Stack<Integer> stack = new Stack<Integer>();

 public boolean check()

 {

   System.out.println("Please enter your expression.");

   String newExp = in.next();

   String[] exp = new String[newExp];

   for (int i = 0; i < size; i++)

   {

     char ch = exp.charAt(i);

     if (ch == '(' || ch == '[' || ch == '{')

       stack.push(i);

     else if (ch == ')'|| ch == ']' || ch == '}')

     {

       //nothing to match with

       if(stack.isEmpty())

       {  

         return false;

       }

       else if(stack.pop() != ch)

       {

         return false;

       }

     }            

   }

   if (stack.isEmpty())

   {

     return true;

   }

   else

   {

     return false;

   }

 }

}

See more about JAVA at brainly.com/question/12975450

#SPJ1

Know the tags to be used for each style or format.​

Answers

Answer:

1. Bold                           <b                    /b>

2. Strong                      <strong    /strong>

3. Italic                          < i              /i >

4. Emphasized             <em           /em>

5. Superscript              <sup         /sup>

6. Subscript                 <sub        /sub>

Explanation:

||||
Attempts Remaining: 1
Entering a Formula
Insert a formula in cell G4 that finds the value of subtracting
F4 from E4

Answers

Answer:

Explanation:

Formula:

= E4 - F4

what are the activities usually performed in database operations

Answers

Answer:

The most frequently available operators include PROJECT, JOIN and SELECT. SQL includes DDL (Data Description Language)

Explanation:

The control lines in the bus connect the control unit to the CPU.

True
Or False

Answers

Answer:

true

Explanation:

The control bus contains a control line for writing instructions and a control line for reading instructions. When the CPU writes data to the main memory, it transmits a signal to the write command line. The CPU also sends a signal to the read command line when it needs to read.

COPPA regulates personal information that companies can use. Which users does this law protect?

Answers

COPPA is required by law to protect children under the age of 13 years, from having their personal information used by companies.

What is a PII?

PII is an abbreviation for personally identifiable information and it can be defined as any type of information that can be used by individuals or companies on its own or with other relevant data, so as to identify an individual.

In the United States of America, Children's Online Privacy Protection Act (COPPA) is required by law to protect all American children who are under the age of 13 years, from having their personally identifiable information (PII) being used by business organizations (companies).

Read more on COPPA here: https://brainly.com/question/15608567

#SPJ1

Complete Question:

COPPA regulates personal information that companies can use. Which users does this law protect? COPPA protects children under the age of ________ from having their personal information used by companies.

A student wants to create an Android Application to help a motorist to approximate the cost of a journey

by road. The app should enable the user to enter the length of the journey in Kilometres, the amount fuel

that the vehicle uses per kilometre and the cost of fuel per litre. The app should then calculate the total

amount that will be spent on fuel for the journey.

Sketch the interface for the activity that can be used for this task. (5 marks)

b) Declare and initialize all the widgets (views) that you can use for this task. Assume your own ids.

(5 marks)

c) Write the program to calculate the cost of the journey.

Answers

Answer:

Explanation: How to calculate fuel economy and usage

Manufacturers give a fuel economy figure for new cars in litres per 100km for urban, extra urban (i.e. higher speeds) and combined (a mixture of the two). This number is determined via a standardised test which, unfortunately, bears very little resemblance to the type of driving the vast majority of people do. If a vehicle you are looking at purchasing has an indicated fuel economy of 8l/100km, everyday driving is probably more likely to be around 10l/100km (this is my experience, after driving and reviewing over 400 cars since 2007).

However, the manufacturer-supplied figures are good for comparing between models, just not calculating what your expected fuel costs will be.

Other Questions
Theorize as to what you think happened at the end of the story. Who was at the door?Explain your answer. Proteins which are embedded in the membrane are called membrane proteins, while proteins which are attached to the surface of the membrane are called proteins. Solve and check the equation X-23=16 What is the central idea of Written In Bone by Sally Walker. 1 What of the following is the study of how diseases spread?1)epidemiology(2) biology(3) genetics(4) Human Genome Project what is the identity of the above atom True or False: Active Transport requiresATP to transport molecules with theconcentration gradient. a length of 20 gauge copper wire of diameter 0.8118mm is formed into a circular loop with a radius of 30 cm a magnetic field perpendicular to the plane of the loop increases from zero to 18 mt in 28 seconds find the average electrical power dissipated in the process 1. What's the minimum RAM requirements to install or upgrade to Windows 11?1 GB for 32-bit or 2 GB for 64-bitO4 GB8 GB Look at the various immigrant visas available. In your opinion, what is the reasoning behind these visa categories? What policy goals do they serve? What is the y-intercept of f(x) = -2 (1/2)^x? Dangers/benefits of traveling to this place or places ? the weighted average cost method uses the weighted average cost to calculate the value of . (check all that apply.) multiple select question. cost of goods sold supplies sales inventory equipment payments to suppliers 1. How can drivers avoid sensory overload? The state transportation commission counted cars traveling east and west across a toll bridge. 75% of the 588 cars counted were traveling east. How many eastbound cars did the commission count? Match each pollutant with its health effect.Carbon dioxideNitrogen oxides Volatile organic compounds Sulfur oxides A) inflammation and irritation of the respiratory systemB) causes eye, nose, and throat irritation or cancerC) irritate lungs, dizziness, seizures, or deathD) dizziness, fatigue, headache, disorientation, shortness of breath in what way is the tangible measure of the value of a person to the organization expressed? a. with benefits b. in wages c. with promotions d. with compensation e. in career planning 20$ startup fee and a $5 monthly fee write an equation in slope intercept form that models can you give me some examples of how to simplify Which of the following would result in an integer?O a.) 120O b.) 144O c.) 52O d.) 24