﻿ Power Mean Inequality Curve Power Mean Inequality Curve
program   click   explore   help   Update 2012-04-03
XYGraph v2.3 - web page graph   ☜☞   donate   get code
The Cauchy-Schwarz Master Class   J. Michael Steele   ★★★★★
This file is personal home work. No one
If you suspect any view point wrong,
Freeman 2009-06-19-10-46

Did not test other browser. This file is
written under MSIE 6.0

<a name="powMeanBgn"> 2010-02-19-12-53
Output may contain error, Please verify first
Program environment is MSIE 6.0, please use MSIE
If you save this file powmean2.htm to your computer
and open local powmean2.htm, it can not draw figure.
You need also save http://freeman2.com/jsgraph2.js
to your computer stay in same folder as powmean2.htm

Graph area size, W: H:   complex
x min: , x max: ; y min: , y max: ;
x/y min/max : auto scale, user scale Click button
 10^ ; +/0 , +/0/- ; digits Help1 fill numbers; integer; eq.p
 Box 1, xj sequence 0.27 5.92 6.89 3.47 9.41 nonnegative number sequence Box 2, pj sequence 0.181 0.103 0.226 0.237 0.253 weights must sum to one Box 3, output Box 4, drawDot xj sequence elements all >=0 pj sequence elements all >=0 SUM[j]{pj}=1 is required. If fill t value at box 5 curve draw dot, dot Mt value save to box 4 (here)
pk power. If not one, use steps=300+ 2010-02-25-11-22

t bgn , t end steps
Click to RUN control center
Why 'A', 'B' ?
 { k=n ∑ k=1 pkxkt } 1/t
Box 5, dots t values

<a name="figure0801">
Next is first version Power Mean Inequality Curve
used in tute0030.htm. It is a fake power mean curve.
Because it is created from a mathematics equation
not created from real x-sequence and p-sequence.
Figure 8.1 ; 2010-02-15-22-42

<a name="DrawEx0803">
Next is comparison of Power Mean Inequality Curve (red)
with probability coefficient sum to one and curve (blue)
which drop all probability coefficients. Both curves
are fake, made from fabricated math equation.
Exercise 8.3 ; 2010-02-25-03-09

<a name="docA001">
2010-02-19-16-20 start
This file Power Mean Inequality Curve
http://freeman2.com/powmean2.htm
is written during Liu,Hsinhan study
the book
The Cauchy-Schwarz Master Class
J. Michael Steele ★★★★★
<a name="docA002">
ISBN 978-0-521-54677-5
chapter 8 The Ladder of Power Means.
At first, LiuHH create a fake curve
But not satisfied.
Start code from 2010-02-18-14-07
done  code  at  2010-02-19-12-??

<a name="docA003">　pPow　program
Page control panel is next
[[
<a name="powMeanBgn"> 2010-02-19-12-53
Graph area size, W:[300]  H:[300]
x min:[-5], x max:[5] ; y min:[0], y max:[10]  ;
x/y min/max : ▣auto scale, □user scale Click button
10^[1] ; ▣+/0 , □+/0/- ;  [5] digits Help1
"random5#" fill [20] numbers;  □integer;
<a name="docA004">
Box 1, xj sequence
Box 2, pj sequence
Box 3, output
Box 4, drawDot
t bgn [-5]  , t end [5] steps [30]  "dt"  "ds"
Click to RUN "PowerMean" "wipe" "random5#" control center
{ ∑[k=n,k=1] pkxkt }1/t
Box 5, dots t values
]]

<a name="docA005">
Graph area size, W:[300]  H:[300]
Let user decide drawing board width
and height.

x min:[-5], x max:[5] ; y min:[0], y max:[10]  ;
Let user decide x-axis two end values
and y-axis two end values.

<a name="docA006">
x/y min/max : ▣auto scale, □user scale
Let user decide use auto scale or
use user scale.
If choose auto scale, above boxes
values are ignored.

"Click button " let user go to
Click button "PowerMean" quickly

<a name="docA007">
10^[1]  ;
Random generated in the range [0,1]
If fill 1 to [1], program stretch
random number to [0,10] (10^1=10)
If fill 2 to [2], program stretch
random number to [0,100] (10^2=100)

<a name="docA008">　pPow　program
▣+/0 , □+/0/- ;
If choose ▣+/0 , output random positive
or zero, no negative. This is default.
If choose ▣+/0/- , output random positive
or zero or negative. In this file
xj sequence and pj sequence must be +/0
Negative number is not allowed.

<a name="docA009">
[5] digits
If fill 5 to [5], output to 1.2345
If fill 8 to [8], output to 32.456789

Help1
Bring user to here.

<a name="docA010">
"random5#"
is execution button. generate random
numbers. output to box 1 for xj sequence
and output to box 2 for pj sequence

fill [20] numbers;
If fill 20 to [20], xj sequence has 20
numbers, pj sequence has 20 numbers.

<a name="docA011">
□integer;
If check □integer, xj sequence is
integer only. (pj can not be integer)

Box 1, xj sequence
Let user define his own xj sequence

<a name="docA012">
Box 2, pj sequence
Let user define his own pj sequence
pj must sum to one. tolerance=1.e-8
if abs(sum_pj-1)>tolerance ERROR.

Box 3, output
output curve (t,Mt) coordinates values.

<a name="docA013">　pPow　program
Box 4, drawDot
Output user specified t value (t,Mt) pair.
If want to know Mt value for t=1.23456
t=1.23456 may not occur in "Box 3, output"
User input 1.23456 to box 5, program
send (t=1.23456, Mt) pair to box 4
and draw a dot at t=1.23456.

<a name="docA014">
t bgn [-5]  , t end [5]
Program draw (t,Mt) pair lines, start
at t="t bgn [-5]", end at t="t end [5]"
If "t end [5]" > "t bgn [-5]" autoscale work.
If "t end [-5]" < "t bgn [5]" userscale work.

<a name="docA015">
steps [30]
If fill 30 to "steps [30]", program draw
30 short straight lines to build curve.
minimum value is 10.

"dt" delete "t bgn" and "t end"
"ds" delete "steps"

<a name="docA016">
Click to RUN "PowerMean"
powMeanf() execution button is
"PowerMean"

"wipe"
to delete drawing

<a name="docA017">
"random5#"
second random button.

control center
goto control center quickly

<a name="docA018">　pPow　program
{ ∑[k=n,k=1] pkxkt }1/t
Equation for Mt and t not=0

Box 5, dots t values
default t value be
-1 0 1 2
Output to box four

<a name="docA019">
Drawing output has a top red dash
and a bottom red dash lines.
Top one is M+∞=maximum value of xk
k=1 to n
Bottom one is M-∞=minimum value of
xk, k=1 to n

<a name="docA020">
This program may not be perfect.
But you have what I have.
Happy playing !!
Thank you for visiting Freeman's page.
2010-02-19-17-25 stop

Javascript index
http://freeman2.com/jsindex2.htm   local
Save graph code to same folder as htm files.
http://freeman2.com/jsgraph2.js   local