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週間前イベント 〜 帰ってきたPHP勉強会@東京
Search
hamakou108
September 25, 2021
Programming
0
140
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.2k
Laravel のメール認証の内部実装を掘り下げる - PHPerKaigi 2021
hamakou108
4
1.9k
PHPer のための Vim 実践入門 - PHP Conference 2020
hamakou108
0
610
Other Decks in Programming
See All in Programming
Micro Frontends for Java Microservices - Utah JUG 2024
mraible
PRO
1
110
Milestoner
bkuhlmann
1
420
AmperとFleetを使ったAndroidアプリ
yoppie
0
260
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
680
Sheets API使ってみた
toshi0383
2
170
パフォーマンスを求めてDBに機能を寄せる戦略
aoyagikouhei
0
110
雑に思考を整理する技術と効能
konifar
64
30k
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
1k
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
160
SIMD Parallel Programming with the Vector API
josepaumard
0
240
GitHub Copilotのススメ
marcy731
1
230
Python3.12のWhat's New から f-string の変更だけ読んでみた
2323code
0
100
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
165
13k
Facilitating Awesome Meetings
lara
43
5.6k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Side Projects
sachag
451
41k
[RailsConf 2023] Rails as a piece of cake
palkan
28
4k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
Practical Orchestrator
shlominoach
183
9.7k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
How GitHub (no longer) Works
holman
305
140k
Typedesign – Prime Four
hannesfritz
36
2.1k
The Mythical Team-Month
searls
217
42k
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!