Example result illustrating this prompt's visual direction. Actual results may vary by model, reference image and settings.
Dynamic Programming Table from Staircase Notes
Convert a recurrence photo into a bottom-up table with base cases and dependencies.
Prompt
Transform the uploaded photo of handwritten algorithm notes into a clean, readable visual walkthrough. Treat the photo as the source of truth: preserve its algorithm, legible input values and stated conventions; remove glare, skew and paper clutter while retaining a small source-note inset. Do not invent unreadable values or silently repair contradictory logic; ask one focused question if an essential detail cannot be read. Use the optional example below only when the source has no worked example and label it "Illustrative example". Explain the count of distinct ordered ways to climb n steps taking one or two steps at a time. Preserve the source convention or explicitly state ways(0)=1 and ways(1)=1, with ways(n)=ways(n-1)+ways(n-2) for n>=2. Optional labeled example n=5: indices 0,1,2,3,4,5 have counts 1,1,2,3,5,8. Show each new cell combining the previous two, avoiding a misleading minimum-cost interpretation. Use only nonnegative integer n and flag other inputs. State O(n) time and O(n) table space under the usual unit-cost arithmetic model; mention O(1) stored counts only as a separate optimization. Layout: Use a six-cell table across the bottom and a stair silhouette above; provide labeled dependency arrows from the previous two cells for one magnified update. Use an off-white canvas, dark high-contrast sans-serif labels and spacious cells. Include the algorithm title, input, numbered steps, final result and the stated complexity note. Pair colors with labels or outlines so meaning does not depend on color alone. Keep all values and state changes consistent across panels. If space is tight, simplify decoration rather than omitting essential steps. Output one polished educational image; treat it as a visual explanation, not executable code. Before finalizing, check the trace and all visible labels against the source.
How to use it
- Upload a clear photo of the relevant handwritten algorithm notes.
- Paste this prompt and specify any required input or indexing convention.
- Check the rendered values and labels against your source before publishing.
Common failure fixes
- If counts are shifted, state and verify ways(0)=1 and ways(1)=1 before filling.
- If the illustration counts minimum moves, restore the task of counting ordered step sequences.
- If table space is called constant, label O(n) storage and discuss the two-count optimization separately.