Homework Help: Probability and matlab

1. Oct 21, 2011

Bassalisk

1. The problem statement, all variables and given/known data
Write a code in MATLAB witch calculates the probability of having 2 students with same birth date, in group of lets say 15. Assumption: year has 365 days, and birth dates are uniformly distributed.

2. Relevant equations
3. The attempt at a solution

Now, i understand that this is a combination. We have 15 students, and 365 possible birth dates. So thats 36515. Those are all possible outcomes. Now I don't understand, how do you get the probability that 2 people have same birth date.

Please don't shoot at me the formula for binomial coefficients etc. I know there are formulas, I even have the solution, but I kinda don't understand it.

After we determine the analytical form of this problem, then I will try to code it into matlab. Although the main point of this is to get familiar with matlab and probability possibilities.

Keep in mind that I just started learning matlab, and this is my first exercise to code some probability into matlab.

Thank you

2. Oct 21, 2011

Ray Vickson

You say "I even have the solution, but I kinda don't understand it." Well, what is the formula, and what don't you understand about it?

RGV

3. Oct 21, 2011

Bassalisk

Since I am really new to this, I googled "probability two same", and stumbled upon birthday problem.

I understood it. It is in place.

How do I translate that into MATLAB? Do I simply put in the formula, and calculate it?

And in general, do you have any links, or recommendations, where statistics and probability is taken into matlab?

I am VERY new to this.

I have 4-5 more problems that I have to solve using simulations in matlab(all probability) and it would be inefficient to post each problem.