Calculating MBPS - Average - networking

I have found below calculation from http://www.gridsouth.com/services/colocation/basics/bandwidth
I have no idea how they came up with final number 1.395 mbps. Can you please help me with the formula used in below example?
If your network provider bills you on average usage, let's say they sample your MBPS usage 100 times in one month (typically it would be more like every 5 minutes) and of those samples your network usage was measured as follows: 20 times: .1 MBPS, 30 times .1.5 MBPS, 30 times 1.8 MBPS, 15 times 1.9 MBPS and 5 times at 2 MBPS. If you average all these samples you would be billed at whatever the price is in your contract for 1.395 MBPS bandwidth.

(20*0.1 + 30*1.5 + ... + 5*2)/100 = 1.395
Looks like the standard definition for a (weighted) average...

Related

Aws dynamodb auto scale price

When I use Aws dynamodb, I didn't know how the service calculate the cost with auto scale in each hour.
example:
If first 12 "minutes" the write unit is 10 WCU, after that write unit is
20 WCU in one hour.
What is actual write unit should I pay? (10, 20 or 10 * 0.2 + 0.8 * 20)
There's specific examples of this at https://aws.amazon.com/dynamodb/pricing, and in short you will pay for the maximum capacity units in a given hour when scaling up, and the target capacity units when scaling down.

Calculating Odds of winning?

So I'm trying to calculate the odds of someone winning, so for example there are 1,000 tickets, 4 people buy 250 tickets that would mean they have 25% chance each.
So I looked at how http://www.calculatorsoup.com/calculators/games/odds.php but it says 20% chance...
I'm not sure if I'm being stupid here or not... I'm unsure how to do this. so far I've done the following
p = 250 / (1000 + 250) * 100
but it gives me 20...
Do not think too much, the answer is obvious here:
P = 250 / 1000
Hence the probability to win is 25%.
The only reason where you should be using the formula P = A / (A + B) is the following:
You have A red balls and B blue balls and you want to know the probability of picking a red one amongst all of them. Then the probability is P = A / (A + B).
Your A and B values are 750 and 250 respectively. It gives you 25%.
Reason: If the winning ticket is in 250 tickets which you bought, then you will win. This is why B = 250. But if it is in other 750, you won't win. So, your A is 750. 250 / (250 + 750) = 1/4 = 0.25
The link you provided is for an odds calculator for sports betting. But the question you have is to do with probability.
You are correct in answering that the odds for each of the 4 people is 25%. Each person has a 250/1000 or 1/4 chance of winning.
but it says 20% chance...
I assume you're entering 1000 and 250 in that site's input fields? Note how the input is defined. It's asking for A:B odds. Which means the total would be both numbers combined, and the B value is your chance of winning.
Consider the example by default on that page: 3:2 odds of winning. That is, out of a total of 5, 3 will lose and 2 will win. So you have a 40% chance of winning.
So if you put 1000 and 250 into the inputs, then out of a total of 1250 there will be 250 winners, so any given player has a 20% chance of winning.
p = 250 / (1000 + 250) * 100 but it gives me 20...
That's correct.
If there is a total of 1000 and there will be 250 winners, then it would be 750:250 odds, or 3:1 odds, which is 25%. To verbalize it, you might say something like:
In this contest, any given player has 250 chances to win and 750 chances to lose. So their odds are 3:1.
If the tickets were distributed more oddly, each person would have individual odds which may not reduce to smaller numbers. For example, if someone bought 3 tickets, their odds would be 997:3.

Probability in multi-user operating system

In a multi-user Operating System,20 requests are made to use a particular resourse per hour,on an average.The probability that no requests are made in 45 minutes is:
A). e^-15
B).e^-5
C).1-e^-5
D). 1-e^-10
I have spent time on wikipideia and several other sites but none of them clearly figured out
The stochastic process you are describing is a Poisson process. From Wikipedia:
In probability theory, a Poisson process is a stochastic process that counts the number of events and the time points at which these events occur in a given time interval. The time between each pair of consecutive events has an exponential distribution with parameter λ and each of these inter-arrival times is assumed to be independent of other inter-arrival times.
Since the exponential distribution is memoryless, we can define T to be an exponentially-distributed random variable that represents the time until the next event.
What should the expectation of T be? You have described a process in which the rate of events is 20 per hour. This is every 3 minutes. So E[T] = λ-1 = 3 min and thus λ = 1/3 min-1.
Now you are asking the question "What is the probability that no events occur in the next 45 minutes?" This is P(T > 45 min).
P(T > 45 min) = 1 - P(T ≤ 45 min) = 1 - (1 - e-45 min × λ) = e-15
This uses the fact that the cumulative density function for the exponential distribution is P(T ≤ t) = 1 - e-λt.

