関数とは入力に対して1つの出力があるということ
yはxの関数である
を表記すると
y=f(x)
英語で書くと
y equals function of x
例としてタクシーの料金
走行距離 => 料金
というもの
次は一次関数と二次関数
一次関数の例
チーズが1gあたり5円
箱代100円
これを y と x の関係にして数式で表現
チーズが x
金額が y
とする
y = 5 * x +100
= 5x +100
となる
この式により
100個売ると
5x + 100
の式から
600円
となる
これをグラフにすると
x=0だと y = 100
になり
xが増えた文だけ直線になっていく
この傾きは
xが1増えるとき
直線がいくつ増えるか
というのを勾配
という
ニューラルネットでいう勾配降下法
gradient descent
というので使う
x=0のときのyの値
これを切片という
今回の式を一般化すると
y = ax + b
となる
a が傾き
b を切片
ax の部分を項
という
項は1つずつの塊
つまり式の+とかで区切るときの塊をいう
このxの数が次数という
今回はxが1つだけなので
一次
となる
これが
y=ax2 + bx + c
なら
項が3つ
xが2つなので二次
となる
一番多い次数を数えて
一次、二次といっている
今回なら
二次関数で
二次の多項式
となっている
これらのグラフを描画するにあたり
GeoGebra を使うと便利
インストールできない場合
ブラウザ版もある
Reference:GeoGebra Installation
によれば
Ad Linux: the .deb and .rpm installers will automatically add the official GeoGebra repository to the package management system on the workstation. This will enable automatic update of GeoGebra every time a new version is released. If you want to include GeoGebra in your custom Linux distribution with GeoGebra included, the best way is to add the official GeoGebra repository (http://www.geogebra.net/linux/) to your package management system. The GPG key of the repository is at https://static.geogebra.org/linux/office@geogebra.org.gpg.key – the name of the package is geogebra-classic.
Installing GeoGebra directly from the command line: for Ubuntu, these two commands eliminate the need for downloading .deb files:
とあり
リポジトリを登録することで簡単インストールが可能
とあったが
リポジトリ登録のため
1 |
を実行したら
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apt/cache.py" , line 520, in update pulse_interval) SystemError: W:ターゲット Packages (contrib /binary-amd64/Packages ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Packages (contrib /binary-all/Packages ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Translations (contrib /i18n/Translation-ja_JP ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Translations (contrib /i18n/Translation-ja ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Translations (contrib /i18n/Translation-en ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット DEP-11 (contrib /dep11/Components-amd64 .yml) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット DEP-11-icons (contrib /dep11/icons-64x64 . tar ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:http: //download .ebz.epson.net /dsc/op/stable/debian/dists/lsb3 .2 /Release .gpg: 鍵 E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56 による署名は弱い digest アルゴリズム (SHA1) を使用しています, W:署名照合中にエラーが発生しました。リポジトリは更新されず、過去のインデックスファイルが使われます。GPG エラー: https: //dl .winehq.org /wine-builds/ubuntu xenial InRelease: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 76F1A20FF987672F, W:GPG エラー: http: //www .geogebra.net /linux stable InRelease: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY C072A32983A736CF, W:リポジトリ http: //www .geogebra.net /linux stable InRelease は署名されていません。, W:このようなリポジトリから取得したデータは認証できないので、データの使用は潜在的に危険です。, W:リポジトリの作成とユーザ設定の詳細は、apt-secure(8) man ページを参照してください。, E: /var/lib/apt/lists/partial/download .virtualbox.org_virtualbox_debian_dists_xenial_InRelease の状態を取得するのに失敗しました - pkgAcqTransactionItem::TransactionState-stat (2: そのようなファイルやディレクトリはありません), E: /var/lib/apt/lists/partial/download .virtualbox.org_virtualbox_debian_dists_xenial_contrib_binary-amd64_Packages の状態を取得するのに失敗しました - pkgAcqTransactionItem::TransactionState-stat (2: そのようなファイルやディレクトリはありません) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/apt-add-repository" , line 173, in <module> if not sp.add_source_from_shortcut(shortcut, options.enable_source): File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py" , line 782, in add_source_from_shortcut cache.update(sources_list=new_debsrc_entry. file ) File "/usr/lib/python3/dist-packages/apt/cache.py" , line 522, in update raise FetchFailedException(e) apt.cache.FetchFailedException: W:ターゲット Packages (contrib /binary-amd64/Packages ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Packages (contrib /binary-all/Packages ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Translations (contrib /i18n/Translation-ja_JP ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Translations (contrib /i18n/Translation-ja ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット Translations (contrib /i18n/Translation-en ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット DEP-11 (contrib /dep11/Components-amd64 .yml) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:ターゲット DEP-11-icons (contrib /dep11/icons-64x64 . tar ) は /etc/apt/sources .list:60 と /etc/apt/sources .list:62 で複数回設定されています, W:http: //download .ebz.epson.net /dsc/op/stable/debian/dists/lsb3 .2 /Release .gpg: 鍵 E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56 による署名は弱い digest アルゴリズム (SHA1) を使用しています, W:署名照合中にエラーが発生しました。リポジトリは更新されず、過去のインデックスファイルが使われます。GPG エラー: https: //dl .winehq.org /wine-builds/ubuntu xenial InRelease: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 76F1A20FF987672F, W:GPG エラー: http: //www .geogebra.net /linux stable InRelease: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY C072A32983A736CF, W:リポジトリ http: //www .geogebra.net /linux stable InRelease は署名されていません。, W:このようなリポジトリから取得したデータは認証できないので、データの使用は潜在的に危険です。, W:リポジトリの作成とユーザ設定の詳細は、apt-secure(8) man ページを参照してください。, E: /var/lib/apt/lists/partial/download .virtualbox.org_virtualbox_debian_dists_xenial_InRelease の状態を取得するのに失敗しました - pkgAcqTransactionItem::TransactionState-stat (2: そのようなファイルやディレクトリはありません), E: /var/lib/apt/lists/partial/download .virtualbox.org_virtualbox_debian_dists_xenial_contrib_binary-amd64_Packages の状態を取得するのに失敗しました - pkgAcqTransactionItem::TransactionState-stat (2: そのようなファイルやディレクトリはありません) |
となるため
Ubuntu Desktop 20.04にGeoGebraをインストールする
を参考にインストール
1 | sudo apt-get -y install libcanberra-gtk-module libgconf-2-4 gconf-service gconf2-common libcanberra-gtk0 gconf-service-backend |
で必要なライブラリをインストール
今回は ubuntu 16.04 へインストールするので
Linux (deb): 64 bit installers for .deb based systems (Mint ≥ 18, Debian ≥ 8, Ubuntu ≥ 14.10)
をダウンロード
1 | sudo dpkg -i geogebra-classic_6.0.666.0-202109211234_amd64.deb |
でインストール
geogebra を起動し
数式を入力
今回は
y = 5x + 100
として横の○アイコンをクリックすると
グラフの表示ON・OFFができる