Você está na página 1de 8

Assignment 01

The chance of win is to change the decision to take the other door open. It is because within three doors
if I select one, then the probability of win is 1/3. Then the host had shown the other door (rest of two
doors) one is filled with trinkets. Then I can see the last door and first door is the targeted door. If I
change my decision then win of chance is 2/3 which is greater than 1/3. So my decision would be to
change my decision so that I can win.

I have shown matlab program to justify my thought when I have 3 doors is given below:

clear all
clc

Justification_number=input('Enter the number of simulation time: ');


change = 0; stick_to_the_point = 0; counter_c = 0;
for i = 1:Justification_number
Jaguar = randi(3);
guess = randi(3);
trinkets = randi(3);

if(Jaguar~=trinkets)
counter_c = counter_c+1;

if (Jaguar == guess)
stick_to_the_point = stick_to_the_point+1;

else
if (Jaguar ~= guess)
change = change +1;
end
end
end
end
R = sprintf('Appropiate justification number %d',counter_c);
disp(R)
NS =sprintf('The number of chance by remaining same decision is
%d,',stick_to_the_point);
disp(NS)
S = sprintf('The number of chance to win by changing desicion is
%d,',change);
disp(S)
disp('ALWAYS CHANGE THE DOOR DECISION!');
justification_result_bar = [change stick_to_the_point];
bar(justification_result_bar)

Result:

Enter the number of simulation time: 3

Appropriate justification number 3


The number of chance by remaining same decision is 1,

The number of chance to win by changing decision is 2,

ALWAYS CHANGE THE DOOR DECISION!

Graph:

Here we can see if I have three doors to decide the number of chance to win by changing decision is 2,
where the same door remains is 1. So probability is to win always high to change the decision.
Now I can justify my result to simulate it different times to consider different number of doors then it will
show I have to always change my decision to win.

If I simulate the program 20 times

The results would be:


This is shown that the chance of win is 8 to change the door whereas remain the same door is 6 within
fourteen justification times.

So here I can decide to change the decision.

If I simulate the program 50 times

The results would be:


This is shown that the chance of win is 20 to change the door whereas remain the same door is 9 within
twenty justification times. There is high chance to win if I change.

So here I can say it is best to change the decision.

If I simulate the program 80 times

The results would be:


This is shown that the chance of win is 35 to change the door whereas remain the same door is 16 within
fifty one justification times. There is high chance to win if I change.

So here I can say it is best to change the decision.

If I simulate the program 100 times

The results would be:


This is shown that the chance of win is 33 to change the door whereas remain the same door is 22 within
fifty five justification times. There is high chance to win if I change.

So here I can say it is best to change the decision.

Simulation to win
Run the simulation Chance to win to change Chance to win to stick
3 2 1
20 8 6
50 20 9
80 35 16
100 33 22

Finally we can say that if we want to win we have to switch the decision to win because the probability
to win is always high if we switch.

Você também pode gostar