Binomial sequence and graph display

AI Thread Summary
The discussion revolves around plotting a binomial distribution curve based on a sequence of 0s and 1s, with specified probabilities for heads and tails. Participants clarify that the original question lacks sufficient detail regarding the interpretation of the sequence and the method for plotting. It is suggested that instead of using a single sequence, one should generate multiple random sequences to create a histogram that approximates the binomial distribution. The conversation also touches on the challenges of distinguishing between the distributions of heads and tails when using the binomial probability density function. Ultimately, the goal is to visualize the differences in patterns between biased and unbiased coin flips.
physics.alex
Messages
28
Reaction score
0

Homework Statement


Given a series of 0 and 1 , how can we plot the binomial curve ??
Example: 00000011100010010100011110

say,p=0.8 q=0.2, N=26


Homework Equations



If I apply the classic binomial formula, 26C0 (0.8)^0(0.2)^(26-0) etc.. seems cannot do so.
 
Physics news on Phys.org
It's not really clear what you're trying to do. Could you provide more details?
 
sorry my question is unclear
objective: plot a binomial distribution curve by giving a sequence of '0' and '1'

Example: 00000011100010010100011110

say,p=0.8 q=0.2, N=26
 
What are the 0s and 1s supposed to represent? The result of 26 trials with p=0.8? You can't get a binomial distribution curve from just that.
 
like coins flipping
0=H
1=T
p(H)=0.8
p(T)=0.2
 
Can you provide the complete text of the problem? You seem to be leaving out info that might make your question make sense.

Right now, you're asking something like: given that you rolled a pair of dice and they came up 2 and 4, how can we plot the probability distribution of all the possible outcomes?
 
Given a biasd coin and flip 26 times.
Example: HHHTTTHHHTTTTHHT p(H)=0.8
How to interpret the sequence using Binomial distribution? and How is the graph looks like?
 
What's the probability of getting n heads and m tails in (n+m) trials?
 
sorry the question is already posted.
We can make our assumption as long as it is a biased coin.

Example: total 26 trials (n+m) and prob. of getting head is 0.8
does it make sense??
The main objective is to show that in biased case, the plotted curve is easily be distinguished by just observing the graph
 
  • #10
So are you just asking how to plot the binomial distribution when it's hard to calculate because the numbers are big or small? You don't have an actual sequence of 1s and 0s, right?
 
  • #11
hm..yes we don't have the actual sequence according to the question.

what is wrong with the question?? The main objective is to plot the graph and see these 2 results (i.e.H or T) has a easy distinguished pattern. If it is the unbiased coin, i.e. p(h)=0.5, the pattern is not easy to distinguish.
 
  • #12
There's nothing wrong with the question; it's the way you asked it. It sounded like you were provided with a random sequence of 26 1s and 0s and wanted to somehow extract the binomial distribution from it.

Usually, when the numbers get too unwieldy to calculate the binomial distribution directly, you can approximate it by a normal distribution with the same mean and variance.
 
  • #13
Or do you want to generate a bunch of data and try to empirically produce the binomial distribution? If that's the case, just generate a bunch of sets of N ones and zeros randomly, and for each set, count the number of times one appears. Make a histogram of the results, and it should approach a binomial distribution.
 
  • #14
Ok if I take your approach, randomly generate 1 and 0, and would like to plot the histogram, what is the x-axis? y-axis should be the probability,right?
I use Matlab and run the following

clear;
x1=1:102;
y1 = binopdf(x1,102,0.2);

x2=1:102;
y2 = binopdf(x2,102,0.8);

plot(x1,y1,'+',x2,y2,'ro');

xlabel('symbols');
ylabel('probability');
title('Biased prob. of symbol H and symbol T');
legend('symbol H','symbol T');

I got the graph with two distribution with same height (i.e. same probability) and sounds doesn't make sense to me. (see attachment)
 

Attachments

  • HT.jpg
    HT.jpg
    12 KB · Views: 367
  • #15
Your code doesn't generate any random numbers. The function binopdf is the binomial probability density function.

You calculated the probability of x heads and, separately, the probability of y tails both out of n trials. Do you see why the probability of x heads is equal to the probability of n-y tails? If you understand that, it should make sense why you got the two curves you did.
 
  • #16
Because the only difference of these 2 curves is the p which can controls the curve position.
So you mean we cannot do so,right? How can I obtain 2 curves that easily to distinguish the H and T clusters??
 
  • #17
It seems I still have no idea what you're trying to do.
 
  • #18
ok .. if use histogram, we will have only 2 bars, one is shorter than another,right?
 
  • #19
No. What exactly are you trying to do?
 
  • #20
I am thinking what the graph looks like from your reply

"Or do you want to generate a bunch of data and try to empirically produce the binomial distribution? If that's the case, just generate a bunch of sets of N ones and zeros randomly, and for each set, count the number of times one appears. Make a histogram of the results, and it should approach a binomial distribution. "

I am trying to plot the graph that you suggested
 
Back
Top