Dynamic programming is a mathematical optimization/programming approach applicable if an optimal solution can be constructed efficiently from optimal solutions of its subproblems. A classic example is the Towers of Hanoi.
Questions tagged [dynamic-programming]
641 questions
42
votes
5 answers
Expected outcome for repeated dice rolls with dice fixing
Here is another dice roll question.
The rules
You start with $n$ dice, and roll all of them.
You select one or more dice and fix them, i.e. their value will not change any more.
You re-roll the other dice.
Repeat that until all dice are fixed…
Joachim Breitner
- 711
24
votes
4 answers
Convergence of winning probability in a one-player dice-throwing game
In this (one-player) game, the player starts with a total of $n$ points. On each turn, they choose to throw either a four-, six-, or eight-sided die, and then subtract the number thrown from their point total. The game continues until the player's…
MJD
- 67,568
- 43
- 308
- 617
24
votes
5 answers
Fewest steps to reach $200$ from $1$ using only $+1$ and $×2$
This is a problem from the AMC 8 (math contest):
A certain calculator has only two keys $[+1]$ and $[\times 2]$. When you press one of the keys, the calculator automatically displays the result. For instance, if the calculator originally displayed…
jeremy radcliff
- 4,933
12
votes
3 answers
Dynamic programming — mathematics versus computer
I heard the term "dynamic programming" and naively assumed it had to do with programming in the sense of computer programming, as that's the only way I've heard the word used before — I used to work with software engineers a lot. After being laughed…
Ac3
- 439
10
votes
5 answers
Compute the number of ways the frog can move from A to B.
A frog is travelling from point A $(0,0)$ to point B $(5,6)$ but each step can only be $1$ unit up or $1$ unit to the right. Also, the frog refuses to move three steps in the same direction consecutively. Compute the number of ways the frog can move…
Ri-Li
- 9,466
- 4
- 56
- 104
10
votes
2 answers
Fastest way to get \$1 million of two different currencies in a video game
This question actually relates to a video game, I came across the scenario and I realized I had no idea how to go about solving something like this or even what branch of mathematics it falls under.
Anyway, the simplified version is as…
Aletheies
- 281
10
votes
0 answers
Why no Forward Dynamic Programming in stochastic case?
Dynamic programming usually works "backward" - start from the end, and arrive at the start. This works both when there is and when there isn't uncertainty in the problem (e.g. some noise in the state). The backward DP algorithm is then (for the case…
space_voyager
- 1,205
9
votes
1 answer
Egg dropping problem binomial coefficient recursive solution
I have a question about the binomial coefficient solution to the generalization of the egg dropping problem (n eggs, k floors)
In the binomial coefficient solution we construct a function $f(x,n)$, which represents the maximum number of floors we…
entechnic
- 672
9
votes
1 answer
Coloring problem with limited number of each colors.
I’m investigating graph coloring problem.
But I cannot find any solution about the problem with limited number of each colors. I mean, Suppose three colors(green, red, blue) and a graph, we start to color each vertex, but (If green color’s limit is…
plhn
- 641
7
votes
2 answers
Probability of encountering $5$ consecutive equal rolls in $100$ dice rolls?
This question is a creative thought of mine that I stumbled upon while studying some basic probability and statistics:
Problem
What is the probability of encountering $5$ consecutive equal rolls in $100$ dice rolls?
Attempt 1
First, I thought to…
Gio Tungul
- 101
7
votes
2 answers
Eggs and Floors Puzzle - Extended & Generalized
I asked this question on the CS exchange, and some have mentioned that this is more of a math problem than a CS problem. Thus, I will proceed to ask it here:
Recently I've run across the "Two eggs, 100 floors" problem:
You are given two eggs, and…
Abdulgood89
- 171
7
votes
1 answer
How to do continuous-time Bayesian updating?
I am reading a game theory lecture notes. Some parts involve a continuous time Bayesian updating computation which I didn't really understand.
There are two states $\{Good,Bad\}$. At time t people has prior belief that the state of world being…
Severus
- 83
- 6
6
votes
1 answer
Difference between Variation of Calculus problems and Control Theory problems?
Variation of Calculus seems to have problems without the control with variables such as state and time. Then again Control Theory problems seems to have problems with one extra variable that is control usually denoted by $u$. Variation of Calculus…
hhh
- 5,605
6
votes
5 answers
Math competition question about ways to spell BANANA in a square
This is a math competition question I did. Essentially, starting at B, a move consists of moving to a non-diagonal adjacent square and noting the letter you land on (with the exception of the starting letter B). How many ways can you spell…
user1148590
6
votes
0 answers
Game theory, probability and snooker
I have a question that is very simple to understand and very complex to answer.
If a snooker player could elect to forego potting a coloured ball (typically worth a handful of points) and instead move onto another (worth one), would they?
For…
Leonhard Euler
- 631