Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@Mark: I also posted this question in mathexchange (after Dougkas comment). Robert Israel also asked this question, and my answer: You right, in the case of irrational $p$ we can't have exactly $Np$ $1$'s. However, for very large $N$ we can approximate it with "error" small as we want. By the way, in this site : j.ee.washington.edu/~bilmes/classes/ee515a_spring_2012/… you can find a lecture notes in which there are some nice properties of type class (starting from page 13 in the pdf), which maybe will help.