clc;
clear all;
close all;
N = input('input a natural number');
X =randn(1,N);
Y =randn(1,N);
M=0;
for i =1 : N
if((X(i))^2 + (X(i))^ 2)<= 1
M=M+1;
end
end
display('The probability is ');
M/N
This program is written as per the psuedo code.
sample output is attached.
Get Answers For Free
Most questions answered within 1 hours.