clear; clc;
n = 100; % size of 100 random people
I = ones(100, n); % initialize array I to all 1's
k = 1; % initialize since probability for only 1 person is 1
for j = 1 : 100 % begin for loop
I(j) = 1 - k; % each element of I is assigned a probability
k = k * (365 -j)/365; % then calculate new probability and
repeat
end % end for loop
plot(I, 'red') % plot the number of people vs. the
probability
title('probability of any two people having same birthday in group
of people');
xlabel('number of people in the group ');
ylabel('probability of any two people having the same
birthday');
In MATLAB, generate a way to calculate the minimum number of people needed for 2 people...
The R command sample (1:365,23, replace=T) > simulates birthdays from a group of 23 people. The expression 2 %int table (sample (1:365, 23, replace=T)) can be used to simulate the birthday problem. It creates a frequency table showing how many people have each birthday, and then determines if two is in that table; that is, whether two or more people have the same birthday. Use and suitably modify the expression for the following problems (a) Simulate the probability that two...
What is the minimum number of people whose random selection guarantees that two of them share the same birthday? (There are 366 unique birthdays.)
code in Matlab Problem 1: The MATLAB humps function defines a curve that has 2 maxima (peaks) of unequal height over the interval 0 2, f(x) = r-0.3)2 +0.01 (r-09 +0.04 Use MATLAB to generate a plot of Kx) versus x with x [0:1/256:2: Do not use MATLAB's built-in humps function to generate the values of Rx). Also, employ the minimum number of periods to perform the vector operations needed to eneate x) values for the plo Problem 1: The...
2) There are 4 people at a party. Consider the random variable X=’number of people having the same birthday’ (match only month, N=12). a. Define the sample space S and the associated probability function (pf). Plot pf. b. Plot the associated exceedance probability function G(x)=Pr[X> x]; c. Compute mean and standard deviation of X.
FOR MATLAB: generate a function that determinws if a number is a prime number. Do not use any MATLAB build-in functions . The function should output 1 for numbers that are prime and 0 for numbers that are not prime. The function should be able to accept input as a vector.
We have seen that the probability that at least two people in a group of 23 people share the same birthday is approximately 0.5. In this question we are interested in the probability that at least three people in a group of 23 people share the same birthday. Draw 23 numbers independently from the integers {1, 2, . . . , 365} with each number equally likely to be drawn. Let E be the event that at least one of...
MATLAB QUESTION Generate a 2 times 4 matrix variable mat. Verify that the number of elements is the product of the number of rows and columns.
Use MATLAB A data engineer working for The Gabba Stadium has recorded the number of people attending AFL events in 2018. This data has been provided on Blackboard in a csv file (GabbaAttendance.csv). The data engineer claims that the average attendance at an event is 15,000 people and your task is to determine whether this is valid or not, by following the steps below. 1. Using MATLAB, import the data using csvread and determine the number of samples, sample mean...
Please Solve this Question anyway either by using MATLAB or any other way ..... QUESTION : Generate a square wave with peak as last 2 digits of your roll number. Find the overshoot value for this square wave. How many harmonics are required to generate this square wave with 9% overshoot. Find the overshoot when 101 harmonics are used. Find the overshoot when 401 harmonics are used. Exploit the effect of odd harmonics in generating a square wave. Draw necessary...
For the following scenarios, please tell me what the minimum sample size needed is, rounded up to the nearest integer (e.g., if your answer is 51.3, round it up to 52). Remember that you cannot survey a fraction of a person – it has to be a whole person. If you round down, then you won’t have the minimum amount of precision needed, so you must round up. For the z-scores, refer to table provided Confidence Level z-score 90% 1.65...