Write and run SQL statements to complete the following tasks
In: Computer Science
In java Write a static method named consecutiveDigits that accepts an integer n as a parameter and that returns the highest number of consecutive digits in a row from n that have the same value. For example, the number 3777785 has four consecutive occurrences of the number 7 in a row, so the call consecutiveDigits(3777785) should return 4.
For many numbers the answer will be 1 because they don't have any adjacent digits that match. Below are sample calls on the method. You are not allowed to use a String to solve this problem. You may assume that the value passed to the method is greater than or equal to 0.
consecutiveDigits(99) will return 2
consecutiveDigits(1) will return 1
consecutiveDigits(11335577) will return 2
consecutiveDigits(12345) will return 1
consecutiveDigits(89995) will return 3
In: Computer Science
In: Computer Science
In: Biology
Select ALL possible answers: Explain where aqueous humor is produced and the function of this fluid in the eye.
| It is produced by blood vessels within the aqueous humor and it travels around the lens and iris to the space behind the lens. |
| The fluid does not supply nutrients and limited oxygen to the lens and cornea or remove their waste products, as these structures do have their own blood vessels. |
| It is produced by blood vessels within the aqueous humor and it travels around the lens and iris to the space behind the cornea. |
| The fluid supplies nutrients and limited oxygen to the lens and cornea and removes their waste products, as these structures lack their own blood vessels. |
| It is produced by the optic nerve within the ciliary body and it travels around the lens and iris to the space behind the lens. |
| The fluid supplies nutrients but no oxygen to the only lens. |
| It is produced by blood vessels within the ciliary body and it travels around the lens and iris to the space behind the cornea. |
| None of the above |
| The fluid supplies nutrients and limited oxygen to the cornea and removes waste products, however, these structures also have their own blood vessels. |
In: Biology
A game show has a host and three contestants. Suppose the three contestants are Meg, Tyler and Ashley. The host and each contestant each have a bag with 3 marbles; one red, one white and one blue. The host will choose a marble from her bag, then Meg will choose a marble from her bag. If Meg’s marble is the same color as the host, then Meg has won and the game is over. If Meg loses, then Tyler will choose a marble from his bag. If Tyler chooses a marble the same color as the host or Meg, then he wins. If Tyler does not win then Ashley will choose a marble from her bag. Well, from here you can probably guess what it takes for Ashley to either win or lose. (Each choice will be random.)
A: Does every contestant have a chance to win? Explain.
B: Is it possible for none of the contestants to win? Explain.
C: Why are these first two questions important to ask and answer?
D: Is one contestant more likely to win than the other two? Explain.
E: Calculate the probability of a win for each contestant.
In: Statistics and Probability
Consider a game of chance consisting of a single trial with exactly two outcomes, which from a players perspective we will call "win" and "lose." To play the game, a player must wager an amount, which we will denote by a. If the player loses the game, a player loses their wager. If the player wins the game, then they keep their wager and they win $1.00. Denote the probability by p, where 0 < p < 1. Let the random variable X denote the amount won by the player.
A) Find the sample space of the random variable X.
B) Find the pmf of the distribution of the random variable X.
C) Compute the expression for E(X), the expected value of X.
D) A game is said to be fair if the expected amount won is 0. For what value of a, the amount wagered, would the game be described as a fair game?
E) For what vaules of a is E(X) >0?
F) For what values of a is E(X) <0?
G) Suppose a person is only willing to play if their expected amount won is non negative. For what values of a would this person be willing to play, and what values of a would this person not be willing to play?
In: Math
Historically, the number of cars arriving per hour at Lundberg’s Car
Wash is observed to be the following:
| Number of Cars Arriving | Frequency |
|---|---|
| 4 | 10 |
| 5 | 30 |
| 6 | 50 |
| 7 | 65 |
| 8 | 45 |
| Total: | 200 |
a. Set up a probability distribution table (including the lower end of
the probability range) for the car arrivals.
b. Simulate 25 hours of car arrivals. What is the average number of
arrivals per hour?
c. Repeat part b multiple times (by pressing F9). Over what range
does the average number of arrivals vary?
d. Now simulate 500 hours of car arrivals. What is the average
number of arrivals per hour?
e. Repeat part d multiple times (by pressing F9) Over what range
does the average number of arrivals vary?
f. Do your answers for part c and e differ? Why or why not?
In: Statistics and Probability
A retail corporation wants to know how often a customer returns items in a year. The company’s data analytics team analyzed customers’ shopping behavior and came up with three categories of customers. Customers in category 1 do not return items often. Customers in category 2 return some items, and customers in category 3 heavily return items. Suppose that the data analytics team modeled the number of returns in each category of customers according to a Poisson process with rates λ1 = 1 per year, λ2 = 4 per year, and λ3 = 10 per year for categories 1, 2, and 3, respectively. Category 1 customers constitute 30% of the customer base of this retail corporation, whereas Category 2 and 3 customers constitute 60% and 10% of the customer base, respectively.
(a) What is probability that the company gets 10 returned items from a customer during 2019 and 2020 (this time period includes both years 2019 and 2020)? Do NOT calculate a number. Just write an expression for this probability.
(b) Compute the mean and variance of the number of returned items for a customer during 2019 and 2020.
(c) Now consider a category 2 customer. Compute the mean and variance of the number of returned items for this customer (=a category 2 customer) during 2019 and 2020.
(d) Given that a customer returns 10 items in his or her first 2 years, what is the probability this is a category 2 customer? Do NOT calculate a number. Just write an expression for this probability.
In: Statistics and Probability
Use Python to write the following code.
Program Specifications:
You are to design the following menu:
G] Get a number
S] Display current sum
A] Display current average
H] Display the current highest number
L] Display the current lowest number
D] Display all numbers entered
Q] Quit
If the user enters G, S, A, H, L, or D before selecting G the program needs to advise the user to go and enter a number first.
Rules for the Programmer (you)
In: Computer Science