Mathematics, Surprisingly

Mathematics, Surprisingly

Do programmers need advanced mathematics? And what if they are designing and implementing a programming language? In the talk I will show where I needed mathematics in my work at Jut and how bad job I would have done without understanding it. You can think of this as a small contribution to a discussion about education of programmers and the role of mathematics and other theoretical subjects in it.

Presented at Rubyslava #52 (Data Science Edition).

Video: https://www.youtube.com/watch?v=7cThtM6Yk1A

Details:
http://lanyrd.com/2015/rubyslava-october/sdxdgc/
https://www.facebook.com/events/862212323886828/

Ebe96461709771a430da9c7c58f9ae5f?s=128

David Majda

October 22, 2015
Tweet

Transcript

  1. MATHEMATICS SURPRISINGLY David Majda Bratislava · October 22, 2015

  2. INTRODUCTION

  3. None
  4. None
  5. None
  6. { time: "2015-05-03T09:29:15.000Z" space: "default", source_type: "metric", name: "response_time", value:

    134.675 }
  7. read … | ( reduce -every :5s: max(value) by host

    | @timechart; keep time, value | @logger )
  8. read … | ( reduce -every :5s: max(value) by host

    | @timechart; keep time, value | @logger ) read @timechart reduce keep @logger
  9. DEMO

  10. LOGIC ALGEBRA I ALGEBRA II GEOMETRY & PHYSICS

  11. LOGIC

  12. read status = 500

  13. read status = 500 or (status = 404 and url

    !~ …)
  14. read status = 500 or (status = 404 and url

    !~ …)
  15. Conjunctive normal form

  16. (a 1,1 ∨ … ∨ a 1,m(1) ) ∧ …

    ∧ (a n,1 ∨ … ∨ a n,m(n) )
  17. read status = 500 or (status = 404 and url

    !~ …)
  18. read (status = 500 or status = 404) and (status

    = 500 or url !~ …)
  19. read (status = 500 or status = 404) and (status

    = 500 or url !~ …)
  20. ALGEBRA I

  21. read … | reduce c = count(x) s = sum(x)

    m = max(x)
  22. { c: 3, s: 6, m: 3 } read …

    | reduce c = count(x) s = sum(x) m = max(x) { x: 1 } { x: 2 } { x: 3 }
  23. { c: 2, s: 3, m: 2 } read …

    | reduce c = count(x) s = sum(x) m = max(x) { x: 1 } { x: 2 }
  24. { c: 1, s: 1, m: 1 } read …

    | reduce c = count(x) s = sum(x) m = max(x) { x: 1 }
  25. { c: ?, s: ?, m: ? } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  26. { c: 0, s: ?, m: ? } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  27. { c: 0, s: ?, m: ? } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  28. { c: 0, s: 0, m: ? } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  29. { c: 0, s: 0, m: ? } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  30. { c: 0, s: 0, m: undefined } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  31. { c: 0, s: 0, m: undefined } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  32. Identity element

  33. e: ∀a(e ⊕ a = a ⊕ e = a)

  34. None
  35. None
  36. None
  37. { c: 0, s: 0, m: -Infinity } read …

    | reduce c = count(x) s = sum(x) m = max(x) (nothing)
  38. ALGEBRA II

  39. read … value > 0.95 | reduce c = count()

  40. Elasticsearch Cassandra read … value > 0.95 | reduce c

    = count()
  41. Elasticsearch Cassandra read … value > 0.95 | reduce c

    = count()
  42. Associativity

  43. (a ⊕ b) ⊕ c = a ⊕ (b ⊕

    c)
  44. count count_unique sum avg min max first last pluck percentile

    sigma mad
  45. count count_unique sum avg min max first last pluck percentile

    sigma mad
  46. None
  47. None
  48. Monoid

  49. Set S, operation ⊕ : S ⨉ S → S

    1. ⊕ is associative on elements of S 2. S contains identity element under ⊕
  50. GEOMETRY & PHYSICS

  51. read time < :2015-04-01:

  52. Moment Duration :2015-04-01T20:05:27.034: :now: :3 weeks and 1 day ago:

    :20:05:27.034: :3s: :1 hour and 23 minutes:
  53. read time < :2015-04-01: - :1 day:

  54. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  55. Affine space

  56. None
  57. None
  58. None
  59. None
  60. None
  61. m 1 m 2 m 2 t d 1 d

    2
  62. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  63. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  64. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  65. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  66. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  67. Dimensional analysis

  68. v = s / t η = P out /

    P in
  69. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  70. N * D → D D * N → D

    N / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  71. N * D → D D * N → D

    D / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  72. None
  73. N * D → D D * N → D

    D / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  74. N * D → D D * N → D

    D / D → N D / N → D D % N → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  75. N * D → D D * N → D

    D / D → N D / N → D D % D → D M + D → M D + M → M D + D → D M - M → D M - D → M D - D → D
  76. None
  77. None
  78. CONCLUSION

  79. QUESTIONS?

  80. WHERE NEXT? http://en.wikipedia.org/wiki/Conjunctive_normal_form http://en.wikipedia.org/wiki/Disjunctive_normal_form http://en.wikipedia.org/wiki/Identity_element http://en.wikipedia.org/wiki/Associative_property http://en.wikipedia.org/wiki/Monoid http://en.wikipedia.org/wiki/Affine_space http://en.wikipedia.org/wiki/Dimensional_analysis

  81. IMAGE CREDITS http://commons.wikimedia.org/wiki/File:Torus.png