| { | |
| "task": { | |
| "id": "case_51", | |
| "name": "check_fibonacci", | |
| "summary": "Checks if each element is a Fibonacci number", | |
| "examples": [ | |
| { | |
| "input": [ | |
| "BOS", | |
| 74, | |
| 87, | |
| 99, | |
| 23, | |
| 2, | |
| 21, | |
| 52, | |
| 1, | |
| 87 | |
| ], | |
| "output": [ | |
| "BOS", | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 0 | |
| ] | |
| }, | |
| { | |
| "input": [ | |
| "BOS", | |
| 51, | |
| 92, | |
| 14, | |
| 71, | |
| 60, | |
| 20, | |
| 82, | |
| 86, | |
| 74 | |
| ], | |
| "output": [ | |
| "BOS", | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0 | |
| ] | |
| }, | |
| { | |
| "input": [ | |
| "BOS", | |
| 21, | |
| 88, | |
| 48, | |
| 90, | |
| 58, | |
| 41, | |
| 91, | |
| 59, | |
| 79 | |
| ], | |
| "output": [ | |
| "BOS", | |
| 1, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0 | |
| ] | |
| }, | |
| { | |
| "input": [ | |
| "BOS", | |
| 29, | |
| 37, | |
| 1, | |
| 63, | |
| 59, | |
| 20, | |
| 32, | |
| 75, | |
| 57 | |
| ], | |
| "output": [ | |
| "BOS", | |
| 0, | |
| 0, | |
| 1, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0 | |
| ] | |
| }, | |
| { | |
| "input": [ | |
| "BOS", | |
| 14, | |
| 61, | |
| 61, | |
| 46, | |
| 61, | |
| 50, | |
| 54, | |
| 63, | |
| 2 | |
| ], | |
| "output": [ | |
| "BOS", | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 1 | |
| ] | |
| } | |
| ], | |
| "is_categorical": true | |
| }, | |
| "program": "fib_sequence = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\ncheck_fibonacci_map = rasp.Map(lambda x: 1 if x in fib_sequence else 0, rasp.tokens).named(\"check_fibonacci_map\")\nreturn check_fibonacci_map", | |
| "components": [ | |
| { | |
| "id": "L0_MLP", | |
| "hook": "blocks.0.mlp.hook_post", | |
| "role": { | |
| "tag": "INDICATOR", | |
| "note": "Marks each input element as Fibonacci or not using a fixed lookup set." | |
| }, | |
| "rasp_vars": [ | |
| "check_fibonacci_map" | |
| ], | |
| "labels": [ | |
| "check_fibonacci_map_1" | |
| ] | |
| } | |
| ] | |
| } | |