Dynamic programming Definition and 14 Threads
-
C
Comp Sci Validating Braces Placement for Expression Evaluation
Here's what I've done: Mentor note: replaced icode tags with code=python and \code pair. def valid_braces_placement(s, L): if len(L)==0: return False string = '' for element in L: string = string + str(element) D = ['+','-','*'] return...- CGandC
- Thread
- Dynamic programming Expression Permutation Placement Python Recursion String
- Replies: 10
- Forum: Engineering and Comp Sci Homework Help
-
F
Optimization Problem - Dynamic Programming
Summary:: Hi, this is an exercise from an algorithm course. I have been trying for hours but I have no successful ideas on how to solve it. I can only understand that DP is the correct approach, since Greedy method does not work. Suppose you have *n* friends that wants to give you an amount of...- Fl0W3R
- Thread
- Constrained optimization Dynamic Dynamic programming Optimization Programming
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
C
DP: proving existence of optimal substructure for "Sherlock and Cost"
I was attempting to solve the "Sherlock and Cost" problem from HackerRank using DP: But before I went to come up with a recursive relation, I wanted to find if the problem possesses an optimal substructure, and I was following these steps as written at CLRS book: Mentor note: Inline images of...- CGandC
- Thread
- Dynamic programming Existence Logic Proof Recursion
- Replies: 17
- Forum: Programming and Computer Science
-
M
MHB Dynamic programming: which recurrence relation do we use?
Hey! :unsure: At the cash register of a store we want to give change of worth $V$ cents of euro. Create and analyze a greedy algorithm that gives the change using the minimum number of coins. Assume that the available coins are the euro subdivisions, i.e. $\{1, 2, 5, 10, 20, 50\}$ and that we...- mathmari
- Thread
- Dynamic Dynamic programming Programming Recurrence Relation
- Replies: 2
- Forum: Programming and Computer Science
-
M
Dynamic Programming - Restoring white space between words in a file
All the white space among words in a text file was lost. Write a C++ program which using dynamic programming to get all of the possible original text files (i.e. with white spaces between words) and rank them in order of likelihood with the best possible runtime. You have a text file of...- MattS134
- Thread
- Algorithms C++ C++ programming Computer science Dynamic Dynamic programming File Programming Space
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Other Operations research, stochastic dynamic programming, sources
My lecture notes and recommended textbook Hillier and Liberman are not enough for me. My methodology and formulation of problems still seems like too much guess-work. Can anyone recommend any good resources, lecture notes or textbooks, for stochastic DP? Many thanks- binbagsss
- Thread
- Dynamic Dynamic programming Operations Programming Research Sources Stochastic
- Replies: 1
- Forum: Science and Math Textbooks
-
S
Where is my logic wrong in this dynamic programming problem?
I'm trying to solve https://www.hackerrank.com/challenges/summing-pieces and I think I have come up with an O(n) solution although the numbers aren't coming out exactly right. The problem is essentially to find a sum like ABCD ---> All sets of sets of contiguous subarrays spanning ABCD is {...- SlurrerOfSpeech
- Thread
- Dynamic Dynamic programming Logic Programming
- Replies: 2
- Forum: Programming and Computer Science
-
How Can Dynamic Programming Optimize Study Hours for Maximum Grades?
Homework Statement Suppose it’s nearing the end of the semester and you’re taking n courses, each with a final project that still has to be done. Each project will be graded on the following scale: It will be assigned an integer number on a scale of 1 to g > 1, higher numbers being better...- Danielm
- Thread
- Dynamic Dynamic programming Programming
- Replies: 8
- Forum: Precalculus Mathematics Homework Help
-
MHB How do we use dynamic programming?
Hello! (Wave) Could you explain to me how we can use dynamic programming in order to solve a non linear programming problem? What do we do for example if we are given the following problem? $$\max (y_1^3-11 y_1^2+40 y_1+y_2^3-8y_2^2+21 y_2) \\ y_1+y_2 \leq 5.4 \\ y_1, y_2 \geq 0$$- evinda
- Thread
- Dynamic Dynamic programming Programming
- Replies: 15
- Forum: Set Theory, Logic, Probability, Statistics
-
O
Bellman Equation, Dynamic Programming, state vs control
Hi, I am proficient in standard dynamic programming techniques. In the standard textbook reference, the state variable and the control variable are separate entities. However, I have seen examples in economics, in which a single variable, let's say consumption, is both a state variable and a...- onthetopo
- Thread
- Control Dynamic Dynamic programming Programming State
- Replies: 5
- Forum: General Math
-
MHB Memoized Dynamic Programming algorithm
Hello! (Wave) I am looking at the following example of Memoized Dynamic Programming algorithm. memo={} Fib(n): if n in memo return memo[n] if n<=2 F[n]=1 else F[n]=F[n-1]+F[n-2] memo[n]=F[n] return F[n] Could you explain me why we check if $n$ is in memo although memo is a set...- evinda
- Thread
- Algorithm Dynamic Dynamic programming Programming
- Replies: 2
- Forum: Programming and Computer Science
-
P
Dynamic Programming with 2 state variables
Homework Statement Derive the Euler Equation of the dynamic programming problem: \[max_{\{ z_t \}^\infty_{t=0}} \sum_{t=0}^{\infty} \delta^t f(x_t, y_t, z_t) \] subject to: x_{t+1} = g_1(x_t, y_t, z_t), \ y_{t+1} = g_2(x_t, y_t, z_t), \ x_0 = x^0, y_0 = y^0 and where \delta <1...- physicsguy142
- Thread
- Dynamic Dynamic programming Programming State Variables
- Replies: 2
- Forum: Calculus and Beyond Homework Help
-
Y
How to Solve This Dynamic Programming Problem with Two Subsequences?
I'm having problem to solve this problem in DP: Given 2 subsequences: X = {x1, x2,..., xm} and Y = {y1, y2, ... , yn} so `n <= m` and also `y1 <= y2 <= ... <= yn`. The goal is to find a sub-sequence of `X` (xi1, xi2, ... , xin) such that: sum(k is 1 to n) | xik - yk | is...- ydan87
- Thread
- Dynamic Dynamic programming Programming
- Replies: 2
- Forum: Programming and Computer Science
-
S
Dynamic Programming Related Questions
Hi all, (1.) Can someone tell me the difference between a compact valued and single valued correspondence? (2.) I have been seeing repeating themes of "continuity on a compact set". Does that imply boundedness and thus possible to attain maximum? (3.) What's the difference between...- sampahmel
- Thread
- Dynamic Dynamic programming Programming
- Replies: 3
- Forum: General Math