SlideShare a Scribd company logo
1 of 14
オイラーの公式で感じる
次元の呪い
- R を使って -
#2 「はじめてのパターン認識」読書会 LT3
02.JUL.2013
株式会社リクルートキャリア
グラントウキョウサウスタワー
@ manozo
前回 私を悩ませたグラフ
「はじめてのパターン認識」 p6
これは一体なんだ? 私には理解不能!
100 次元の超立方体は、毬栗やウニのようなトゲトゲしたような形をしている。
描いてみようと
ジーと眺めるも
描けない
オイラーの公式
今日の主役
eiφ
=cosφ+isinφ
eiπ
+1=0 (φ=π の時 )
私の妄想にお付き合い下さい。
虚数 i とくれば複素数
http://www.th.phys.titech.ac.jp/~muto/
物理数学第一
平成18年度 学部 3学期
■ 第1章  複素数
http://www.th.phys.titech.ac.jp/~muto/lecture
...
eiφ
= cosφ+isninφ
Eular の公式を用いると,複素数 z は
z = r(cos φ + i sin φ) = reiφ
と書くことができる。
....
複素数の表現 z = reiφ
において φ が 0 から 2π ま
で変化すれば、 z を表す点は半径 r の円周上
を一周する。
第1章 複素数 p3これを使ってできるかも!
#1 の復習
• 超立方体( p.5 )
– d 次元単位超立方体の中心から頂点までの距離
1/2*sqrt(d) → 半径 r
– d 次元超立方体の頂点の数
2d
→ φ
円を分割?するのに使う
d: 次元
Rで書いてみる
たった 7 行
z <- c(0+0i, NA) # 中心( 0+0i )を付置(ベクトル)
for(d in 1:16){ # とりあえず 16(4*4) 次元まで
phi <- seq(0, 2*pi, length=2^d+1) # φ
for(i in phi)
z <- c(z, sqrt(d)/2*exp(1)^(1i*i))
z<-c(z, NA) # 区切る
}
z=r ・ eiφ
中心からの頂点までの距離 (r) sqrt(d)/2
頂点の数 2d
0 2π
頂点の数 +1
e 虚数 i×phi
plot する
plot(z, type="b", pch=".")
実際はこんな感じ。レイヤーを重ねる感じ。
> par(pty = "s") # プロット領域を正方形にする
> plot(z, type="b", pch=".")
> grid() # グリッド
> points(z, type="b", pch=".") # グリッドを上書き
> points(0+0i, pch=20) # 0+0i だけをプロット
想像できましたね!
中心
点々が
頂点
複素平面に plot
3次元
頂点が8個
3次元の場合
• これをベシャッ
と2次元につぶ
した感じ。
• 頂点は8個
まとめ
• オイラーの公式で偏角φ と中心からの距離r
– z = r ・ eiφ
= r(cosφ + i ・ sinφ)
• 複素数はRで普通に plot できる
– exp. plot(0+0i) # 複素平面に plot される
• seq(0, 2*pi, length = ...)
– 0 から2π をlength で等間隔に分割(頂点)
• 100 次元までチャレンジしてください
– 「次元の呪い」が体感できます。
– 但し頂点は1267650600228229401496703205376 個
100 次元超立方体は3次元空間では
ツルツルじゃないのかなぁ~?
   さてアンブレラは何次元?
   (傘の骨は普通は8本)
Rのおまけ
library(rgl) # rgl ライブラリを使って 3D
plot3d(Re(z), Im(z), Mod(z))
d <- 1:100
plot3d(2*d, sqrt(d)/2, 2^d)
面 距離 頂点
x y r (絶対値)
Rのおまけ2
• log を取って気分だけでも
どうせなら 1000 次元まで
z <- 0+0i
for(d in 1:1000){
phi <- seq(0, 2*pi, length=as.integer(log10(2^d))+1)
for(i in phi)
z <-c(z, sqrt(d)/2*exp(1)^(1i*i))
z <-c(z, NA)
}
library(rgl) # rgl ライブラリを使って 3D プロット
plot3d(Re(z), Im(z), Mod(z),type="l",col=rainbow(1000))
次のページに plot
こんな感じ
• マウスで動かせる
• マウスのクリクリ
で拡大縮小できる
• 参考 rgl ライブラリ
http://cse.naro.affrc.go.jp/t
      謝謝

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

オイラーの公式で感じる次元の呪い