ENGIN W7 Lecture Notes - Lecture 11: Matlab, Time Complexity, Binary Search Algorithm
Document Summary
Introduction to computer science for scientist and engineers-engin7 lecture 11. Monte carlo methods use iteration to repeat the same calculation many times, with different (randomly sample) input values each time. Resulting output variable distributes reflect effects of input data uncertainties. Call rng(1) in the beginning of your code, so you get the same random numbers. Most computer-generated (e. g. matlab) random numbers are actually pseudo-random. Long list of pseudo-random numbers pre-programmed into matlab. Transformations from simple random quantities to all commands incorporating randomness. Before computers, there were books of random numbers! %get the current generator settings s=rng x=rand(1,5) %rand generates some values rng(s) 2/9/18 y=rnad(1,5) %generates the same values so x and y are equal. Figuring out how much disk space used. Keep cutting the number in half (is what you"re looking for greater than or less than) Assume mysum is initialized as 0. for j=1:m for i=1:n mysum=mysum+1; end end.