How to resolve the algorithm Averages/Pythagorean means step by step in the EasyLang programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Averages/Pythagorean means step by step in the EasyLang programming language

Table of Contents

Problem Statement

Compute all three of the Pythagorean means of the set of integers 1 through 10 (inclusive). Show that

A (

x

1

, … ,

x

n

) ≥ G (

x

1

, … ,

x

n

) ≥ H (

x

1

, … ,

x

n

)

{\displaystyle A(x_{1},\ldots ,x_{n})\geq G(x_{1},\ldots ,x_{n})\geq H(x_{1},\ldots ,x_{n})}

for this set of positive integers.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Averages/Pythagorean means step by step in the EasyLang programming language

Source code in the easylang programming language

proc mean . v[] a g h .
   prod = 1
   for v in v[]
      sum += v
      prod *= v
      resum += 1 / v
   .
   a = sum / len v[]
   g = pow prod (1 / len v[])
   h = len v[] / resum
.
a[] = [ 1 2 3 4 5 6 7 8 9 10 ]
mean a[] a g h
print a
print g
print h

  

You may also check:How to resolve the algorithm Sleep step by step in the BBC BASIC programming language
You may also check:How to resolve the algorithm Numbers which are the cube roots of the product of their proper divisors step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Sorting algorithms/Cocktail sort with shifting bounds step by step in the FreeBASIC programming language
You may also check:How to resolve the algorithm Convert seconds to compound duration step by step in the VBA programming language
You may also check:How to resolve the algorithm Polynomial regression step by step in the Octave programming language