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
200
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.4k
Laravel のメール認証の内部実装を掘り下げる - PHPerKaigi 2021
hamakou108
4
2.3k
PHPer のための Vim 実践入門 - PHP Conference 2020
hamakou108
0
740
Other Decks in Programming
See All in Programming
ミリしらMCP勉強会
watany
4
770
Exit 8 for SwiftUI
ojun9
0
130
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
2
290
[NG India] Event-Based State Management with NgRx SignalStore
markostanimirovic
1
160
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
110
大LLM時代にこの先生きのこるには-ITエンジニア編
fumiyakume
7
3k
Sharing features among Android applications: experience feedback
jbvincey
0
110
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
0
840
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.4k
「”誤った使い方をすることが困難”な設計」で良いコードの基礎を固めよう / phpcon-odawara-2025
taniguhey
0
160
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
1
2.3k
リストビュー画面UX改善の振り返り
splcywolf
0
140
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.2k
Bash Introduction
62gerente
611
210k
Into the Great Unknown - MozCon
thekraken
37
1.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
What's in a price? How to price your products and services
michaelherold
245
12k
Product Roadmaps are Hard
iamctodd
PRO
52
11k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Building Flexible Design Systems
yeseniaperezcruz
329
38k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
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!