#2024 Day 13

9 messages · Page 1 of 1 (latest)

hollow blade
timber crow

||How couldn't I expect part 2||

timber crow
bronze jackal
bronze jackal

Actually.... is it a ||line intersection||

timber crow
bronze jackal Can you point me in the directon of what formula youre using here lmao

This was my thought:
||We have six constants: ax, ay, bx, by, x, y. In the first example they are respectively 94, 34, 22, 67, 8400, 5400
We have to find a number for which these are true (a and b are the numbers we need to find):

  • ax * a + bx * b = x
  • ay * a + by * b = y
    (I have no idea how's this called in english tbh) These are two equations with two unknowns (a and b). We already know all the other variables, so it can be solved with some maths.||
    ||After all the substitutions and simplifications (too long to write here) we get b = (ax * y - ay * x) / (ax * by - ay * bx). We have everything here so it can be solved. In the example: b = (94 * 5400 - 34 * 8400) / (94 * 67 - 34 * 22) = 40. To find a we can extract it from ax * a + bx * b = x => a = (x - bx * b) / ax. In the example: a = (8400 - 22 * 40) / 94 = 80||
bronze jackal

Ahhh right. ||Yeah it's just basic algebra. I should have seen that||

Thanks

Then it doesn't matter for part b because the formula is the same