All in Java
Programs and Sources


More information about the JavaScript program Mischpoke can be found in the article The Engagement Party. In summary, the program computes, how many guests will come to a party (in the statistical average), if a couple invites all brothers and sisters, plus all the partners of their brothers and sisters, plus all the sisters and brothers of these partners and so on.

The form at the end of this page is for input and output of the data. In column Family Size the percentage of 1-child families, 2-child families etc. relative to the total number of families with children can be specified. The default data are from Germany (2005), and can be found in Wikipedia. You may change the values, to test the impact on the result. Because the total sum has to be 100%, you should erase one of the fields after each change. The program will then fill this field with the difference to 100%.

In column Additional Data the most interesting value is the %age of Singles. The default value is also from Germany (2010) and can also be found in Wikipedia. Of course, you may change it as well for experimental reasons. For example, the totaly unrealistic value 0% as percentage of singles, will result in the fact, that only even numbers of guests will come, because every guest has a partner, which accompanies her or him.

By Samples you may specify, how many samples are calculated by the program. For every sample the number of guests is randomly computed, taking into account the probability of a person to belong to a family of a certain size or to be a single. The corresponding entry in column Guests is incremented by 1, so a statistical distribution of the numbers of guests will emerge in the end. After all samples have been computed, the absolute values will be completed by the percentage of this number of guests in relation the total number of samples, which will tend to the probability, that this number of guests will come to the party. Of course it holds: the more samples, the better the result (in comparison with the theoretical values, computed in the article The Engagement Party, and if the default values of family size and percentage of singles are left unchanged). The run time is acceptible, even if one specifies 1000000 samples, so you are encouraged to specify large numbers.

The field Emergency Break counts, how often the program had to stop the computation, because of too deep a level of recursion. If the input of family size and percentage of singles is realistic, this will not happen at all. However, if you specify a percentage of singles of 0% and a percentage of 1-child families of 0%, the number of guests will be ∞, because both the bride-to-be and the bridegroom-to-be have sisters or brothers, each of them has a partner, each of the partners has sisters or brothers and so on. Hence, the depth of recursion has to be limited.

After the page is loaded or after a click on the Reset button the column Guests shows the theoretical values (as far as they have been computed in the said article). After a click on the Compute button the statistical distribution of the expected number of guests is shown in absolute numbers and as percentage.

The source of the program (with commentaries in German) can be found in the source code of this website.

Family Size (Percentage) Aditional Data Guests