Homework 3 (due:May 27th) Deadline : May 27th 11:59pm

Slides:



Advertisements
Similar presentations
6.2 Construct and Interpret Binomial Distributions
Advertisements

Exercise 4 1. Write a program that simulates coin tossing. For each toss of the coin the program should print Heads or Tails. Let the program toss the.
Zhang Hongyi CSCI2100B Data Structures Tutorial 2
Random Variables and Expectation. Random Variables A random variable X is a mapping from a sample space S to a target set T, usually N or R. Example:
Jan 13 (P)/ Jan 14 (W)- Warm Up 1. Empty right side of folder and put your papers in the correct section in your binder 2. Sketch a frequency bar graph.
VK Dice By: Kenny Gutierrez, Vyvy Pham Mentors: Sarah Eichhorn, Robert Campbell.
Monopoly Game Example Mutually Exclusive.
EXAMPLE 1 Construct a probability distribution Let X be a random variable that represents the sum when two six-sided dice are rolled. Make a table and.
The Derivative Function (11/12/05) Since we know how to compute (or at least estimate) the derivative (i.e., the instantaneous rate of change) of a given.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 6P. 1Winter Quarter I/O in C Lecture 6.
Variance Fall 2003, Math 115B. Basic Idea Tables of values and graphs of the p.m.f.’s of the finite random variables, X and Y, are given in the sheet.
Programming is instructing a computer to perform a task for you with the help of a programming language.
Check it out! : Simple Random Sampling. Players of a dice game roll five dice and earn points according to the combinations of numbers they roll.
The game of Craps Rules of play: 1. Played with two dice (six faces to a die – numbers 1-6 per face) 2. Sequence of betting rounds (or just rounds) 3.
Chapter 9: Simulation Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
An Introduction to Textual Programming
Computer Architecture B-tree construction & Traversal YongSoo Bae Room 236, Engineering Building [Project 1]
1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Lab 4: Nov 30, 2011 Final Project: Image Compression.
DiceRoller DiceRoller (object class) and DiceRollerViewer client class: Write a DiceRoller class (similar to Yahtzee) to: Allow the person to initially.
National Tsing Hua University ® copyright OIA National Tsing Hua University HSA HW2.
Chapter 4 Practice cont.. Practice with nested loops 1.What will be the output of the following program segment: 1.for (int i = 1; i
Lesson 10.5 AIM: The Game of Pig. DO NOW What is a strategy? Give an example from your daily life of how you use strategies.
CS1109 L AB 3 July 3rd. R OAD M AP Homework submission Review How to use function and scripts While-end Finish last exercise Lab 2 Challenge questions.
Homework #2: Functions and Arrays By J. H. Wang Mar. 20, 2012.
Homework #1: C++ Basics, Flow of Control, and Function Basics By J. H. Wang Mar. 13, 2012.
Homework #1: C++ Basics, Flow of Control, and Function Basics
Exercise 3 Example> Write a C function that implements /* input : integer value n output : */ int f ( int n ) { int i, sum=0; for (i=1;i
Binomial Probability Section Starter Here’s a game you will like: Let’s bet a dollar on this proposition: I will roll a fair die once. If.
Bernoulli Trials, Geometric and Binomial Probability models.
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
LADDERS nakes and Vector. 100 FINISH
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
1 Project 3 String Methods. Project 3: String Methods Write a program to do the following string manipulations: Prompt the user to enter a phrase and.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
Probability Distributions and Expected Value
Homework 1 (due:April 10th) Deadline : April 10th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
Homework 1 (due:April 8th) Deadline : April 8th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The name.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
Homework 2 (due:April 17th) Deadline : April 17th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The.
MR. CRONE Generating Random Numbers. Random Numbers Many programs require the computer to generate random numbers Random numbers are used in many applications.
C++ Programming HW14 Speaker : Ching-Chen Chang Date: 2008/05/23.
Homework 1 (due:April 13th) Deadline : April 13th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
J-LAB Weekly SOL PRAcTICE
CSc 110, Spring 2017 Lecture 12: Random Numbers
Recap: If, elif, else If <True condition>:
Introduction to Programming
One-Sample Inference for Proportions
Basic operations in Matlab
Homework 3 (due:June 5th)
CSc 110, Autumn 2016 Lecture 13: Random Numbers
PRG 410 Competitive Success-- snaptutorial.com
PRG 410 Education for Service-- snaptutorial.com
PRG 410 Teaching Effectively-- snaptutorial.com
For Monday Read WebCT quiz 18.
CS005 Introduction to Programming
Iteration: Beyond the Basic PERFORM
For Wednesday No new reading No quiz.
Programming in JavaScript
Programming in JavaScript
Programming in JavaScript
Programming in JavaScript
Homework 2 (due:May 15th) Deadline : May 15th 11:59pm
Homework 1 (due:April 17th)
Homework 2 (due:May 5th) Deadline : May 5th 11:59pm
Programming in JavaScript
Genome 540: Discussion Section Week 3
Homework 2 (due:May 13th) Deadline : May 11th 11:59pm
Presentation transcript:

Homework 3 (due:May 27th) Deadline : May 27th 11:59pm Where to submit? eClass 과제방 (http://eclass.cau.ac.kr) How to submit? Create a folder. The name of the folder should be “studentID#.hw3”. (ex) 20111499.hw2 We have three problems in hw3. Make three C source files. The name of the source files should be the format “studentID#.hw2.#.c” (ex) 20111499.hw3.3.c , 20111499.hw3.3.c , …, 20111499.hw3.3.c In each source file .c, your code must have comments that include your name and student_id# Put the source files into the folder we created. Compress the folder into a zip file. The name of the zip file should be “student#.hw3.zip”. (ex) 20111499.hw3.zip Upload the zip file into eClass website. If you don’t follow above instructions, you may get penalty in your score. You must do programming yourself.

1. [Standard Deviation] Write a program that gets an arbitrary number of positive float values until -1 is received from a keyboard (standard input) and print the mean and the standard deviation of the positive float values. Please use following formula for computing the standard deviation : standard deviation: : mean You may assume that input size N is less than 10000 meaning you may get up to 10000 input numbers.

2. [Random Number] Write a program that simulates the rolling of two dice. The program should use rand() to roll the first die, and should use rand() again to roll the second die. The sum of the two values should then be calculated. [Note: Since each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 the least frequent sums.] Your program should roll the two dice 36,000 times and print the number of cases among 36,000 and probability for each sum value. The result of your program should look similar to the following output example (exact number may be different).

Input example output example 3. [Ladder Game] Consider a ladder game we often do in our daily life. The ladder is represented as N vertical lines and M horizontal lines where each horizontal line connects points on two vertical lines, as shown in the figure below. Write a program that prints the final point number that are connected with each starting point as shown in input/output example Input type: In first line, number of vertical lines N (N<=10) should be given. In second line, number of horizontal lines M (M<=50) should be given. From next lines, a sequence of horizontal lines should be given in up-to-down order. Input example 5 4 1 3 3 4 2 5 2 3 output example 4 5 1 2 3