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
230
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.4k
PHPer のための Vim 実践入門 - PHP Conference 2020
hamakou108
0
770
Other Decks in Programming
See All in Programming
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
Design Foundational Data Engineering Observability
sucitw
3
200
Laravel Boost 超入門
fire_arlo
3
220
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
770
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
450
testingを眺める
matumoto
1
140
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
310
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
120
旅行プランAIエージェント開発の裏側
ippo012
2
910
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
460
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.5k
Featured
See All Featured
Faster Mobile Websites
deanohume
309
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
113
20k
Automating Front-end Workflow
addyosmani
1370
200k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Documentation Writing (for coders)
carmenintech
74
5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
The Art of Programming - Codeland 2020
erikaheidi
56
13k
Site-Speed That Sticks
csswizardry
10
820
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Practical Orchestrator
shlominoach
190
11k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Language of Interfaces
destraynor
161
25k
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!