AP Computer Science A Practice Test 6 - Picture and Elevens Labs
|
|
- Homer Walters
- 5 years ago
- Views:
Transcription
1 AP Computer Science A Practice Test 6 - Picture and Elevens Labs Name Date Period 1) What are the RGB values for a white pixel? R, G, B = 2) a) How many bytes does it take in the RGB color model (including the alpha value) to represent a pixel? b) What primitive data type is best suited to store such a color? 3) Which of these pixels having these RGB values is the brightest? a. (5, 50, 17) b. (80, 80, 80) c. (100, 20, 30) d. (180, 170, 79) e. (70, 100, 180) 4) Assuming a no-argument constructor exists for Picture and SimplePicture, which of the following would not compile? a. DigitalPicture obj = new Picture(); b. DigitalPicture obj = new SimplePicture(); c. Picture obj = new SimplePicture(); d. SimplePicture obj = new Picture(); e. Picture obj = new Picture(); 5) For a 1.8 megapixel (1,800,000 pixels) image with 1500 rows, what are the (r, c) coordinates of the pixel in the lower right corner? (r, c) = ( ) 6) For a pixel array having 36 rows and 22 columns, how many times will the code in code area #1 be executed? for (int row = 34; row < pixels.length; row++) for (int col = 10; col < pixels[0].length; col++) // code area #1 Number of times =
2 7) In the Picture Lab, the following code was used to access and modify a pixel s red color. public class Pixel public int getred() public void setred(int value) a) Write a method int getcountredovervalue(int value) that returns a count of the number of pixels in the current picture that have a red value greater than the parameter value. public int getcountredovervalue(int value) Pixel[][] pixels = this.getpixels2d(); b) Write a method setredtohalfvalueintophalf() that sets the red value for all pixels in the top half of the picture to half their current red value. public void setredtohalfvalueintophalf() Pixel[][] pixels = this.getpixels2d();
3 8) Which of the following code segments correctly stores in int variable r1 and r2 random unequal integers, each of which can be between 0 and n-1, inclusive? Circle all that are correct. (A) r1 = (int)(math.random() * n - 1); (B) r1 = (int)(math.random() * (n - 1)); r2 = (int)(math.random() * (n - 1)); if(r1 == r2) r2 = (int)(math.random() * (n - 1)); r1 = (int)(math.random() * n); if(r1 == r2) (D) r1 = (int)(math.random() * (n - 1)); while(r1 == r2) r1 = (int)(math.random() * n); while(r1 == r2) 9) Consider the following declarations where... is a valid Board constructor parameter list. I. Board board = new Board(...); II. Board board = new ElevensBoard(); III. ElevensBoard board = new ElevensBoard(); Which of the declarations above is(are) valid? (A) (B) (D) I only I and II only I and III only II and III only I, II, and III 10) Consider the first line of the ElevensBoard class declaration below. public class ElevensBoard extends Board Which of the following methods must be implemented as a result of the way the ElevensBoard class has been declared? I. tostring II. anotherplayispossible III. islegal IV. dealmycards (A) (B) (D) I only I, II, and IV only II and III only I and IV only I, II, III, and IV
4 11) Consider the Deck class on the Code Sheet, related to the Elevens Lab. Comments are omitted, and the tostring implementation is not shown, to save space. Write an "efficient selection shuffle" that efficiently shuffles the deck. Use these general guidelines: Loop through the cards in the deck, starting at the end of the deck and working your way down. Use a structure similar to a selection sort, and reset the size at the end of the method. /** * Randomly permute the given collection of cards using the structure of a selection * sort, starting at the end of the deck. Reset the size to represent the entire deck. */ public void shuffle() 12) Consider a game related to Elevens, called Nines, that uses a 9-card board. Ace, 2,, 8, 9, 10, jack, queen, king correspond to the point values of 1, 2,, 8, 9, 0, 0, 0, 0. Pairs of cards whose point values add up to 9 can be selected and removed. Nines can be removed singly. A group of four cards, 10, jack, queen, king, can be selected and removed. For the game of Nines, write the method findsinglenineorpairsumnine. This method should be passed a List of Integer (selectedcards), representing indexes for the cards to be checked. The method should return true if the board entries in selectedcards contain a single 9 or a 9-pair. The method should return false otherwise. (cont)
5 /** * Look for a 9-pair in the selected cards, or a single 9. selectedcards selects a subset of this board. It is a list * of indexes into this board that are searched * to find a 9-pair or a single 9. true if the board entries in selectedcards * contain a 9-pair or a single 9; false otherwise. */ private boolean findsinglenineorpairsumnine (List<Integer> selectedcards) 13) Consider the Card class on the Code Sheet, related to the Elevens Lab. Complete the following printcards method to print all of the elements of cards (one card per line) that are indexed by the cards on the board (these will need to be obtained first). public static printcards(elevensboard board)
Lesson 90: Elevens Lab #3 (W31D3)
Lesson 90: Elevens Lab #3 (W31D3) Balboa High School Michael Ferraro April 6, 2016 1 / 28 Do Now Prepare HW to be checked: Download this driver for questions 1 & 2 on p9, insert your methods, and run.
More informationAP Computer Science A Elevens Lab Student Guide
AP Computer Science A Elevens Lab Student Guide The AP Program wishes to acknowledge and thank the following individuals for their contributions in developing this lab and the accompanying documentation.
More informationProject 2 - Blackjack Due 7/1/12 by Midnight
Project 2 - Blackjack Due 7//2 by Midnight In this project we will be writing a program to play blackjack (or 2). For those of you who are unfamiliar with the game, Blackjack is a card game where each
More informationName: Checked: Answer: jack queen king ace
Lab 11 Name: Checked: Objectives: More practice using arrays: 1. Arrays of Strings and shuffling an array 2. Arrays as parameters 3. Collections Preparation Submit DeckOfCards.java and TrianglePanel.java
More informationDELIVERABLES. This assignment is worth 50 points and is due on the crashwhite.polytechnic.org server at 23:59:59 on the date given in class.
AP Computer Science Partner Project - VideoPoker ASSIGNMENT OVERVIEW In this assignment you ll be creating a small package of files which will allow a user to play a game of Video Poker. For this assignment
More informationName: Checked: jack queen king ace
Lab 11 Name: Checked: Objectives: More practice using arrays: 1. Arrays of Strings and shuffling an array 2. Arrays as parameters 3. Collections Preparation 1) An array to store a deck of cards: DeckOfCards.java
More informationRandomized Algorithms
Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Randomized Algorithms Randomized Algorithms 1 Applications: Simple Algorithms and
More informationCMPS 12A Introduction to Programming Programming Assignment 5 In this assignment you will write a Java program that finds all solutions to the n-queens problem, for. Begin by reading the Wikipedia article
More informationTo use one-dimensional arrays and implement a collection class.
Lab 8 Handout 10 CSCI 134: Spring, 2015 Concentration Objective To use one-dimensional arrays and implement a collection class. Your lab assignment this week is to implement the memory game Concentration.
More informationAP Computer Science Project 22 - Cards Name: Dr. Paul L. Bailey Monday, November 2, 2017
AP Computer Science Project 22 - Cards Name: Dr. Paul L. Bailey Monday, November 2, 2017 We have developed several cards classes. The source code we developed is attached. Each class should, of course,
More information27. Important Object- Oriented Programming Ideas
27. Important Object- Oriented Programming Ideas Topics: Class Variables Inheritance Method Overriding Will Cover These Topics With a Single Example It will involve operations with playing cards. Closely
More informationCSE1710. Big Picture. Reminder
CSE1710 Click to edit Master Week text 10, styles Lecture 19 Second level Third level Fourth level Fifth level Fall 2013 Thursday, Nov 14, 2013 1 Big Picture For the next three class meetings, we will
More informationCS 152 Computer Programming Fundamentals Lab 8: Klondike Solitaire
CS 152 Computer Programming Fundamentals Lab 8: Klondike Solitaire Brooke Chenoweth Fall 2018 1 Game Rules You are likely familiar with this solitaire card game. An implementation has been included with
More informationActivity 6: Playing Elevens
Activity 6: Playing Elevens Introduction: In this activity, the game Elevens will be explained, and you will play an interactive version of the game. Exploration: The solitaire game of Elevens uses a deck
More informationIn the game of Chess a queen can move any number of spaces in any linear direction: horizontally, vertically, or along a diagonal.
CMPS 12A Introduction to Programming Winter 2013 Programming Assignment 5 In this assignment you will write a java program finds all solutions to the n-queens problem, for 1 n 13. Begin by reading the
More informationCSCI 4150 Introduction to Artificial Intelligence, Fall 2004 Assignment 7 (135 points), out Monday November 22, due Thursday December 9
CSCI 4150 Introduction to Artificial Intelligence, Fall 2004 Assignment 7 (135 points), out Monday November 22, due Thursday December 9 Learning to play blackjack In this assignment, you will implement
More informationMore Recursion: NQueens
More Recursion: NQueens continuation of the recursion topic notes on the NQueens problem an extended example of a recursive solution CISC 121 Summer 2006 Recursion & Backtracking 1 backtracking Recursion
More informationCS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 8
CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 8 40 points Out: April 15/16, 2015 Due: April 27/28, 2015 (Monday/Tuesday, last day of class) Problem Statement Many people like
More informationPLAYERS AGES MINS.
2-4 8+ 20-30 PLAYERS AGES MINS. COMPONENTS: (123 cards in total) 50 Victory Cards--Every combination of 5 colors and 5 shapes, repeated twice (Rainbow Backs) 20 Border Cards (Silver/Grey Backs) 2 48 Hand
More informationProblem Set 4: Video Poker
Problem Set 4: Video Poker Class Card In Video Poker each card has its unique value. No two cards can have the same value. A poker card deck has 52 cards. There are four suits: Club, Diamond, Heart, and
More informationCS 210 Fundamentals of Programming I Fall 2015 Programming Project 8
CS 210 Fundamentals of Programming I Fall 2015 Programming Project 8 40 points Out: November 17, 2015 Due: December 3, 2015 (Thursday after Thanksgiving break) Problem Statement Many people like to visit
More informationLab Exercise #10. Assignment Overview
Lab Exercise #10 Assignment Overview You will work with a partner on this exercise during your lab session. Two people should work at one computer. Occasionally switch the person who is typing. Talk to
More informationHomework Assignment #2
CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2 Assigned: Thursday, February 15 Due: Sunday, February 25 Hand-in Instructions This homework assignment includes two written problems
More informationCS Programming Project 1
CS 340 - Programming Project 1 Card Game: Kings in the Corner Due: 11:59 pm on Thursday 1/31/2013 For this assignment, you are to implement the card game of Kings Corner. We will use the website as http://www.pagat.com/domino/kingscorners.html
More informationChapter 5: Probability: What are the Chances? Section 5.2 Probability Rules
+ Chapter 5: Probability: What are the Chances? Section 5.2 + Two-Way Tables and Probability When finding probabilities involving two events, a two-way table can display the sample space in a way that
More informationLEARN HOW TO PLAY MINI-BRIDGE
MINI BRIDGE - WINTER 2016 - WEEK 1 LAST REVISED ON JANUARY 29, 2016 COPYRIGHT 2016 BY DAVID L. MARCH INTRODUCTION THE PLAYERS MiniBridge is a game for four players divided into two partnerships. The partners
More informationMath 1111 Math Exam Study Guide
Math 1111 Math Exam Study Guide The math exam will cover the mathematical concepts and techniques we ve explored this semester. The exam will not involve any codebreaking, although some questions on the
More informationDeveloped by Rashmi Kathuria. She can be reached at
Developed by Rashmi Kathuria. She can be reached at . Photocopiable Activity 1: Step by step Topic Nature of task Content coverage Learning objectives Task Duration Arithmetic
More informationBrief Introduction to Vision and Images
Brief Introduction to Vision and Images Charles S. Tritt, Ph.D. January 24, 2012 Version 1.1 Structure of the Retina There is only one kind of rod. Rods are very sensitive and used mainly in dim light.
More informationFreeCell Puzzle Protocol Document
AI Puzzle Framework FreeCell Puzzle Protocol Document Brian Shaver April 11, 2005 FreeCell Puzzle Protocol Document Page 2 of 7 Table of Contents Table of Contents...2 Introduction...3 Puzzle Description...
More informationA. Rules of blackjack, representations, and playing blackjack
CSCI 4150 Introduction to Artificial Intelligence, Fall 2005 Assignment 7 (140 points), out Monday November 21, due Thursday December 8 Learning to play blackjack In this assignment, you will implement
More informationA Rule-Based Learning Poker Player
CSCI 4150 Introduction to Artificial Intelligence, Fall 2000 Assignment 6 (135 points), out Tuesday October 31; see document for due dates A Rule-Based Learning Poker Player For this assignment, teams
More information4/9/2015. Simple Graphics and Image Processing. Simple Graphics. Overview of Turtle Graphics (continued) Overview of Turtle Graphics
Simple Graphics and Image Processing The Plan For Today Website Updates Intro to Python Quiz Corrections Missing Assignments Graphics and Images Simple Graphics Turtle Graphics Image Processing Assignment
More informationFree Cell Solver. Copyright 2001 Kevin Atkinson Shari Holstege December 11, 2001
Free Cell Solver Copyright 2001 Kevin Atkinson Shari Holstege December 11, 2001 Abstract We created an agent that plays the Free Cell version of Solitaire by searching through the space of possible sequences
More informationPROBLEM SET 2 Due: Friday, September 28. Reading: CLRS Chapter 5 & Appendix C; CLR Sections 6.1, 6.2, 6.3, & 6.6;
CS231 Algorithms Handout #8 Prof Lyn Turbak September 21, 2001 Wellesley College PROBLEM SET 2 Due: Friday, September 28 Reading: CLRS Chapter 5 & Appendix C; CLR Sections 6.1, 6.2, 6.3, & 6.6; Suggested
More informationRobot Gladiators: A Java Exercise with Artificial Intelligence
Robot Gladiators: A Java Exercise with Artificial Intelligence David S. Yuen & Lowell A. Carmony Department of Mathematics & Computer Science Lake Forest College 555 N. Sheridan Road Lake Forest, IL 60045
More informationHOMEWORK ASSIGNMENT 5
HOMEWORK ASSIGNMENT 5 MATH 251, WILLIAMS COLLEGE, FALL 2006 Abstract. These are the instructor s solutions. 1. Big Brother The social security number of a person is a sequence of nine digits that are not
More information18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY
18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY 1. Three closed boxes lie on a table. One box (you don t know which) contains a $1000 bill. The others are empty. After paying an entry fee, you play the following
More informationProject One Report. Sonesh Patel Data Structures
Project One Report Sonesh Patel 09.06.2018 Data Structures ASSIGNMENT OVERVIEW In programming assignment one, we were required to manipulate images to create a variety of different effects. The focus of
More informationCS256 Applied Theory of Computation
CS256 Applied Theory of Computation Parallel Computation III John E Savage Overview Mapping normal algorithms to meshes Shuffle operations on linear arrays Shuffle operations on two-dimensional arrays
More informationCOMP 9 Lab 3: Blackjack revisited
COMP 9 Lab 3: Blackjack revisited Out: Thursday, February 10th, 1:15 PM Due: Thursday, February 17th, 12:00 PM 1 Overview In the previous assignment, you wrote a Blackjack game that had some significant
More informationThe Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? Objectives. Background (Pre-Lab Reading)
The Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? [Note: This lab isn t as complete as the others we have done in this class. There are no self-assessment questions and no post-lab
More informationPOKER (AN INTRODUCTION TO COUNTING)
POKER (AN INTRODUCTION TO COUNTING) LAMC INTERMEDIATE GROUP - 10/27/13 If you want to be a succesful poker player the first thing you need to do is learn combinatorics! Today we are going to count poker
More informationCSE231 Spring Updated 04/09/2019 Project 10: Basra - A Fishing Card Game
CSE231 Spring 2019 Updated 04/09/2019 Project 10: Basra - A Fishing Card Game This assignment is worth 55 points (5.5% of the course grade) and must be completed and turned in before 11:59pm on April 15,
More informationEight Queens Puzzle Solution Using MATLAB EE2013 Project
Eight Queens Puzzle Solution Using MATLAB EE2013 Project Matric No: U066584J January 20, 2010 1 Introduction Figure 1: One of the Solution for Eight Queens Puzzle The eight queens puzzle is the problem
More informationMARK SCHEME for the October/November 2014 series 9691 COMPUTING. 9691/22 Paper 2 (Written Paper), maximum raw mark 75
CAMBRIDGE INTERNATIONAL EXAMINATIONS Cambridge International Advanced Subsidiary and Advanced Level MARK SCHEME for the October/November 2014 series 9691 COMPUTING 9691/22 Paper 2 (Written Paper), maximum
More informationProbability. Ms. Weinstein Probability & Statistics
Probability Ms. Weinstein Probability & Statistics Definitions Sample Space The sample space, S, of a random phenomenon is the set of all possible outcomes. Event An event is a set of outcomes of a random
More informationCards: Virtual Playing Cards Library
Cards: Virtual Playing Cards Library Version 4.1 August 12, 2008 (require games/cards) The games/cards module provides a toolbox for creating cards games. 1 1 Creating Tables and Cards (make-table [title
More informationINTRODUCTION TO COMPUTER SCIENCE I PROJECT 6 Sudoku! Revision 2 [2010-May-04] 1
INTRODUCTION TO COMPUTER SCIENCE I PROJECT 6 Sudoku! Revision 2 [2010-May-04] 1 1 The game of Sudoku Sudoku is a game that is currently quite popular and giving crossword puzzles a run for their money
More informationBALTIMORE COUNTY PUBLIC SCHOOLS. Rock n Roll
Number cube labeled 1-6 (A template to make a cube is at the back of this packet.)36 counters Rock n Roll Paper Pencil None The first player rolls the number cube to find out how many groups of counters
More informationConditional Probability Worksheet
Conditional Probability Worksheet P( A and B) P(A B) = P( B) Exercises 3-6, compute the conditional probabilities P( AB) and P( B A ) 3. P A = 0.7, P B = 0.4, P A B = 0.25 4. P A = 0.45, P B = 0.8, P A
More information2 Event is equally likely to occur or not occur. When all outcomes are equally likely, the theoretical probability that an event A will occur is:
10.3 TEKS a.1, a.4 Define and Use Probability Before You determined the number of ways an event could occur. Now You will find the likelihood that an event will occur. Why? So you can find real-life geometric
More informationGrades 7 & 8, Math Circles 27/28 February, 1 March, Mathematical Magic
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Card Tricks Grades 7 & 8, Math Circles 27/28 February, 1 March, 2018 Mathematical Magic Have you ever
More informationA magician showed a magic trick where he picked one card from a standard deck. Determine What is the probability that the card will be a queen card?
Topic : Probability Word Problems- Worksheet 1 What is the probability? 1. 2. 3. 4. Jill is playing cards with her friend when she draws a card from a pack of 20 cards numbered from 1 to 20. What is the
More informationSHORT ANSWER. Write the word or phrase that best completes each statement or answers the question.
MATH 1324 Review for Test 3 SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question. Find the value(s) of the function on the given feasible region. 1) Find the
More informationPart I At the top level, you will work with partial solutions (referred to as states) and state sets (referred to as State-Sets), where a partial solu
Project: Part-2 Revised Edition Due 9:30am (sections 10, 11) 11:001m (sections 12, 13) Monday, May 16, 2005 150 points Part-2 of the project consists of both a high-level heuristic game-playing program
More informationChapter 2 Integers. Math 20 Activity Packet Page 1
Chapter 2 Integers Contents Chapter 2 Integers... 1 Introduction to Integers... 3 Adding Integers with Context... 5 Adding Integers Practice Game... 7 Subtracting Integers with Context... 9 Mixed Addition
More informationATHS FC Math Department Al Ain Remedial worksheet. Lesson 10.4 (Ellipses)
ATHS FC Math Department Al Ain Remedial worksheet Section Name ID Date Lesson Marks Lesson 10.4 (Ellipses) 10.4, 10.5, 0.4, 0.5 and 0.6 Intervention Plan Page 1 of 19 Gr 12 core c 2 = a 2 b 2 Question
More informationSuch a description is the basis for a probability model. Here is the basic vocabulary we use.
5.2.1 Probability Models When we toss a coin, we can t know the outcome in advance. What do we know? We are willing to say that the outcome will be either heads or tails. We believe that each of these
More informationDependence. Math Circle. October 15, 2016
Dependence Math Circle October 15, 2016 1 Warm up games 1. Flip a coin and take it if the side of coin facing the table is a head. Otherwise, you will need to pay one. Will you play the game? Why? 2. If
More informationBegin this assignment by first creating a new Java Project called Assignment 5.There is only one part to this assignment.
CSCI 2311, Spring 2013 Programming Assignment 5 The program is due Sunday, March 3 by midnight. Overview of Assignment Begin this assignment by first creating a new Java Project called Assignment 5.There
More informationProgrammingAssignment #7: Let s Play Blackjack!
ProgrammingAssignment #7: Let s Play Blackjack! Due Date: November 23, 1999 1 The Problem In this program, you will use four classes to write a (very simpli ed) Blackjack game. Blackjack is a popular card
More informationBMT 2018 Combinatorics Test Solutions March 18, 2018
. Bob has 3 different fountain pens and different ink colors. How many ways can he fill his fountain pens with ink if he can only put one ink in each pen? Answer: 0 Solution: He has options to fill his
More informationProbability Test Review Math 2. a. What is? b. What is? c. ( ) d. ( )
Probability Test Review Math 2 Name 1. Use the following venn diagram to answer the question: Event A: Odd Numbers Event B: Numbers greater than 10 a. What is? b. What is? c. ( ) d. ( ) 2. In Jason's homeroom
More informationPrinceton ELE 201, Spring 2014 Laboratory No. 2 Shazam
Princeton ELE 201, Spring 2014 Laboratory No. 2 Shazam 1 Background In this lab we will begin to code a Shazam-like program to identify a short clip of music using a database of songs. The basic procedure
More informationConditional Probability Worksheet
Conditional Probability Worksheet EXAMPLE 4. Drug Testing and Conditional Probability Suppose that a company claims it has a test that is 95% effective in determining whether an athlete is using a steroid.
More informationDue Friday, February 27 at 3:15PM
CS106A Handout 20 Winter 2015 February 18, 2015 Assignment 6: Array Algorithms Arrays are a fundamental and versatile tool for representing data of all shapes and sizes In this assignment, you'll see how
More informationActivity 1: Play comparison games involving fractions, decimals and/or integers.
Students will be able to: Lesson Fractions, Decimals, Percents and Integers. Play comparison games involving fractions, decimals and/or integers,. Complete percent increase and decrease problems, and.
More information6. In how many different ways can you answer 10 multiple-choice questions if each question has five choices?
Pre-Calculus Section 4.1 Multiplication, Addition, and Complement 1. Evaluate each of the following: a. 5! b. 6! c. 7! d. 0! 2. Evaluate each of the following: a. 10! b. 20! 9! 18! 3. In how many different
More informationArduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett
Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett Anatomy of a Program Programs written for a microcontroller have a fairly repeatable format. Slight variations exist
More informationIntroduction. Due Friday, February 28 at 3:15PM
CS106A Handout 24 Winter 2013-2014 February 19, 2014 Assignment 5: Array Algorithms Introduction Arrays are a fundamental and versatile tool for representing, manipulating, and transforming data. In this
More informationCS Project 1 Fall 2017
Card Game: Poker - 5 Card Draw Due: 11:59 pm on Wednesday 9/13/2017 For this assignment, you are to implement the card game of Five Card Draw in Poker. The wikipedia page Five Card Draw explains the order
More informationCSE1710. Big Picture. Reminder
CSE1710 Click to edit Master Week text 09, styles Lecture 17 Second level Third level Fourth level Fifth level Fall 2013! Thursday, Nov 6, 2014 1 Big Picture For the next three class meetings, we will
More informationUNIT 9B Randomness in Computa5on: Games with Random Numbers Principles of Compu5ng, Carnegie Mellon University - CORTINA
UNIT 9B Randomness in Computa5on: Games with Random Numbers 1 Rolling a die from random import randint def roll(): return randint(0,15110) % 6 + 1 OR def roll(): return randint(1,6) 2 1 Another die def
More informationMarch 5, What is the area (in square units) of the region in the first quadrant defined by 18 x + y 20?
March 5, 007 1. We randomly select 4 prime numbers without replacement from the first 10 prime numbers. What is the probability that the sum of the four selected numbers is odd? (A) 0.1 (B) 0.30 (C) 0.36
More informationThis assignment is worth 75 points and is due on the crashwhite.polytechnic.org server at 23:59:59 on the date given in class.
Computer Science Programming Project Game of Life ASSIGNMENT OVERVIEW In this assignment you ll be creating a program called game_of_life.py, which will allow the user to run a text-based or graphics-based
More informationArduino Lesson 1. Blink. Created by Simon Monk
Arduino Lesson 1. Blink Created by Simon Monk Guide Contents Guide Contents Overview Parts Part Qty The 'L' LED Loading the 'Blink' Example Saving a Copy of 'Blink' Uploading Blink to the Board How 'Blink'
More informationCS 241 Data Organization using C. Project: Identifying the Rank of a Poker Hand and an Empirical Calculation of Probabilities
CS 241 Data Organization using C Project: Identifying the Rank of a Poker Hand and an Empirical Calculation of Probabilities Instructor: Joel Castellanos e-mail: joel@unm.edu Web: http://cs.unm.edu/~joel/
More informationFundamental Counting Principle
Lesson 88 Probability with Combinatorics HL2 Math - Santowski Fundamental Counting Principle Fundamental Counting Principle can be used determine the number of possible outcomes when there are two or more
More informationHonors Precalculus Chapter 9 Summary Basic Combinatorics
Honors Precalculus Chapter 9 Summary Basic Combinatorics A. Factorial: n! means 0! = Why? B. Counting principle: 1. How many different ways can a license plate be formed a) if 7 letters are used and each
More informationLecture 14: Modular Programming
Review Lecture 14: Modular Programming Data type: set of values and operations on those values. A Java class allows us to define data types by:! Specifying a set of variables.! Defining a set of methods.
More informationECE 242 Data Structures and Algorithms. Simple Sorting II. Lecture 5. Prof.
ECE 242 Data Structures and Algorithms http://www.ecs.umass.edu/~polizzi/teaching/ece242/ Simple Sorting II Lecture 5 Prof. Eric Polizzi Summary previous lecture 1 Bubble Sort 2 Selection Sort 3 Insertion
More informationCOS 226 Algorithms and Data Structures Fall Midterm Exam
COS 226 lgorithms and Data Structures Fall 2015 Midterm Exam You have 80 minutes for this exam. The exam is closed book, except that you are allowed to use one page of notes (8.5-by-11, one side, in your
More informationProcessing Image Pixels, Performing Convolution on Images. Preface
Processing Image Pixels, Performing Convolution on Images Learn to write Java programs that use convolution (flat filters and Gaussian filters) to smooth or blur an image. Also learn how to write jpg files
More informationYou Can Make a Difference! Due November 11/12 (Implementation plans due in class on 11/9)
You Can Make a Difference! Due November 11/12 (Implementation plans due in class on 11/9) In last week s lab, we introduced some of the basic mechanisms used to manipulate images in Java programs. In this
More informationCS 51 Homework Laboratory # 7
CS 51 Homework Laboratory # 7 Recursion Practice Due: by 11 p.m. on Monday evening, but hopefully will be turned in by the end of the lab period. Objective: To gain experience using recursion. Recursive
More informationProblem 4.R1: Best Range
CSC 45 Problem Set 4 Due Tuesday, February 7 Problem 4.R1: Best Range Required Problem Points: 50 points Background Consider a list of integers (positive and negative), and you are asked to find the part
More informationNovember 6, Chapter 8: Probability: The Mathematics of Chance
Chapter 8: Probability: The Mathematics of Chance November 6, 2013 Last Time Crystallographic notation Groups Crystallographic notation The first symbol is always a p, which indicates that the pattern
More informationACM ICPC World Finals Warmup 2 At UVa Online Judge. 7 th May 2011 You get 14 Pages 10 Problems & 300 Minutes
ACM ICPC World Finals Warmup At UVa Online Judge 7 th May 011 You get 14 Pages 10 Problems & 300 Minutes A Unlock : Standard You are about to finish your favorite game (put the name of your favorite game
More informationITEC 120 3/18/11. Review. Objectives. Blending. Basic effects. Lecture 24 Advanced Effects. Learn about more complex effects. Combining pictures
3/18/11 Review ITEC 120 Lecture 24 Advanced Effects Basic effects Loading / Displaying Solid color pictures Black/White Sepia Objectives Blending Learn about more complex effects Blending Green screening
More informationCS 100 Introduction to Computer Science Final Sample Questions, Fall 2015
Introduction to Computer Science Final Sample Questions, Fall 2015 1. For each of the following pieces of code, indicate what color p would have at the end of the code if it is black when the code starts.
More informationCounting in Algorithms
Counting Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers? How many steps to factor an integer? Counting in Games How many different
More informationProbability Theory. Mohamed I. Riffi. Islamic University of Gaza
Probability Theory Mohamed I. Riffi Islamic University of Gaza Table of contents 1. Chapter 1 Probability Properties of probability Counting techniques 1 Chapter 1 Probability Probability Theorem P(φ)
More informationRobonet - MANET for Robot Communication
Robonet - MANET for Robot Communication Authors: Stiven Andre Supervisor: Aram Movsisian Motivation Robotic developers need a way for robots to communicate. Swarm of robots want to communicate in a constantly
More informationImages and Graphics. 4. Images and Graphics - Copyright Denis Hamelin - Ryerson University
Images and Graphics Images and Graphics Graphics and images are non-textual information that can be displayed and printed. Graphics (vector graphics) are an assemblage of lines, curves or circles with
More informationGraphing Guidelines. Controlled variables refers to all the things that remain the same during the entire experiment.
Graphing Graphing Guidelines Graphs must be neatly drawn using a straight edge and pencil. Use the x-axis for the manipulated variable and the y-axis for the responding variable. Manipulated Variable AKA
More information1. Definitions 2. Mode of Play 3. How to Play 4. Settlement 5. Irregularities
7 UP BACCARAT (MBS) Games Rules w.e.f. 2 February 2011 1. Definitions 2. Mode of Play 3. How to Play 4. Settlement 5. Irregularities - 1 - 1. Definitions 1.1. In these rules: 1.1.1. "Hand" means the cards
More informationAdvanced Intermediate Algebra Chapter 12 Summary INTRO TO PROBABILITY
Advanced Intermediate Algebra Chapter 12 Summary INTRO TO PROBABILITY 1. Jack and Jill do not like washing dishes. They decide to use a random method to select whose turn it is. They put some red and blue
More informationTest 2 Review Solutions
Test Review Solutions. A family has three children. Using b to stand for and g to stand for, and using ordered triples such as bbg, find the following. a. draw a tree diagram to determine the sample space
More informationBasics of Probability
Basics of Probability Dublin R May 30, 2013 1 Overview Overview Basics of Probability (some definitions, the prob package) Dice Rolls and the Birthday Distribution ( histograms ) Gambler s Ruin ( plotting
More information