Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

WebAssign For Differential Equations With Boundary-Value Problems

Authors: Dennis G Zill

9th Edition

1337879762, 9781337879767

More Books

Students also viewed these Mathematics questions

Question

2. Develop a good and lasting relationship

Answered: 1 week ago

Question

1. Avoid conflicts in the relationship

Answered: 1 week ago