Question
1. create Matlab function randword that receives an integer size as input and outputs a random word of length size (defined as a vector of
1. create Matlab function randword that receives an integer size as input and outputs a random word of length size (defined as a vector of characters) on the usual alphabet.
To this aim, your function will compute a random vector with components in {1, . . . , 26} and then replace each component with the corresponding letter in the alphabet.
2.create another Matlab function Iamrandom that receives two integers size, iterations and a word name (array of characters) as inputs and that generates iterations times a random word of length size
3. Use the function Iamrandom to check how many times your name appears in a random word of length 10000 out of 100 attempts. Write the result under the form:
Today I was random . . . times, where the . . . is replaced with the number of successes in the 100 experiments.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started