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
Sedaia [141]
3 years ago
15

Students in a class are asked to stand in ascending order according to their heights for the annual class photograph. Determine

the number of students not currently standing in their correct positions.Students in a class are asked to stand in ascending order according to their heights for the annual class photograph. Determine the number of students not currently standing in their correct positions.
Mathematics
1 answer:
horrorfan [7]3 years ago
4 0

Answer:

The function in Python is as follows:

def heightChecker(heights):

   expected = []

   count = 0

   for i in range(len(heights)):

       expected.append(heights[i])      

   expected.sort()

   for i in range(len(heights)):

       if expected[i] != heights[i]:

           count+=1  

   return count

Step-by-step explanation:

Required

Function to return the number of out of position students

<em>See comment for complete question</em>

This defines the function. It receives the heights as a parameter, from the main

def heightChecker(heights):

This initializes a list, (expected list)

   expected = []

This initializes the count of out of position students

   count = 0

This iterates through the original list

   for i in range(len(heights)):

The list item is then appended to the expected list

       expected.append(heights[i])      

This sorts the expected list in ascending order

   expected.sort()

This iterates through the original and the expected lists

   for i in range(len(heights)):

If list elements at the same index are not the same, count is incremented by 1

<em>        if expected[i] != heights[i]: </em>

<em>            count+=1  </em>

This returns count

   return count

You might be interested in
Help please No links And with explanation please!
victus00 [196]
First: -8 second:17
4 0
3 years ago
Letv⃗ 1=⎡⎣⎢012⎤⎦⎥,v⃗ 2=⎡⎣⎢1−20⎤⎦⎥,v⃗ 3=⎡⎣⎢30−1⎤⎦⎥be eigenvectors of the matrix A which correspond to the eigenvalues λ1=−3, λ2=2
dem82 [27]
What is this????????????????????
6 0
3 years ago
First mile in 450 seconds how many minutes was his first mile
bezimeni [28]
There are 60 seconds in a minute, so divide 450 by 6 and you get that his first mile was in 75 minutes. 
5 0
4 years ago
Chris wanted to transform the graph of the parent function Y= cot (x) by horizontally compressing it so that it has a period of
pashok25 [27]

Answer:

He didn't calculate the b-value correctly.

Step-by-step explanation:

The given parent function is:

y =  \cot(x)

The transformation is of the form:

y =a  \cot(bx + c)  + d

The period is given by

\frac{\pi}{b}

If we want the new function to have a period of

\frac{2}{\pi}

Then we solve the following equation for b.

\frac{\pi}{b}  =  \frac{2}{\pi}

b =  \frac{ {\pi}^{2} }{2}

-  \frac{c}{b}

will translate the graph horizontally to the right by

\frac{c}{b}

units.

+d shifts the graph up by d units.

The new function then becomes:

y =  \cot(  \frac{ {\pi}^{2} }{2}  (x  -  \frac{\pi}{4} ) )+1

3 0
3 years ago
Read 2 more answers
Consider parallelogram ABCD, whose area is 162 sq. feet. If side AD equals 11 feet and the height DE equals 9 feet, find the per
allochka39001 [22]

Answer:

The perimeter of a parallelogram = 58 ft

Step-by-step explanation:

A parallelogram is a quadrilateral with opposite sides parallel and equal in length. Opposite angles are also equal.

Area of parallelogram = base × height

Area = 162 ft²

area = bh

b = ?

h = 9 ft

162 = 9b

divide both sides by 9

b = 162/9

b = 18 ft

The perimeter of a parallelogram = 2(b + s)

where

b = base

s = the other sides

The perimeter of the parallelogram = 2(b + s)

The perimeter of the parallelogram = 2(18 + 11)

The perimeter of the parallelogram = 2(29)

The perimeter of the parallelogram = 58 ft

4 0
3 years ago
Other questions:
  • A student performed the following steps to find the solution to the equation
    14·1 answer
  • Wat 1 +1 i stoopid need help now. NOW!NOW!NOW!NOW!NOW!NOW!
    14·2 answers
  • During a triathlon, Sharon swims 1/4 of the total route and cycles 3/5 of the remaining route. She runs the rest of the route. I
    14·2 answers
  • HURRY PLZZZZ!!!!!!!!!!
    7·2 answers
  • Write a percent equation that can be used to solve the following problem. 25 is what percent of 350?
    9·1 answer
  • What is the solution to this equation?<br> 4x + 16 - x = 22 + 6
    15·2 answers
  • Solve sint = cos2t, for –4π ≤ t ≤ –2π
    10·1 answer
  • PLLSSSSS HELLLP
    15·1 answer
  • Help me find the value of x please
    5·2 answers
  • Use the Distributive Property to express 64 + 24<br>___(__+__)​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!