Histogram for binary random variable. Number of replications is m. Right now this works best for large number of trials--since the bars are drawn with pen, they are rounded on top and bottom, making them not suitable for small n. Also, the y-scaling is based on the height of the bar at the expected value, which empirically is not necessarily the tallest bar in the histogram, so small values of n are more likely to produce bars that run off the top of the page.
A binary random variable is one which has a "n" trials, each with probability "p". An example would be a ring toss game at the beach. Say you have three tries to toss the ring at a peg. Also suppose the game is really hard, and there is only a 10% chance of getting the ring on the peg for each throw. Then the possible outcomes are: 1) You win all three tosses 2) You win two tosses, and lose one toss 3) You win one toss, and lose two tosses 4) You lose all three tosses Which of these four outcomes is most likely to occur? We can investigate this using a histogram. In this example, the number of trials is n=3, and the probability of success (in percents) is p=10.