1. The coupon collector problem is a well known one. Suppose that you have a shuffled deck of cards and you turn them face up, one by one. How many cards do you need to turn up before you have seen one of each suit? How many cards do you need to turn up before seeing one of each value? In general suppose that a trading card company issues trading cards with N different possible cards: how many do you have to collect before you have all N possibilities, assuming that each possibility is equally likely for each card that you collect?
Write a java program that will generate random values in (0..N] until finding each possible value. Print the number of values the program generated until the each one was found.
2. The International Standard Book Number (ISBN) is a 10-digit code that uniquely identifies a book. The rightmost digit is a checksum digit that can be uniquely determined from the other 9 digits, from the condition that d1 + 2d2 + 3d3 + … + 10d10 must be a multiple of 11 (here di denotes the ith digit from the right). The checksum digit di can be any value from 0 to 10. The ISBN convention is to use the character 'X' to denote 10.
Example: the checksum digit corresponding to 020131452 is 5 since 5 is the only value of x between 0 and 10 for which
10.0 + 9.2 + 8.0 + 7.1 + 6.3 + 5.1 + 4.4 + 3.5 + 2.2 + 1.x
is a multiple of 11. Write your java program that will input a 9-digit integer, compute the checksum, and print out the ISBN number.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
We are here to help you