Calculating new temperature of an object when air temperature changes

I'm trying to calculate the new temperature of an object when the air temperature around it changes, given a period of time.
Basically I get periodic readings from an air temperature sensor in a refrigerator. In some cases these readings are every 5 minutes, in others every 1 minute, so the time between readings is variable.
For each reading I get, I'd like to also calculate the approximate temperature of food at its core; something like a chicken for example (I know that part is vague, but if there is a variable I can tweak then that is fine).
The result should be a "damped" version of the actual air temperature, as obviously any objects will slowly change temperature to eventually meet the air temperature.
Initially there used to be "food simulant" put around the sensor, so the temperature would automatically be damped, but this is no longer the case.
I do not know much about thermodynamics. I'm not sure if I can just add a percentage of the temperature change to the previous damped value, or if I need a calculation based on the last few air temperature readings, or what.
I guess I'm looking for a result a bit like:
10:00 2 degrees (air), 2 degrees (product)
10:05 2.5 degrees (air), 2.1 degrees (product)
10:10 2.5 degrees (air), 2.2 degrees (product)
10:20 2.7 degrees (air), 2.5 degrees (product)
I could do something really cheap like averaging the readings over the last 30 minutes but I don't think that will cut it!
I'm not really sure this is the correct forum for this question! I'd appreciate any help - thanks very much.
EDIT: I have since found a solution by reading up on Fourier's Law. I will post the solution once I have some time. Thanks to anyone who commented.
A simple model would be to assume that the product changes temperature by a fraction of the difference between the product temerature and the air temperature.
airTemp = readAirTemp();
productTemp = productTemp + factor * (airtemp - productTemp);
If the time interval between readings changes, then you need to change the factor.
The factor also depends on which product you want to emulate.
Let's assume a factor of 0.5 at a 5 minute time interval.
Example (core temperature of a 25 degree product placed in a 5 degree refridgerator):
Time ProductTemp Temp Calculation:
0 25 5 <astart condition>
5 15 5 ptemp = 25 + 0.5 * (5-25)
10 10 5 ptemp = 15 + 0.5 * (5-15)
15 7.5 5 ptemp = 10 + 0.5 * (5-10)
20 6.25 5 ptemp = 7.5 + 0.5 * (5-7.5)
25 5.625 5 ptemp = 6.25 + 0.5 * (5-7.5)
A real physics model would consider heat transfer through thermal radiation, heat conduction and convection. However, having a single variable to tweak (factor) is a good start if you want a simple yet fairly realistic model.
Edit:
This is not an exact model. If you put something really hot in the fridge (like 1000 degrees), then radiation would be the leading term in the cooling equation and temperature would decline faster. The above model should work well when the difference is small. The factor would depend on the item (the things you mentioned and also the amount of energy it takes to change the temperature of the food and the shape of the food - thin food cools faster) and its surrounding (can air flow freely around it or is the fridge full).
Calculating the factor is by no means simple. I recommend that you put a thermometer in a couple of types of food, put them in the fridge and measure in 5 minute intervals and then calculate the factor for each food type. The factor would still be inexact - a small apple cools faster than a big apple and so on.

Calculating optimal window size

I'm currently trying to calculate the optimal window size. I got these variables:
Propagation delay: 10 ms
Bit speed: 100 kbps
Frame size: 20 bytes
When the propagation delay is 10 ms we get a limit when the window size is 13 and when the propagation delay is 20 ms we get a limit when we have a window size of 24.
Is there any formula to calculate the maximum window size?
The formula to your Question is:
(Bitspeed*2*tp)/buffer*8 = windowsize
Where:
Bitspeed = 100 in your case
2*tp = RTT (The time it takes to send and return a package), which in your case is 20
And buffer = 20, 20*8 to get the bitsize
Windowsize = the thing you want calculated
Hope I was helpful!
Bandwidth times delay. It's called the bandwidth-delay product.

Resources