{"base":{"id":"cs8-20","subject":"Algorithms","title":"Breaking a problem down","scene":"pycode","steps":[{"mode":"tree","eyebrow":"Decomposition","title":"Big problem, small parts","body":"Decomposition means breaking a big problem into smaller parts that are easier to design, build and test. An adventure game is far too big to write in one go. Split it up.","actions":[{"id":"split","label":"Split it up"}]},{"mode":"parts","eyebrow":"Jobs","title":"What does each part do?","body":"For each part, decide its job: what goes in (input) and what comes out (output). Then different people can build different parts at the same time. Look at each part.","actions":[{"id":"p0","label":"Rooms"},{"id":"p1","label":"Player input"},{"id":"p2","label":"Puzzles"},{"id":"p3","label":"Score"}]},{"mode":"connect","eyebrow":"Connections","title":"How the parts fit together","body":"The output of one part becomes the input of another. Knowing these links means the parts will fit when they are joined. Play one turn and follow the data.","actions":[{"id":"play","label":"Play a turn"}]},{"mode":"quiz","eyebrow":"Check yourself","title":"Plan a party","body":"Leo decomposes ‘plan a birthday party’ into: food, games, invitations, decorations.","question":"What is the main benefit?","options":["The party gets cancelled","There is less to do in total","Each part is smaller and easier to plan"],"answer":2,"right":"Correct. Smaller parts are easier to plan, share out and check.","wrong":"Not quite. Is the total work smaller, or easier to handle?","look":"tree"}],"more":[{"type":"cards","id":"ideas","eyebrow":"Popular idea vs science","title":"Common mix-ups","items":[{"tag":"Popular idea","title":"\"Planning wastes time; just start coding.\"","body":"Big programs written without a plan get tangled and are hard to fix. Decomposition saves time later."},{"tag":"Popular idea","title":"\"Each part can be built without thinking about the others.\"","body":"The parts must agree on their inputs and outputs, or they won't fit together."},{"tag":"Popular idea","title":"\"Decomposition makes less work.\"","body":"The total work is the same, but each piece becomes manageable and testable."}]},{"type":"cards","id":"why","eyebrow":"Why decompose?","title":"Benefits","items":[{"tag":"Easier","title":"Small problems","body":"Each part is simple enough to understand and solve."},{"tag":"Teamwork","title":"Share the work","body":"Different people can build different parts at the same time."},{"tag":"Testing","title":"Check parts alone","body":"A small part is quick to test before it is joined to the rest."},{"tag":"Reuse","title":"Use it again","body":"A score part written for one game can be used in another."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Decompose it","items":[{"title":"Plan a school trip","time":"20 minutes","need":["Paper and coloured pens"],"steps":["Write 'School trip' in a box at the top of the page.","Split it into 4 parts underneath (for example transport, food, timetable, permission).","Split each part into 2 or 3 smaller jobs.","For one part, write its input and output, e.g. Food: input = number of students; output = shopping list."],"why":"You built a decomposition diagram. The inputs and outputs show how the parts depend on each other.","safety":"No safety risks."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Six more questions","questions":[{"question":"What is decomposition?","options":["Deleting a program","Breaking a problem into smaller parts","Running code faster"],"answer":1,"right":"Correct. Smaller parts are easier to solve.","wrong":"Not quite. Think 'break down'."},{"question":"When should you stop breaking a part down?","options":["When it is small enough to do in one go","Never","After one split"],"answer":0,"right":"Correct. Keep going until each part is manageable.","wrong":"Not quite. How small is small enough?"},{"question":"Why write each part's input and output?","options":["To make the code longer","So the parts fit together","To change the colours"],"answer":1,"right":"Correct. Agreed inputs and outputs connect the parts.","wrong":"Not quite. What happens when parts are joined?"},{"question":"In a game, the Player input part sends a choice to the Rooms part. The choice is…","options":["only a colour","an output of Player input and an input of Rooms","not data"],"answer":1,"right":"Correct. One part's output is another's input.","wrong":"Not quite. Which way does the data travel?"},{"question":"Which is a benefit of decomposition for a team?","options":["Only one person can work","Testing is impossible","People can build parts at the same time"],"answer":2,"right":"Correct. Work can be shared.","wrong":"Not quite. Think about teamwork."},{"question":"Which is a good sub-part of 'make a quiz app'?","options":["Check the player's answer","Make a phone","Build the internet"],"answer":0,"right":"Correct. It's a small, clear job within the app.","wrong":"Not quite. Which job belongs inside the quiz app?"}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can explain…","items":["what decomposition means","how to draw a decomposition diagram","how to describe each part's job with its input and output","how the parts connect by passing data","why decomposition helps teams and testing"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"decomposition","meaning":"Breaking a problem into smaller parts."},{"word":"sub-problem","meaning":"A smaller part of a bigger problem."},{"word":"decomposition diagram","meaning":"A tree showing a problem and its parts."},{"word":"input","meaning":"Data a part receives."},{"word":"output","meaning":"Data a part produces."}]},{"type":"sources","id":"sources","title":"Sources","items":["BBC Bitesize KS3 Computing: Decomposition"]}]},"overlay":null}