Computer science paper 2

Cards (147)

  • Designing, creating, and refining algorithms

    1. Identifying inputs, processes, and outputs for a problem
    2. Using structure diagrams to decompose a problem
    3. Creating flowcharts to represent algorithms
    4. Writing pseudocode as a textual representation of an algorithm
    5. Understanding OCR reference language for coding questions in the exam
  • Memorize the definition of each computational thinking component
  • Computational thinking is all about structuring solutions to problems in a way that computers can easily follow
  • Flowchart symbols
    • Line
    • Process
    • Subroutine
    • Input
    • Output
    • Decision
    • Terminal
  • Structure diagram components
    • User login
    • Search function
    • Sales function
    • Reorder function
    • Shopping basket
    • Payment sections
  • Computational thinking components
    1. Decomposition: breaking a problem down into smaller sub problems
    2. Abstraction: removing unnecessary details from a problem
    3. Pattern recognition: looking for similarities among and within problems
    4. Algorithmic thinking: deciding on the order of instructions and identifying decisions for the computer
  • Pseudocode
    • Textual representation of an algorithm, closely related to high-level languages, used for planning and communication
  • Flowchart program
    • Repeats asking for a number, adds it to the total, prints the total when the user chooses not to continue
  • OCR reference language is a strictly formalized version of pseudocode used in the j277 exam syllabus for coding questions in Part B of Paper 2
  • Assumption of rationality in economic theory is flawed as people usually don't act rationally
  • Rational agents

    • Consumers
    • Producers
    • Workers
    • Governments
  • The Wealth of Nations was written
    1776
  • When analysing markets, assumptions are made about the rationality of economic agents involved in transactions
  • Rational agents select the choice with the highest benefits
  • Producers act rationally by
    Selling goods/services to maximise profits
  • Workers act rationally by
    Balancing welfare at work with pay and benefits
  • Rational
    (in classical economic theory) economic agents are able to consider the outcome of their choices and recognise the net benefits of each one
  • Governments act rationally by
    Placing the interests of the people they serve first to maximise welfare
  • Consumers act rationally by
    Maximising their utility
  • Marginal utility
    Additional satisfaction gained from consuming an additional product
  • Increasing advertising by a firm
    Shifts the demand curve right, increasing equilibrium price and quantity
  • Total utility is obtained by adding up marginal utility for each unit consumed
  • Trace tables are used to follow each line of an algorithm step by step, showing variable contents and program output
  • Trace tables help identify errors in algorithms by tracking variable changes and unexpected conditions
  • Binary search is a more efficient algorithm for finding values in a sorted list by discarding half of the list at each step
  • Linear search inspects each item in a list sequentially to find a desired value, working on unsorted data
  • Binary search is very efficient, requiring a maximum of 21 comparisons to find a specific value in a list of one million numbers
  • Binary search
    Start with an ordered list of numbers, find the midpoint, compare the midpoint value to the value searched for, discard the top or bottom half based on the comparison, repeat the process until finding the value or determining it's not in the list
  • Binary search only works on a sorted list
  • Bubble sort
    Compare pairs of values, swap if in the wrong order, repeat for each pair until no swaps occur, list is then guaranteed to be in order
  • Insertion sort
    Split the list into a sorted side and an unsorted side, insert each value into the sorted list until the unsorted list is empty, resulting in a sorted list
  • Insertion sort is more efficient than a bubble sort algorithm
  • Merge Sort
    Divides the original list into sub-lists, then merges them back together in the correct order
  • Variables and constants are assigned using the equal symbol
  • Merge sort may not be the best sorting method for nearly sorted or small lists
  • Programming Fundamentals
    1. Variable is a name or label used to identify a memory location storing a changeable value
    2. Constant is a name or label used to identify a memory location storing an unchangeable value
  • Insertion Sort
    Sorts by taking the first item from the unsorted section and inserting it in the right place in the sorted list
  • Three basic programming constructs
    • Sequence
    • Selection
    • Iteration
  • Input data can be put into a program using simple input commands
  • Merge sort is much more efficient than a bubble or insertion sort