Skip to content / Đến nội dung
ThichHocToan.com

BEBRAS 2023 Grade 9-10 Round 2 Ext Question 1

BEBRAS · BEBRAS 2023 Grade 9-10 Round 2 Ext

Question 1

The commands below change a frog’s color. Each command has the form “If ... then ...” or “If ... then ...; otherwise ...”. Initially the frog has an unknown color. Which commands make the frog blue?

Editorial execution convention: execute the lines in order, testing each condition against the current color after any preceding change. Select all valid options.
  1. If the frog is red, color it blue; otherwise color it yellow.
  2. If the frog is yellow, color it red; otherwise color it blue.
  3. If the frog is yellow, color it red.
    If the frog is not yellow, color it blue.
  4. If the frog is red, color it blue.
    If the frog is not red, color it blue.