Better than brute force algorithms for a coin-flipping game

Pro Q

I have a problem and I feel like there should be a well-known algorithm for solving it that's better than just brute force, but I can't think of one, so I'm asking here.

The problem is as follows: given n sorted (from low to high) lists containing m probabilities, choose one index for each list such that the sum of the chosen indexes is less than m. Then, for each list, we flip a coin, where the chance of it landing heads is equal to the probability at the chosen index for that list. Maximize the chance of the coin landing heads at least once.

Are there any algorithms for solving this problem that are better than just brute force?

This problem seems most similar to the knapsack problem, except the value of the items in the knapsack isn't merely a sum of the items in the knapsack. (Written in Python, instead of sum(p for p in chosen_probabilities) it's 1 - math.prod([1 - p for p in chosen_probabilities])) And, there's restrictions on what items you can add given what items are already in the knapsack. For example, if the index = 3 item for a particular list is already in the knapsack, then adding in the item with index = 2 for that same list isn't allowed (since you can only pick one index for each list). So there are certain items that can and can't be added to the knapsack based on what items are already in it.

Linear optimization won't work because the values in the lists don't increase linearly, the final coin probability isn't linear with respect to the chosen probabilities, and our constraint is on the sum of the indexes, rather than the values in the lists themselves. As David has pointed out, linear optimization will work if you use binary variables to pick out the indexes and a logarithm to deal with the non-linearity.

EDIT:

I've found that explaining the motivation behind this problem can be helpful for understanding it. Imagine you have 10 seconds to solve a problem, and three different ways to solve it. You have models of how likely it is that each method will solve the problem, given how many seconds you try that method for, but if you switch methods, you lose all progress on the one you were previously trying. What methods should you try and for how long?

EDIT: As David has pointed out, linear optimization will work

David Eisenstat

Maximizing 1 - math.prod([1 - p for p in chosen_probabilities]) is equivalent to minimizing math.prod([1 - p for p in chosen_probabilities]), which is equivalent to minimizing the log of this objective, which is a linear function of 0-1 indicator variables, so you could do an integer programming formulation this way.

I can't promise that this will be much better than brute force. The problem is that math.log(1 - p) is well approximated by -p when p is close to zero. My intuition is that for nontrivial instances it will be qualitatively similar to using integer programming to solve subset sum, which doesn't go particularly well.

If you're willing to settle for a bicriteria approximation scheme (get an answer such that the sum of the chosen indexes is less than m, that is at least as good as the best answer summing to less than (1 − ε) m) then you can round up the probability to multiples of ε and use dynamic programming to get an algorithm that runs in time polynomial in n, m, 1/ε.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to build a Plinko board of words from a dictionary better than brute force?

From Dev

Brute Force Algorithm Issue

From Dev

Coin Toss game in R

From Dev

Lookup algorithms for lists-in-lists that are better than O(n²) complexity

From Dev

How flipping a coin and display tails and heads counting?

From Dev

Sudoku Brute Force Algorithm

From Dev

Biased coin flipping?

From Dev

Knapsack - brute force algorithm

From Dev

Javascript Image Replace Coin Flipping

From Dev

Brute force decryption python

From Dev

Time complexity of Prolog better than naive brute force?

From Dev

Better than brute force algorithms for a coin-flipping game

From Dev

3D Coin Flipping Animation on SKSpriteNode

From Dev

How is the branch and bound algorithm faster than the brute force algorithm when solving the Traveling Salesman Problem?

From Dev

How to build a Plinko board of words from a dictionary better than brute force?

From Dev

Fix coin change brute force solution

From Dev

Brute force closest pair algorithms - for loops

From Dev

Coin Flipping/Card picking program not working

From Dev

Brute Force Permutation Swapping

From Dev

MATLAB brute force loop

From Dev

Perl brute force attack

From Dev

Hydra brute force error

From Dev

Creating an iterator to brute force

From Dev

Is there a better way than this to force monitor blank/off?

From Dev

Flipping cards in a memory game

From Dev

Brute Force the Frog Jumping Game

From Dev

Brute Force in java

From Dev

Coin flipping - returning random outcome

From Dev

solution for the flipping coin issue