Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MathPHP で数学人材を目指す - PHPカンファレンス 2021 1週間前イベント 〜 ...
Search
hamakou108
September 25, 2021
Programming
0
220
MathPHP で数学人材を目指す - PHPカンファレンス 2021 1週間前イベント 〜 帰ってきたPHP勉強会@東京
PHPカンファレンス 2021 1週間前イベント 〜 帰ってきたPHP勉強会@東京の登壇資料です。
hamakou108
September 25, 2021
Tweet
Share
More Decks by hamakou108
See All by hamakou108
私達のチームのデプロイ戦略の軌跡 〜継続的デプロイの導入に至るまで〜
hamakou108
1
1.5k
Laravel のメール認証の内部実装を掘り下げる - PHPerKaigi 2021
hamakou108
4
2.3k
PHPer のための Vim 実践入門 - PHP Conference 2020
hamakou108
0
750
Other Decks in Programming
See All in Programming
技術同人誌をMCP Serverにしてみた
74th
1
640
10 Costly Database Performance Mistakes (And How To Fix Them)
andyatkinson
0
330
AI時代の『改訂新版 良いコード/悪いコードで学ぶ設計入門』 / ai-good-code-bad-code
minodriven
13
3.5k
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
12
4.4k
Discover Metal 4
rei315
2
130
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
1
420
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
130
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
130
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
130
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
1
440
5つのアンチパターンから学ぶLT設計
narihara
1
170
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
770
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
It's Worth the Effort
3n
185
28k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
970
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
Six Lessons from altMBA
skipperchong
28
3.9k
Documentation Writing (for coders)
carmenintech
72
4.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Transcript
MathPHP で数学人材を目指す 2021.09.24 PHPカンファレンス 2021 1週間前イベント 〜 帰ってきたPHP勉強会@東京 濱田晃輔 @hamakou108
自己紹介 濱田晃輔 @hamakou108 株式会社M&Aクラウド PHP 歴は2年弱
数学人材
数学人材とは 経団連が数学と数学人材に注目するのはAI(人工知能)やICTの土台となっている からだけではない。物事の抽象度を高めて定式化する数学的思考のできる人材 が、デジタル社会に不可欠という認識がある。 世界で争奪戦の数学人材、経団連が産学連携で日本の出遅れ挽回できるか | 日経クロステック(xTECH); https://xtech.nikkei.com/atcl/nxt/column/18/00001/05872/
「数学人材」と聞いて、あまりピンとこない
None
そもそも数学の重要性がはっきりと分からない
そもそも人類にとって数学はどのような存在なのか
None
西暦一五〇〇年ごろ、歴史はそれまでで最も重大な選択を行ない、人類の運命だ けではなく、おそらく地上のあらゆる生命の運命をも変えることになった。私た ちはそれを科学革命と呼ぶ。 (中略) 近代科学には教義はない。とはいえ、共通の核となる研究の方法はある。そうし た方法はみな、経験的観察結果(少なくとも私たちの五感の一つで観察できるも の)を収集し、数学的ツールの助けを借りてそれをまとめることに基づいてい る。 ユヴァル・ノア・ハラリ. サピエンス全史(下) 文明の構造と人類の幸福
人類の飛躍的進化は数学的ツールによって成し得た
None
数学人材を目指すしかない
PHPer として数学的ツールを活用したい
数学をプログラミングに落とし込む際の困難 数学的概念の理解 特異値や数値誤差の考慮 名前空間やクラスの整理
MathPHP markrogoyski/math-php - GitHub; https://github.com/markrogoyski/math-php
MathPHP を使ってできること 代数学、算術演算、多項式、複利計算、配列の演算、ガンマ関数、ベータ関数、誤差 関数、超幾何関数、符号関数、ロジスティック関数、シグモイド関数、エントロピ ー、行列、ベクトル、任意長の整数、複素数、四元数、有理数、内挿、数値微分、数 値積分、ニュートン法、割線法、二分法、不動点反復法、順列、組合せ、カタラン 数、正規分布、t分布、F分布、カイ二乗分布、ベータ分布、ガンマ分布、コーシー分 布、一様分布、ベルヌーイ分布、二項分布、ポワソン分布、幾何分布、超幾何分布、 多変量分布、分布表、サンプル生成、数列、集合、 ANOVA
、相関係数、分散、標準偏 差、パーセンタイル、ユークリッド距離、マハラノビス距離、コサイン類似度、累積 度数、累積相対度数、効果量、回帰分析、仮説検定...
使い方も簡単 - 行列の場合 use MathPHP\LinearAlgebra\Matrix; use MathPHP\LinearAlgebra\MatrixFactory; // 1. Matrix
クラスのインスタンスを生成 $matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]; $A = MatrixFactory::create($matrix); // 2. 行いたい操作に対応するメソッドを呼び出し $Aᵀ = $A->transpose(); // 転置行列 $D = $A->diagonal(); // 対角行列 $A⁻¹ = $A->inverse(); // 逆行列
例. 任意長の整数 use MathPHP\Number\ArbitraryInteger; // 任意長の巨大な整数を作成 $bigInt = new ArbitraryInteger('876937869482938749389832');
$extremelyBigInt = $bigInt->pow(2); $string = (string) $extremelyBigInt; // "769020026933275716728118484358230957952304988224"
例. パーセンタイル use MathPHP\Statistics\Descriptive; $numbers = [13, 18, 13, 14,
13, 16, 14, 21, 13]; // Percentiles $twentieth_percentile = Descriptive::percentile($numbers, 20); // 13.0 $ninety_fifth_percentile = Descriptive::percentile($numbers, 95); // 19.8
例. 相関係数 r = = s s
x y s xy (x − ) i ∑ n i x ˉ 2 (y − ) i ∑ n i y ˉ 2 (x − )(y − ) i ∑ n i x ˉ i y ˉ use MathPHP\Statistics\Correlation; $X = [1, 2, 3, 4, 5]; $Y = [2, 3, 4, 4, 6]; $r = Correlation::r($X, $Y); // 0.95940322360025
まとめ 数学人材は人類の進化にとって重要(茶番) MathPHP を使って数学をプログラミングすると捗る
Thank you!