=== 設問12 $ \displaystyle {\int_2^1{(3{x}^2+{x}-5)}dx + \int_3^2{(3{x}^2+{x}-5)}dx }$の値を求めなさい ===
まぁ、積分の定義を考えたら当然だけど、以下の法則が成り立つ\\
${\displaystyle {\int_a^b{ f(x) }dx} + {\int_b^c{ f(x) }dx} = {\int_a^c{ f(x) }dx}} $
よって、\\
$ {\displaystyle \int_1^2{(3{x}^2+{x}-5)}dx + \int_2^3{(3{x}^2+{x}-5)}dx = \int_1^3{(3{x}^2+{x}-5)}dx }$が成り立つ\\
\\
したがって、\\
$
\begin{equation}
\begin{array}
\displaystyle \int_1^3{(3{x}^2+{x}-5)}dx &= \left[ {x}^3+ \dfrac{1}{2}{x}^{2} - 5{x} \right]_1^3 \\
&= \left[ {3}^3+ \dfrac{1}{2}{3}^{2} - 5 \cdot {3} \right] - \left[ {1}^3+ \dfrac{1}{2}{1}^{2} - 5 \cdot {1} \right] \\
&= (27 + \dfrac{9}{2} - 15) - (1 + \dfrac{1}{2} -5) \\
&= (27-15-1+5 + \dfrac{9}{2} - \dfrac{1}{2}) \\
&= (27-15-1+5 + \dfrac{9}{2} - \dfrac{1}{2}) = (16 + 4) = 20\\
\end{array}
\end{equation}
$
\\
----
=== 設問13 下記の行列を計算してください ===
{{:game-engineer:classes:2022:game-programing-2:first-term:8:gyouretu.png?nolink&400|}}
----
=== 設問14 $37800$ を素因数分解してください ===
\\
素因数分解とは、数を素数の積で表すことです。\\
例:$120 = 2^3 \cdot 3 \cdot 5 $
素数の積で表すので、\\
[ 2・3・5・7・11・13・17・19・23・29・31・37・41・43・47・53・59・61・67・71・73・79・83・89・97 ]\\
が、素数であることぐらいは常識的に覚えておきましょう!\\
さて、問題の$37800$を素因数分解すると。\\
$37800 = 378 \times {100}$ \\
$100 = 10 \times {10} = 10^{2} = {5 \times 2}^2 = 5^2 \cdot 2^2$ \\
$378 = 189 \times 2 = 63 \times 3 \times 2 = 21 \times 3 \times 3 \times 2$ \\
$ = 7 \times 3 \times 3 \times 3 \times 2 = 7 \cdot 3^3 \cdot 2$ \\
$378 \times 100 = 7 \cdot 3^3 \cdot 2 \times 5^2 \cdot 2^2$ \\
$ = 7 \cdot 5^2 \cdot 3^3 \cdot 2^3 $
----
=== 設問15 ===
[[https://replit.com/@youetsusato/Su-Shu-kaYue-Shu?v=1]]
#include
// isPriMe
//引数で渡された整数を素数かそうではないかで結果を返す
//引数 int n : 素数かどうか判別する整数
//戻り値 int : nが素数の時 ⇒ -1
// nが素数以外 ⇒ nの最大の約数
int isPriMe(int n);
using std::cout;
using std::cin;
using std::endl;
int main() {
int number;
cout << "整数を入力:";
cin >> number;
cout << isPriMe(number) << endl;
}
int isPriMe(int n) {
if (n == 1) {
return 1;
} else {
for (int i = n; i > 1; i--) {
if (n % i == 0 && i != n)
{
//約数を考えるとき自分自身の事を自明な約数と言う
//この場合は素数ではないときは自分自身を返す
//return n;
//自分自身を含めない場合の約数を真の約数と言う
//その時は自分自身を抜いた約数のうち最大を返す
return i;
}
}
return -1;
}
}
----
=== 設問16 ===
2つの実数 $a, b(a > 0, b > 0)$ に対して「相加平均≧相乗平均」であることの証
明してください。また、イコールが成り立つ時の条件を書いてください
$
\begin{equation}
\begin{array}{l}
相加平均: \dfrac{a+b}{2}\\
相乗平均: \sqrt{{a} \cdot {b}}\\
で表される。これらに対して\\
\dfrac{a+b}{2} \geqq \sqrt{{a} \cdot {b}}
であることが知られている。\\
\end{array}
\end{equation}
$
\\
これを証明する。\\
$
\begin{equation}
\begin{array}{l}
\dfrac{a+b}{2} \geqq \sqrt{{a} \cdot {b}}\\
少し変形します\\
{a+b} \geqq {2} \sqrt{{a} \cdot {b}}\\
両辺2乗して\\
{(a+b)}^2 \geqq { ({2}\sqrt{{a} \cdot {b}})}^2\\
{(a+b)}^2 - { ({2}\sqrt{{a} \cdot {b}})}^2 &= a^2 + 2a \cdot b + b^2 - 4a \cdot b\\
&= a^2 -2a \cdot b + b^2\\
&= {(a - b)}^2\\
{実数(整数を含む)の2乗は必ず \geqq 0} となるので、\\
&= {(a - b)}^2 \geqq 0 \cdots 証明終わり\\
\end{array}
\end{equation}
$
\\
等号が成り立つのは,\\
${(a - b)}^2 = 0$\\
すなわち、$a = b$ の時である\\
----
=== 設問17 ===
水100gに食塩を20g入れてかき混ぜました。この食塩水の濃度はいくらになりますか?
{{:game-engineer:classes:2022:game-programing-2:first-term:8:noudo.png?nolink&400|}}
濃度の考え方
問題を見ると、%で答えなさいと言われていることがわかる。\\
日本語をよく読むと、水と食塩を混ぜた120gの液体があります。その中に食塩が20g含まれています。\\
と読めます。\\
$ \dfrac{食塩}{水+食塩} \times {100} = \dfrac{20}{100 + 20} \times {100} $
あとは自分で計算してみてね。\\
また、今回は関係ないけど、こういう問題に出くわしたら、必ず__単位と有効数字__に気を付けよう!\\
[[https://lunasa.net/post-1034|【参考】有効数字]]
----
[[game-engineer:classes:2022:game-programing-2:first-term:8:8-02-5|メニューに戻る]]