Brevet (DNB) 2021 — Mathematics general stream, Asie (secours) juin 2021 — exercise 3 : Scratch and probability (official exam paper)
Statement
We are working with the Scratch software, for which several screenshots are shown below.
Main script:
- When the green flag is clicked;
- execute the « Initialization » block;
- set the variable « 1st number » to a random number between 1 and 10;
- set the variable « 2nd number » to a random number between 1 and 10;
- if « 1st number < 2nd number » then execute the « Pattern A » block, otherwise execute the « Pattern B » block.
Pattern A block:
- define « Pattern A »;
- clear everything;
- put the pen down;
- point in direction 90;
- repeat 2 times: move forward 30, turn left 90 degrees, move forward 30, turn right 90 degrees;
- lift the pen up.
The « Pattern B » block is used to draw a triangle.
Information:
- The « Initialization » block clears the screen and prepares the sprite.
- The instruction « point in direction 90 » means that the sprite is facing horizontally to the right.
- The instruction « random number between 1 and 10 » lets you choose at random an integer from the following list: 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10.
- « 1st number » and « 2nd number » are two variables that are displayed on the screen. On the screen, the display « 1st number 4 » indicates that the variable « 1st number » takes the value 4.
1. Draw by hand an outline of pattern A defined by the « Pattern A » block.
2. After clicking on the green flag, the screen displays: « 1st number 7 » and « 2nd number 3 ». Which pattern is then displayed on the screen: « Pattern A » or « Pattern B »?
3. Run the program again. If the variable « 1st number » takes the value 3, calculate the probability that the screen displays « Pattern A ».
⏳ Solution not generated yet
Open this statement in Expert Maths AI: the step-by-step solution is computed on demand, checked by a second resolution, then published here for everyone.
📝 See the solutionHave a similar exercise? Get it solved step by step, for free.
🧮 Solve my exercise