1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
geniusboy [140]
4 years ago
10

In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces o

f pie most people eat in a year. Set up an integer array that can hold responses from 30 people. For each person, enter the number of pieces they say they eat in a year. Then write a function that finds the mode of these 30 values. This will be the number of pie slices eaten by the most people. The function that finds and returns the mode should accept two arguments, an array of integers, and a value indicating how many elements are in the array.

Computers and Technology
1 answer:
Feliz [49]4 years ago
6 0

Answer:

  see below

Explanation:

The program of interest is the function "findMode[x, n]" in the attached. It is written the Wolfram Language of Mathematica.

The basic idea is that the data in the array is sorted. The sorted array is partitioned into sets of identical elements, and the number in each of those sets is counted. The maximum of those counts is the mode. The location of the maximum count corresponds to the location of the set having that count. We use that location information to pull out the mode value(s).

If there is more than one mode, all are reported.

__

An example data array is provided, along with the program output.

You might be interested in
a program p takes time proportional to log where nlogn is the input size. if the program takes 100 ms to process input of size 1
Eddi Din [679]

Answer:

The time is 4 \times 10^7 \ microseconds.

Explanation:

\ The \ requires \ time \ be \ t \ microseconds, \\\\\ \ formula: \\\\ time \propto \ nlog_n \Rightarrow \ time \ = \ knlogn \\\\

\ 10 \ = \ 100 \ log(100) \ \ \ \ \ \ \ \ \ k= 10^2 \ log\ ( \ 10^2\ ) \ k\\\\t=100,000,000 \log \ ( \ 100,000,000\ ) \ k = \ 10^8 \ log\ (\ 10^8\ )\ k \\\\\rightarrow \frac{t}{10} \ =\frac{10^8\ log \ (10^8)k}{10^2\ log\(10^2\ ) k} \\\\\rightarrow \frac{t}{10} \ =\frac{10^8\ log \ (10)\times 8 \times k}{10^2\ log\(10) \times 2 k} \\\\\rightarrow \frac{t}{10} \ =\ 4\times 10^6\\\\\rightarrow \ t \ =\ 4\times 10^6 \times 10 \\\\\rightarrow \ t \ =\ 4\times 10^7 \ microseconds \\\\

3 0
4 years ago
Codehs python 4.7.6 Powers of Two <br> it says I'm wrong because I need
Finger [1]

Following are the program to calculate the power of two:

Program Explanation:

  • Defining an integer variable "i" that hold an integer value.
  • Defining a for loop that checks "i" value in between 20, inside this it calculates power of two.
  • At the last use print method to print its value.

Program:

i=1#holding integer value in i

for i in range(20):#defining a for that starts 1 to 20    

   i = 2 ** i#calculate power of 2 in i variable

   print(i)#print value

Output:

Please find the attached file.  

Learn more:

brainly.com/question/23170807

8 0
3 years ago
Read 2 more answers
How does confidentiality protect people and their online activity?
zlopas [31]
The answer is C Explanation: process of elimination
5 0
3 years ago
The system cannot contact a domain controller to service the authentication request
slega [8]

Answer:  The correct answer is :  If it is not a DNS problem you can try to remove them from the domain by placing them in a workgroup, restart, then delete the computer trail in A / D Users & Computers, then re-enroll them in the domain and move them from the default location to their proper place in the A / D structure.

6 0
3 years ago
careful driving requires the appropriate Reaction Time both simple and complex breaking and then shifting gears followed by sign
arlik [135]

The examples listed all belong in the category of complex reaction time.

6 0
3 years ago
Other questions:
  • What is the function of the Status bar in Outlook 2010?
    9·1 answer
  • Nearly all states allow citizens who are not able to go to the polls due to business travel to vote using this method: Internet
    9·2 answers
  • What effect does social media have on teens?
    10·2 answers
  • Can anyone help???
    6·2 answers
  • Cuando se introduce una fórmula en una celda primero que hay que introducir es
    13·1 answer
  • What steps should you take if your harassed online​
    9·2 answers
  • I can login to it says to me u cant login at that time
    10·2 answers
  • Which validation method would you use for first name on a data form
    15·1 answer
  • How can touch typing increase productivity of a business?
    15·2 answers
  • there are n houses in a row numbered from 1 to n. an array infected houses contains the houses the houses which are infected wit
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!