Question: Missing a linegraph plot for Statistics

Dear Maple users

The Statistics package contain a Histogram command which can produce a linegraph (or what you call it). Ex:

 

with(Statistics):

A:=[3,5,7,2,11,2,1,10,6,15]:

Histogram(A,discrete)

 

It will calculate the frequency of each of the outcomes as they appear in the list and will plot them accordingly: 

 

The outcome 2 has frequency 2/10 = 0.2, because it appears twice ... What I am looking for is however a command which is a bit more general. I want it to take a list containing the outcomes, A, and a list of their frequencies, say:

A:=[3,5,7,2,11,2,1,10,6,15]:

B:=[0.23, 0.11, 0.05, 0.05, 0.04, 0.06, 0.10, 0.20, 0.06, 0.10]:

and then make a linegraph with a line of height 0.23 over the outcome 3, etc... Notice that in my list A the outcome 2 appears twice, so their frequencies should be added: 0.05 + 0.06 = 0.11. I have been looking for commands to do the job for quite some time, but didn't succeed. I feel sure, though, that it can be done somehow. I hope someone can help.

NB! The values in the B list does not have to come from a Random Variable, but can be arbitrary.

 

Regards, Erik

Please Wait...