×

### Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

or

by: Eunice

15

0

1

# Week 6 Notes CS 1110-002

Eunice
Cornell

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

Iterations Random Simulations While Loop/Open-Ended Iterations
COURSE
Intro to Computing using Python
PROF.
Lee, Van Loan
TYPE
Class Notes
PAGES
1
WORDS
CONCEPTS
Python, CS
KARMA
25 ?

## Popular in ComputerScienence

This 1 page Class Notes was uploaded by Eunice on Saturday March 5, 2016. The Class Notes belongs to CS 1110-002 at Cornell University taught by Lee, Van Loan in Spring 2016. Since its upload, it has received 15 views. For similar materials see Intro to Computing using Python in ComputerScienence at Cornell University.

×

## Reviews for Week 6 Notes

×

×

### What is Karma?

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 03/05/16
CS 1110 Van Loan and Lee Spring 2016 March 1, 2016  random simulations o random in cs: means no discernable pattern o dart ex.  4:pi::the number of dart throws:hits o random Module  random.randint(a,b)  gives back a random integer between a and b, including a and b  renaming a function o “from random import randint as randi” o after this, refer to random.randint(a,b) as randi(a,b)  random.uniform(a,b)  random floats  random.normalvariate(mu,sigma) o short cut  x += 1  same as  x = x + 1 o repeatability of experiments  random.seed  reset the algorithmic process and fix the random generation process’s start point o having the same start point means that the same random sequence will be applied and the simulation can be repeated March 3, 2016  iteration: the while-loop  open-ended iteration: o do a certain execution until a certain characteristic/event appears o “[code that comes before the loop] o while [a Boolean expression]:  [the loop body] o [code that comes after the loop]”  see slides for examples of while loop

×

×

### BOOM! Enjoy Your Free Notes!

×

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

Bentley McCaw University of Florida

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Anthony Lee UC Santa Barbara

#### "I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!
×

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com