2.Greetings. I need help asap when it comes to a computer science project that I have to get done soon.
...
. I'm really close to completing it and I'm really stuck on this one situation and I don't know how to solve it. So right now I'm making a guessing game and every time you play the program tells the user how many guesses it took for them to get the answer. And what I need to do is to make sure that I get and isolate the lowest amount of guess and put it into the statistics function so that way it can print out the lowest amount of guesses that I got. Right now it isn't working and I really don't know why as it seems to be mostly adding up all the guesses until the last few. Here's my code:
#include
#include
#include
#include
void haiku(){
printf("Welcome to the game.\n");
printf("Guess a number within range.\n");
printf("Win cool prizes here.\n\n");
}
int compare(int guessiso){
int lowestvalue=0;
int biggervalue=0;
if(guessisooperand){
printf("It's lower.\n");
count++;
isolatedcount++;
}
else if(user0){
lowguess=compare(x);
x=one_game(count);
count=x;
printf("Do you want to play again?\n");
scanf("%d",&usertwo);
userthree=usertwo;
gamecount++;
}
statistics(gamecount,x,lowguess);
}
View More
3.11. In a game, you draw thirteen cards with replacement from a deck of playing cards. If you draw any
...
y aces or twos, you lose the game immediately. You also lose if you draw picture cards(J,Q,K) more than twice. In this question, you’ll study the probability of winning this game.(a) What is the probability of drawing no aces or twos after thirteen draws?(b) Given you have drawn thirteen times, none of which is aces or twos, what is the probability that you draw at most two picture cards?(c) What is the probability to win this game?
12. Suppose you are tossing an unbiased coin for100times.(a) What is the probability of getting50heads and50tails?(b) LetXbe the random variable counting the number of heads you observe in this exper-iment. What is the expected value ofX? What is the variance ofX? What is thestandard deviation ofX?
13. The following are probability distributions for two random variablesX,Y.
kPr(X=k)
0,0.4
1,0.3
2,0.3
kPr(Y=k)
0,0.5
1,0.3
2,0.2
(a) Construct the probability distribution table for the random variableXY.(b) Find E[X],E[Y] and E[XY]. Is is true that E[XY] =E[X]E[Y]?(c) Find the variances σ2X,σ2Y,σ2XY of X,Y and XY. Is it true that σ2XY=σ2Xσ2Y?
14. The aliens who are fond of gambling came back to play another game with you. In this game, you first toss a coin5times. If you observe3or fewer tails, you roll a die3times. If youobserve4or more tails, you roll a die20times. What is the probability that you end up with at most two6’s in your dice rolls?
15. (Challenge question, worth2points) You have two bags, each of which contains10marbles.Each time you remove a marble from a random bag. What is the probability that after one of the bags is emptied, there are still exactly3marbles in the other bag?
View More
4.Exercise 4) A fair coin is tossed. If it lands heads, a fair four-sided die
is thrown (with values 2,3,4,7). If
...
2,3,4,7). If it lands tails, a fair six-sided die is
thrown (with values 3,4,5,6,7,9). Regardless of which die is used, Alice
eats n grains of rice, where n is the largest prime factor of the die result
(for example, the largest prime factor of 9 is 3).
(a) What is the conditional probability that the coin lands heads, given
that Alice eats three grains of rice?
(b) Suppose that the entire experiment is conducted twice on the following day (starting with a new coin toss on the second run-through).
What is the conditional probability that the coin lands heads on both
run-throughs, given that Alice eats a total of five grains of rice during the two run-throughs?
(Do not count the two grains from part (a) in part (b); we assume
two brand new experiments, each with a new coin toss. Start your
solution by defining a suitable partition of the sample space. Please
use an appropriate notation and/or justification in words, for each
value that you give as part of your solution.)
Exercise 5) Alice and Bob throw an unfair coin repeatedly, with probability 2/5 of landing heads. Alice starts with £2 and Bob starts with £3 .
Each time the unfair coin lands heads, Alice gives Bob £1 . Each time
the unfair coin lands tails, Bob gives Alice £1 . The game ends when one
player has £5 .
(a) Draw a labelled Markov chain describing the problem, and write
down a transition matrix P. Write down the communication classes,
and classify them as either recurrent or transient.
(b) Using the transition matrix, calculate the probability that Alice loses
all of her money in exactly four tosses of the unfair coin.
(c) Calculate the (total) probability that Alice loses all of her money
(before Bob loses all of his).
(d) Calculate the expected (mean) number of tosses of the unfair coin,
for the game to end.
View More
5.We play a variation of Monty Hall: The contestant is presented with 3 curtains, behind each there's a prize with
...
a prize with probability p independently of the other curtains. The player chooses one curtain
(a) The game host tells the contestant there's a prize hiding behind at least one of the other curtains, and offers the player a chance to change his choice. Should he?
(b) The game host tells the player there's a prize hiding behind exactly one of the other curtains. Should the player change his choice? How does your answer depend on p
(c) How would your answer to section (b) change if there are n curtains in total?
(d) Bonus (4 points): How would your answer to section (a) change if there are 4 curtains in total?
View More
6.Question 1: What is a player’s « reaction function » in a Bertrand game ?
Question 2: What is a subgame
...
subgame perfect Nash equilibrium?
Question 3: In which situations should we need the mixed extension of a game?
Question 4: Find, if any, all Nash equilibria of the following famous matrix game:
L R
U (2,0) (3,3)
D (3,4) (1,2)
Question 5: What is the difference between a separating equilibrium and a pooling equilibrium
in Bayesian games?
Question 6: Give another name for, if it exists, the intersection of the players’ best-response
« functions » in a game?
Question 7: assuming we only deal with pure strategies, the Prisoner’s Dilemma is a situation
with:
No Nash equilibrium One sub-optimal Nash equilibrium
One sub-optimal dominant profile No dominant profile
Question 8: If it exists, a pure Nash equilibrium is always a profile of dominant strategies:
True False
Question 9: All games have at least one pure strategy Nash equilibrium:
True False
Question 10: If a tree game has a backward induction equilibrium then it must also be a Nash
equilibrium of all of its subgames:
Tr
2/2
Question 11: The mixed Nash equilibrium payoffs are always strictly smaller than the pure
Nash equilibrium payoffs:
True False
Question 12: Which of the following statements about dominant/dominated strategies is/are
true?
I. A dominant strategy dominates a dominated strategy in 2x2 games.
II. A dominated strategy must be dominated by a dominant strategy in all games.
III. A profile of dominant strategies must be a pure strategy Nash equilibrium.
IV. A dominated strategy must be dominated by a dominant strategy in 2x2 games.
I, II and IV only I, II and III only II and III only
I and IV only I, III and IV only I and II only
Question 13: A pure strategy Nash equilibrium is a special case of a mixed strategy Nash
equilibrium:
True False
Question 14: Consider the following 2x2 matrix game:
L R
U (3,2) (2,4)
D (-1,4) (4,3)
The number of pure and mixed Nash equilibria in the above game is:
0 1
2 3
Exercise (corresponding to questions 15 to 20 below): assume a medical doctor (M)
prescribes either drug A or drug B to a patient (P), who complies (C) or not (NC) with each of
this treatment. In case of compliance, controlled by an authority in charge of health services
quality, the physician is rewarded at a level of 1 for drug A and 2 for drug B. In case of noncompliance, the physician is « punished » at -1 level for non-compliance of the patient with
drug A and at -2 level for non-compliance with drug B. As for the compliant patient, drug A
should give him back 2 years of life saved and drug B, only 1 year of life saved. When noncompliant with drug A, the same patient wins 3 years of life (due to avoiding unexpected
allergic shock for instance), and when non-compliant with drug B, the patient loses 3 years of
life.
Question 15: You will draw the corresponding matrix of the simultaneous doctor-patient game.
Question 16: Find, if any, the profile(s) of dominant strategies of this game.
Question 17: Find, if any, the pure strategy Nash equilibrium/equilibria of this game.
Question 18: Find, if any, the mixed strategy Nash equilibrium/equilibria of this game.
Questions 19 and 20: Now the doctor prescribes first, then the patient complies or not: draw
the corresponding extensive-form game (= question 19) AND find the subgame perfect Nash
equilibrium/equilibria (=
View More
7.0 1
2 3
Exercise (corresponding to questions 15 to 20 below): assume a medical doctor (M)
prescribes either drug A or
...
ibes either drug A or drug B to a patient (P), who complies (C) or not (NC) with each of
this treatment. In case of compliance, controlled by an authority in charge of health services
quality, the physician is rewarded at a level of 1 for drug A and 2 for drug B. In case of noncompliance, the physician is « punished » at -1 level for non-compliance of the patient with
drug A and at -2 level for non-compliance with drug B. As for the compliant patient, drug A
should give him back 2 years of life saved and drug B, only 1 year of life saved. When noncompliant with drug A, the same patient wins 3 years of life (due to avoiding unexpected
allergic shock for instance), and when non-compliant with drug B, the patient loses 3 years of
life.
Question 15: You will draw the corresponding matrix of the simultaneous doctor-patient game.
Question 16: Find, if any, the profile(s) of dominant strategies of this game.
Question 17: Find, if any, the pure strategy Nash equilibrium/equilibria of this game.
Question 18: Find, if any, the mixed strategy Nash equilibrium/equilibria of this game.
Questions 19 and 20: Now the doctor prescribes first, then the patient complies or not: draw
the corresponding extensive-form game (= question 19) AND find the subgame perfect Nash
equilibrium/equilibria (=
View More
9.One state lottery game has contestants select 5 different numbers from 1 to 45. The prize if all numbers are
...
bers are matched is 2 million dollars. The tickets are $2 each.
1) How many different ticket possibilities are there?
2) If a person purchases one ticket, what is the probability of winning? What is the probability of losing?
3) Occasionally, you will hear of a group of people going in together to purchase a large amount of tickets. Suppose a group of 30 purchases 6,000 tickets.
a) How much would each person have to contribute?
b) What is the probability of the group winning? Losing?
4) How much would it cost to “buy the lottery”, that is, buy a ticket to cover every possibility? Is it worth it?
View More
10.In this assignment, you will analyze a problematic relationship you have had or one you have observed. (If you don't
...
d. (If you don't wish to share a real relationship, you may use one from a book, movie, or television program.) Try to create a pragmatic description of the communication interaction that took place. That is, describe it as if it were a game; perhaps a game that only one of you seems to know the rules.
Please specifically include the following:
1. Name the game
2. Provide a brief description of the problematic relationship.
3. List the ground rules for the game.
4. Identify the "plays" in the game - that is the repeated patterns of "moves" that the individuals act out.
5. Respond to two reflection questions: What insights does seeing this as a game give you? Now that you have identified the game, what suggestions can you make for improving the relationship?
View More
11.One of the major criticisms of Game of Thrones is that the novel and series contain a great deal of
...
sexuality and violence. Why do you think the author chose to include those scenes, and to make them as graphic as he did? Do you think those scenes help the story or do they detract from the real focus of the novel/series? The author contends that rape is not front and center in the novel, and that the marital rape of Daenerys cannot be considered a rape, because in medieval society there was no such concept. Do you agree with the author that because it was not considered rape in a medieval society that we should not consider it rape when reading the novel or watching the series today? Use examples from the series to support your conclusions.
View More
13. When to balance dice are rolled, there are 36 possible outcomes. Find the probability that the sum is
...
is a multiple of three or greater than eight.
A certain game consist of rolling a single fair die and pays off as follows nine dollars for a six, six dollars for a five, one dollar for four and no payoffs otherwise.Find the expected winnings for this game.
A fair die is rolled four times. A 6 is considered success While all other outcomes are failures find the probability of three successes.
A pet store has nine puppies including 4 poodles 3 terriers and 2 retrievers. If Rebecca an errand in that order each select one puppy at random without replacement find the probability that Aaron select a retriever given that from last Rebecca selects a poodle.
Experience shows that a ski lodge will be for (166 guests) if there is a heavy snowfall in December, well only partially full (52 guests) With a light snowfall. What is the expected number of guests if the probability for a heavy snowfall is 0.40? I assume that heavy snowfall and light snowfall are the only two possibilities.
A pet store has six puppies Including two poodles two Terriers and to retrievers. If Rebecca and Aaron in that order each select one puppy random with replacement (They both may select the same one) Find the probability That Rebecca selects a terrier and Aaron selects a retriever.
Three married couples arrange themselves randomly in six consecutive seats in a row. Determine (A) the number of ways the following event can occur, And (B) the probability of the event. (The denominator of the probability fraction will be 6!=720, The total number of ways to arrange six items ). Each man was that immediately to the right of his wife.
A coin is tossed five times. Find the probability that all our heads. Find the probability that at least three are heads.
A certain prescription drug is known to produce undesirable facts and 35% of all patients due to drug. Among a random sample of a patient using a drug find the probability of the stated event. Exactly 5 have undesired effects.
10,000 raffle tickets are sold. One first prize of 1600, for second prizes of 800 each, And 9/3 prizes of 300 each or to be awarded with all winners selected randomly. If you purchase one ticket what are your expected winnings.
Suppose a charitable organization decides to Raise money by raffling A trip worth 500. If 3000 tickets are sold at one dollar each find the expected net winnings for a person who buys one ticket. Round to the nearest cent
Three men and seven women are waiting to be interviewed for jobs. If they are selected in random order find the probability that all men will be interviewed first
A fair diet is rolled. What is the probability of rolling on our number or a number less than three.
The pet store has 15 puppies, including five poodles, five Terriers, and five retrievers. If Rebecca and Aaron, in that order, select one puppy at random without replacement, find the probability that both select a poodle
Beth is taking a nine question multiple-choice test for which each question Has three answer choices, only one of which is correct. Beth decides on answering By rolling a fair die And making the first answer choice if the die shows one or two, The second If the die shows three or four, and the third if the die shows five or six. Find the probability of the stated event. Exactly 6 correct answers
For the experiment of drawing a single card from a standard 52 card deck find (a) the probability and (b) the odds are in favor that they do not drive six
View More