Can someone help me to solve it by Matlab?
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
clc
clear all
close all
n=[4:8];
n=10.^n;
for i=1:length(n)
fprintf('For n=%d\n',n(i));
throws = n(i); % percent makes the rest of the line a comment
x=rand(1,throws)*2; % a vector of 10000 pseudorandom numbers
% in the range [0,2)
theta=rand(1,throws); % semicolon supresses printing
theta=0.5*pi*theta; % theta now 10000 random numbers between 0 and
pi/2
hits= x<=sin(theta); % hits is a vector of 0's where false
% and 1's where true
sum(hits); % no semicolon prints the number of hits out of the
10000 throws
piEst=throws/sum(hits)
end
Can someone help me to solve it by Matlab? Use the Boffon's Needle experiment to approximate...
Can someone help me to solve it by Matlab?
17. Write a script which does the following: S- Σ IMPORTANT! Make sure the summation runs BACKWARDS-that is, starts with k-N, and quits with k-1. After S is computed, multiply it by 6, take the square of the result, and report the answer. Run this for N 10, 100, 1000, and 10000. Hmmmmm....
Can someone help me to solve it by Matlab?
) Many dice games use two 6-sided dice, where each side faces up with equal probability, each turn consists of rolling both dice, and where the SUM of the two dice values is the outcome used in the game. Figure out how to simulate 3600 such die rolls, and then to make a nicely designed histogram displaying the outcomes as a PERCENT of the total rolls