▲ | iotasilly 2 days ago | |||||||
Since J allow you to write short code, here are three example in J. The first use iota1000, the second a random permutation, and the third use matrix notation to create a little guessing game. Example 1: Find the missing number
This print 'The missing number is 129'Example 2: Using a random permutation, find the missing number.
Example 3: find the missing number in this matrix.
Final test: repeat 10 times the example 3 (random matrices) and collect the time it takes you to solve it in a list of times, then compute the linear regression best fit by
Did you get better at solving it by playing more times?I am not affiliated with J, but in case you want to try some J code there is a playground: https://jsoftware.github.io/j-playground/bin/html2/ Edited: It seems I am procrastinating a lot about something I have to do but don't want to. | ||||||||
▲ | Pompidou a day ago | parent [-] | |||||||
the top comment trick [ n, 1, n + 1, 0 ][n % 4] can be implemented in J as following :
Then:
.... | ||||||||
|