HP20b's 1-variable weighted function


Has anyone had a go at trying to implement the 1-variable weighted function that is part of the Statistical Suite available on the HP20b. Apart from a brief cursory mention in HP's official manual for this calculator there is no example or explanation of what this function does or how to implement it. I presume it helps one to determine the expected value of a random variable by inputting random variable outcomes into the X: register and their associated probabilities in the Y: register but I cannot seem to get any results. If anyone knows how this function operates I would appreciate some assistance or guidance.

Cheers and have a nice day,



AFAIK the 20b calculates a *weighted mean*. It does it the conventional way with the weights in y. I don't remember any "weighted function" but I don't have my calc at hand.


This is for the 30b, but take a look here:

30b frequency and weights


Thanks guys for your help. I see now that the trick is that the Y-values are entered as frequencies {F} and NOT as relative frequencies {Fi/Sum(Fi)} (or probabilities) which is what I thought I had to do. In essence then this is not very much different from the approach used with the HP 10B and HP10BII. By the way Gene I think that little Guide entitled: "The HP 20b Business Consultant" was really great and that in your next update you might want to slip in a line or two on the matter discussed here.

Thanks again for you time and assistance,



Oh, I did not write that. Tough to cover everything that is important in a small guide, however. :-)


Interestingly, even though the HP20b was designed to replace the simpler but very popular HP-10B and HP-10B2, the latter two calculators can provide a weighted mean irrespective of whether the weights are entered as frequencies or relative frequencies. Its a pity the HP-20B dispenses with this flexibility as it means one cannot compute the expected value E(X) of a random variable X in the conventional fashion.


True, but the frequency statistics have a much greater breadth to them than the basic "weighted average".

To get a weighted average is actually pretty easy and requires rethinking the input only slightly.

If you have a random variable with a 40% chance of 10 and a 60% chance of 5, you can of course input the weights as 40 and 60 in 1 Freq mode or even as 4 and 6 in 1 Freq mode and the Descriptive submenu reports the correct mean.

Possibly Related Threads...
Thread Author Replies Views Last Post
  HP50g: Writing a function that returns a function Chris de Castro 2 1,611 12-10-2013, 06:49 PM
Last Post: Han
  hp-prime solver and variable name fabrice48 22 6,196 12-10-2013, 03:25 AM
Last Post: fabrice48
  Prime: Scope of Variable and functions within programs Thomas Chrapkiewicz 9 2,560 11-18-2013, 03:39 PM
Last Post: Thomas Chrapkiewicz
  HP Prime - Variable problem bluesun08 12 2,836 11-07-2013, 11:34 AM
Last Post: bluesun08
  WP34S donor case from HP20B? Andrew Davie 6 1,628 06-20-2012, 01:26 AM
Last Post: Walter B
  50G variable issue Matt Agajanian 8 2,003 05-21-2012, 03:14 PM
Last Post: Matt Agajanian
  HP20B Development Kit Andres Capdevila 6 1,745 03-30-2012, 06:26 PM
Last Post: Andres Capdevila
  Reminders/notes to help recall variable meanings in equations Chris C 11 2,495 02-16-2012, 06:53 PM
Last Post: Bart (UK)
  Repurposing the HP20b in an engineering class Peter Murphy (Livermore) 4 1,288 12-31-2011, 10:02 AM
Last Post: Marcus von Cube, Germany
  WP-34S: HP20B vs HP30B keyboard Rob Willett 3 1,039 10-24-2011, 03:56 AM
Last Post: Paul Dale

Forum Jump: