Different ways to weight probabilities or choose probability distribution - statistics

Let's say I am a cake shop selling 3 types of cake. When a customer comes in, I can only put one of my cakes on display. I choose the cake to display with uniform probability, so each cake has a ~33% chance to be displayed. The customer purchases a cake depending on which cake is displayed with a probability of xA, xB, xC.
After doing an analysis for each cake, we know that when cake A is on display, it is bought 90% of the time. When cake B is on display, it is bought 70% of the time. When cake C is on display, it is bought 68% of the time.
Cake
xi
A
0.9
B
0.7
C
0.68
The question is, when the next customer walks in, what probability distribution should we use to CHOOSE which cake to display next, to (1) optimize customer purchase, but (2) without losing all sales for the less popular cakes, like B and C. So, we can't just put cake A on display 100% of the time to get our cake purchased with 90% of probability.
One method I have thought of is doing a weighting of probabilities. In this case, we would display cake A (0.9)/(0.9+0.7+0.68)=39% of the time.
Cake
% of the time cake SHOULD be on display
A
39%
B
31%
C
30%
However, I think there might be a better way to do it, maybe taking into account purchase probability difference between A and B, etc? The % should add up to 100% for A, B, C.

Related

Weighted Average of Two Complier Average Treatment Effects

So I'm taking the weighted average of two complier average treatment effects (CATEs) for anassignment, but I'm not sure how to apportion the appropriate weights. Let me explain why I'm taking this average.
I am given data from a fictional randomized experiment testing the effects of get-out-the-vote efforts on turnout of urban and non-urban areas. Approximately half of the sample is of people who live in urban and non-urban areas, respectively, but they were not randomly assigned to the treatment and control group. That is, the treatment group is about 80% non-urban (the rest urban) and the control group is 80% urban (the rest non-urban). This creates a confounder because, everything else being equal, urbanites were less likely to vote than non-urbanites (at least in the fictional data).
I am being asked to estimate an overall compliance average treatment effect (CATE) for get-out-the-vote interventions while accounting for this confounder. To do this, I found separate a CATE for urban and non-urban parts of the sample, and I need to find an overall estimate from the two CATEs by taking a weighted average of them.
However, I'm not sure how to assign the appropriate weights. My professor has told us to assign more weight to the group that has more variation in the treatment. Since 80% of the treatment group is non-urban, should I assign a weight of .8 to the non-urban CATE and .2 to the urban one? (i.e., overall CATE = (.8)non-urban CATE + (.2)urban CATE)
For background, the data can be found here: https://press.princeton.edu/student-resources/thinking-clearly-with-data. It's the "GOTV_Experiment.csv" data. Thanks in advance for your help!

How to compare the performance of 2 statistical samplers?

Say I have an orchard of 10 trees with a total of 1000 apples. Each tree in the orchard may have a different number of apples, or no apples at all. I have two bucket samplers: the first one is small, taking X% of the apples from a single tree at a time (i.e. per sample), and the second sampler is large, taking X% of the apples from two trees at a time. The X% of both samplers is identical, the sampling is without replacement (meaning that apples taken during in a specific sample remain out), and both samplers must make exactly 50 samples. Also, I'm assuming that the two samplers do not operate on the same orchard but each one of them has its own orchard, identical to the other one.
What I need is to compare the total amount of apples that each sampler yields after 50 samples. Naturally, if X=100%, both samplers will yield all the apples in the orchard and their performance will be the same; but how do I calculate the difference in their performance as a function of X% ?
I dont have a solution for you, but I suspect there is some lack of information or I misunderstand something. I will describe the problems below using X=100 as example.
N=10 is the total population size of trees
BS1 collects X% apples from 50 trees
BS2 collects X% apples from 100 trees
Let i denote the i'the tree for i=1,..,10. And let yi denote the number of apples on tree i. Lets assume each tree has a fixed unknown amount of apples. Ofcause you say there is 1000 apples in total meaning when all apples from 9 of the trees are sampled we know the number of apples on the 10th tree - but I will ignore this, and assume yi is completely unknown.
If X=100% and we sample once
BS1 collect pick a random? tree to collect from with some probability - lets say 1/10 for each tree. At the same time BS2 does the same for two trees. Assuming BS2 and BS1 cannot pick the same tree, and BS1 always pick first.
After the first sample, BS1 has picked yi apples and BS2 has picked yl+yj apples, for (i,j,l in 1,...10, and i \ne j\ne l).
After the third sample only one tree will be left with apples.
Since BS1 pick first and we sample without replacement, BS1 will pick 3+1 trees and BS2 will pick 6 trees Thus BS1 will always pick more then half of the trees (since he pick first). The number of apples picked will then be the depending on how the apples are distributed on the trees.

Tuning Parameters to Optimize Score without CNN

I am trying to create an Agent in Rust that uses a scoring function to determine the best move on a 2D uniform cost grid. The specifics of the game aren't very relevant, other than knowing that each turn you can choose to make one of 4 moves (up, down, left or right) and you are competing against other AIs who are playing on the same board. Currently the AI makes "branches" of possible paths it could make into the future using several different simple algorithms such as using A* to find enemies or food. Several characteristics are saved as the future simulations run including the number of enemies we killed on that branch, amount of food we ate and how long the future branch lasted before we died.
Once we are ready to make our move, we give each future predicting branch a score and go in the direction with the highest average score. This score is essentially a sum of each characteristic mentioned previously multiplied by a constant. For example the score may be 30 * number of food eaten + 100 * number of enemies killed. However, the number 30 and 100 were chosen almost at random through experimentation. If the snake died from not eating food then I increase the score multiplier for eating food for example. However, there are 10 different characteristics each with their own weight. Figuring out the relationship between them all manually is both time consuming and doesn't easily converge onto the optimal strategy.
Here in lies my issue. I would like to find a way to "train" the values for the AI through a process sort of like Q-Learning. There is a very clear terminal condition when you win or lose which helps. My currently idea is creating a table with 100 possible values of each parameter, then play 100 games with each combination and record the win rate. However, this would take (1000 choose 10) * 100 games or 2.6E25 games. It seems like there should be a smarted way to eliminate bad combinations using some form of loss minimization. If anybody has suggestions on tuning these parameters without a neural network, it would be greatly appreciated.

Flipping a three-sided coin

I have two related question on population statistics. I'm not a statistician, but would appreciate pointers to learn more.
I have a process that results from flipping a three sided coin (results: A, B, C) and I compute the statistic t=(A-C)/(A+B+C). In my problem, I have a set that randomly divides itself into sets X and Y, maybe uniformly, maybe not. I compute t for X and Y. I want to know whether the difference I observe in those two t values is likely due to chance or not.
Now if this were a simple binomial distribution (i.e., I'm just counting who ends up in X or Y), I'd know what to do: I compute n=|X|+|Y|, σ=sqrt(np(1-p)) (and I assume my p=.5), and then I compare to the normal distribution. So, for example, if I observed |X|=45 and |Y|=55, I'd say σ=5 and so I expect to have this variation from the mean μ=50 by chance 68.27% of the time. Alternately, I expect greater deviation from the mean 31.73% of the time.
There's an intermediate problem, which also interests me and which I think may help me understand the main problem, where I measure some property of members of A and B. Let's say 25% in A measure positive and 66% in B measure positive. (A and B aren't the same cardinality -- the selection process isn't uniform.) I would like to know if I expect this difference by chance.
As a first draft, I computed t as though it were measuring coin flips, but I'm pretty sure that's not actually right.
Any pointers on what the correct way to model this is?
First problem
For the three-sided coin problem, have a look at the multinomial distribution. It's the distribution to use for a "binomial" problem with more then 2 outcomes.
Here is the example from Wikipedia (https://en.wikipedia.org/wiki/Multinomial_distribution):
Suppose that in a three-way election for a large country, candidate A received 20% of the votes, candidate B received 30% of the votes, and candidate C received 50% of the votes. If six voters are selected randomly, what is the probability that there will be exactly one supporter for candidate A, two supporters for candidate B and three supporters for candidate C in the sample?
Note: Since we’re assuming that the voting population is large, it is reasonable and permissible to think of the probabilities as unchanging once a voter is selected for the sample. Technically speaking this is sampling without replacement, so the correct distribution is the multivariate hypergeometric distribution, but the distributions converge as the population grows large.
Second problem
The second problem seems to be a problem for cross-tabs. Then use the "Chi-squared test for association" to test whether there is a significant association between your variables. And use the "standardized residuals" of your cross-tab to identify which of the assiciations is more likely to occur and which is less likely.

Can someone explain me Topcoder randomn pancake challenge's DP solution in SRM656

The challenge is as follows:
http://community.topcoder.com/stat?c=problem_statement&pm=13747&rd=16416
Charlie has N pancakes. He wants to serve some of them for breakfast. We will number the pancakes 0 through N-1. For each i, pancake i has width i+1 and deliciousness d[i].
Charlie chooses the pancakes he is going to serve using the following randomized process: He starts by choosing the first pancake uniformly at random from all the pancakes he has. He places the chosen pancake onto a plate. This pancake now forms the bottom of a future stack of pancakes. Then, Charlie repeats the following procedure:
If there are no more pancakes remaining, terminate.
Choose a pancake uniformly at random from the pancakes that have not been chosen yet.
If the width of this pancake is greater than the width of the pancake on top of the stack, terminate without taking it.
Place the chosen pancake on top of the stack and go back to step 1.
You are given the int[] d with N elements. The total deliciousness of a serving of pancakes is the sum of the deliciousness of all pancakes used in the serving. Compute and return the expected value of the total deliciousness of the pancakes chosen by Charlie.
This problem involves probability and i dont get the DP solution for it.

Resources