# The birthday problem

## Introduction to the problem to be solved

There is a planet whose years have 100 days. In this planet there are 5 people, so,

calculates in extent all possible cases. What is the probability that two people

were born on the same day?

## The data structure

This is the vector `v`

. Its size is equal to the number of people in the planet.

Each item in the vector represents the day each person was born. So

```
-------------------------------
v: | 1 | 4 | 1 | 7 | 6 |
-------------------------------
```

Person 1 was born the first day of the year, person 2 was born de fourth day, the third

person the first day of the year (same day as the first person) â€¦

The numbers in the vector are in the range `1..n_days`

## The process

It consists in testing all combinations in the vector and test if there are two or more

people who were born the same day.

## Results

Execution time using `$ time `

from command line. Fortran code was compiled using *gfortran*.

- GNU Fortran recursive 39.48s
- GNU Fortran iterative 54.69s
- Intel Fortran recursive 2m 14s
- Intel Fortran iterative 2m 54s
- Julia recursive 4m 55.69s
- Julia iterative 7m 25.34s