To download NI software, including the products shown below, visit ni.com/downloads.
Overview:
Coding that exemplifies how to solve the birthday problem and other similar probabilistic calculations.
Description:
If you have ever heard the Birthday Problem, you know that the answer is incredibly surprising, even if you understand the math. Humans have a very hard time making accurate predictions in these scenarios with their intuition. Instead, use this Birthday Problem Solver! For those of you who don't know what the Birthday Problem is, the question asks how many people need to be in the same room for you to expect that it is more likely than not that any two of them were born on the same day of the year. Or to say it differently, how many people are needed to have greater than a 50% chance that any two of them have the same birthday. For simplicity, the problem assumes that all birthdays are equally likely and leap years are ignored. Take a second to think about the answer on your own, and then run the attached VI in its default conditions to get the actual answer.
If you have ever heard the Birthday Problem, you know that the answer is incredibly surprising, even if you understand the math. Humans have a very hard time making accurate predictions in these scenarios with their intuition. Instead, use this Birthday Problem Solver! For those of you who don't know what the Birthday Problem is, the question asks how many people need to be in the same room for you to expect that it is more likely than not that any two of them were born on the same day of the year. Or to say it differently, how many people are needed to have greater than a 50% chance that any two of them have the same birthday. For simplicity, the problem assumes that all birthdays are equally likely and leap years are ignored. Take a second to think about the answer on your own, and then run the attached VI in its default conditions to get the actual answer.
This program has been made generic so that it can solve other problems similar to the Birthday Problem but with different inputs. It also can answer a questions of the form, "What are the odds that any two out of the X of us have the same Y?". An example being, "What are the odds that any two out of the 20 of us have the same last four digits of our credit card number?". Again, the answer to this question might surprise you.
Requirements:
LabVIEW Base Development System 2012 (or compatible).
Steps to Implement or Execute Code:
1. Open the attached VI named “Birthday Problem Solver LV 2012- NI Verified.vi”.
2. Run the VI.
3. Turn the boolean control on and off, and verify the change on the graph.
Additional Information or References:
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.