How to resolve the algorithm Averages/Pythagorean means step by step in the PureBasic programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Averages/Pythagorean means step by step in the PureBasic 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 PureBasic programming language
Source code in the purebasic programming language
Procedure.d ArithmeticMean()
For a = 1 To 10
mean + a
Next
ProcedureReturn mean / 10
EndProcedure
Procedure.d GeometricMean()
mean = 1
For a = 1 To 10
mean * a
Next
ProcedureReturn Pow(mean, 1 / 10)
EndProcedure
Procedure.d HarmonicMean()
For a = 1 To 10
mean.d + 1 / a
Next
ProcedureReturn 10 / mean
EndProcedure
If HarmonicMean() <= GeometricMean() And GeometricMean() <= ArithmeticMean()
Debug "true"
EndIf
Debug ArithmeticMean()
Debug GeometricMean()
Debug HarmonicMean()
You may also check:How to resolve the algorithm Roman numerals/Decode step by step in the Julia programming language
You may also check:How to resolve the algorithm Make directory path step by step in the Arturo programming language
You may also check:How to resolve the algorithm Classes step by step in the Elena programming language
You may also check:How to resolve the algorithm FizzBuzz step by step in the Kotlin programming language
You may also check:How to resolve the algorithm Knuth shuffle step by step in the LabVIEW programming language