Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab probelm Write a function called event that simulates the scenerio below. The function should have no inputs and a single output that must be
Matlab probelm
Write a function called event that simulates the scenerio below. The function should have no inputs and a single output that must be either 0 or 1 A given bag of candy has 30 pieces of candy. Each piece of candy has an equal probablity of being any one of four different flavors. Simulate a bag of candy and have your function return a 1 if there are 3 or fewer pieces of a given flavor. If there are 4 or more pieces of all four flavors, return a 0. Your Function C Reset MATLAB Documentation 1 function out-event Code to call your function C Reset 1This script calculates the approximate probability 2 cnt 8 3 for j-1:100 cnt-cnt+event: 5 end 6 100 (cnt/1000)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