Global variable
This variable can be accessed throughout the program but not constrained to a function
Local Variables
Local variables are those that are declared inside a function and can be accessed only inside a function
Answer is
LOCAL VARIABLE
Question 1 2 pts variable is created inside a function. global constant named constant local Next...
Problem 1 (20 pts) Global variables are declared outside any function and can be accessed by any function in MATLAB. In contrast, local variables are declared inside a function, and can be used only inside that function. In this homework, you will create two global variables containing x and y coordinates of points to be plotted. You will also create a plotting function which will access the global variables. a) Create the function plotFunct with no inputs and no outputs....
Question #37 Let X be a continuous random variable with the following density function: p(-x+ /2) for - 0<x<00. Calculate E[X | X > 0). Possible Answers B 1/727 © 12 D/2TR Ⓡ 1.00
Question 6 (1 point) Suppose a function f(x) is differentiable everywhere and has a local minimum at x=c. If f(x)<O when x<c, and f'(x)>0 when x>c, then by the Global Interval Method we know x=c is O a local maximum an absolute maximum a local minimum an absolute minimum
Instructor-created question A consumer's preferences are given by the following Cobb-Douglas utility function: Assume Px > 0, P, > 0, and I > 0 a. In the limit, what is the marginal utility of xas x goes to zero and what is the marginal utility of y as y goes to zero? lim MUY ra3 lim MU, -
EXERCISE (x2+1), where . < 1) A random variable X has the density function f(x)= a) Find the value of the constant C b) Find the probability that X lies between 1/3 and 1
9. Electric Field Inside an Insulator (25 pts.) A spherical insulator has constant charge density, total charge > 0, and radius B. What is the magnitude of the electric field at a distance B/2 from the center of the sphere? Give the answer in terms of Q, B, and K, where K is the constant from Coulomb's law. Hint: Use Gauss's law.
Write a C function named: div() with one local variable: m to prompt the user to enter one integer for the local variable m. When you call the function, it should display one of the following lines: If m is divisible by 9 the function displays the message m is divisible by 9 If m is divisible by 3 and not divisible 9 (e.g. 24) the function displays the message m is divisible by 3 If m is neither divisible...
Write a Python program which simulates how a bank account works. (1) create a global constant INTEREST_RATE as the interest rate, which is assigned value 0.01. (2) create a global variable balance, which is initialized to 1000. (3) define a function named deposit which takes no parameter, it asks user to enter the amount of money that will be deposited into this account, then updates the global variable balance (which should increase by the amount of the deposit) and prints...
The distribution function of a random variable X is given by 0 Fw={ F(2) = 1+2 <-1 -1<r<1 => 1 "iszai (a) (5 points) Find the p.d.f(f(x)) of X (b) (5 points) Find P(0.3 < X <0.5)
4. [10 pts] Let X be a random variable with probability density function if 1 < a < 2, 2 f(a)a 0 otherwise. Find E(log X). Note: Throughout this course, log = loge.