Observers agree that a citizen of Ohio had much larger voting power than a citizen of Texas or California in the recent US presidential election. Why is it so? A brief introduction to the theory of voting will be provided. We analyze the voting power of a member of a voting body, or of a person which elects his representative, who will take part in the voting on her behalf. The notion of voting power is illustrated by examples of the systems of voting in the European Council. We propose a representative voting system based on the square root law of Penrose. Using statistical approach and considering fictitious countries with randomly chosen populations we study the problem of selecting an optimal quota.