{'fraction_non_alphanumeric': 0.016728624535315983, 'fraction_numerical': 0.0, 'mean_word_length': 5.267441860465116, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Importance sampling: an illustrative introduction

The technique of importance sampling can lead to a considerable reduction in the uncertainties (variance) inherent in random sampling. The technique is explained, and is illustrated by simple examples. It is shown that the variance may be reduced by weighting so that each sample makes an almost equal contribution to the estimate: this is shown graphically. A BASIC program demonstrating importance sampling is available with and may be downloaded from the online version of this paper.