Skip to content

Instantly share code, notes, and snippets.

@vpipkt
Created April 23, 2020 19:46
Show Gist options
  • Save vpipkt/b3627ca8d5cf0724ff2a3e7991bbc3fb to your computer and use it in GitHub Desktop.
Save vpipkt/b3627ca8d5cf0724ff2a3e7991bbc3fb to your computer and use it in GitHub Desktop.
solution to tricksy picture algebra problem
# solution to https://files.slack.com/files-pri/T24GA6QHY-F0127L8RSUE/image_from_ios.jpg
import numpy
# index as cateprillar, clock and flower
# caterpillars data are # body segments
# clocks data are hour on the face of clock
# flower data are count of flowers, incl flowers on caterpillars' heads
a = numpy.array([
[5+5+5, 0, 3],
[5, 6+6, 1],
[5, 6, 2]
])
b = numpy.array([21, 19, 15])
x = numpy.linalg.solve(a, b)
caterpillar, clock, flower = x.tolist()
print(6 * caterpillar + 2 * flower * 5 * clock)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment