2021-07-26

SMALE预备役魔鬼训练营 Day1

一、上午

1. 描 述 你 在 学 习 、 使 用 数 学 表 达 式 时 的 困 难 , 可 举 例 说 明 . 1.描述你在学习、使用数学表达式时的困难, 可举例说明. 1.使,.
表达式当中的[ ]优先级是否比( )优先级高

二、下午

1. 令 A = { 3 , 5 } 写 出 2 A 1. 令\mathbf {A} = \{ 3 , 5 \} 写出2^ {\mathbf{A}} 1.A={3,5}2A
2 A = { ∅ , { 3 } , { 5 } , { 3 , 5 } } 2^ {\mathbf{A}}=\{ \emptyset,\{3\},\{5\},\{3,5\}\} 2A={,{3},{5},{3,5}}

2. 展 开 2 ∅ 2.展开2^{\emptyset} 2.2
2 ∅ = { ∅ } 2^{\emptyset}=\{\emptyset\} 2={}

3. 令 A = { 5 , 6 , 7 , 8 , 9 } , 写 出 A 的 其 他 两 种 表 示 法 3.令\mathbf{A}=\{5,6,7,8,9\},写出\mathbf{A}的其他两种表示法 3.A={5,6,7,8,9},A
A = [ 5..9 ] = { 5 , … , 9 } \mathbf{A}=[5..9]=\{5,\dots,9\} A=[5..9]={5,,9}

4. 使 用  markdown 模 式 写 CSDN 贴 子 , 根 据 提 供 的 源 码 将 相 应 表 达 式 写 出 来 . 4.使用\textrm{ markdown} 模式写 \textrm{CSDN} 贴子, 根据提供的源码将相应表达式写出来. 4.使 markdownCSDN,.
A = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } \mathbf{A}=\{0,1,2,3,4,5,6,7,8,9\} A={0,1,2,3,4,5,6,7,8,9}
N = { 0 , 1 , 2 , …   } \mathbf{N}=\{0,1,2,\dots\} N={0,1,2,}
Ω = { a , b , … , z } \mathbf\Omega=\{\textrm{a},\textrm{b},\dots,\textrm{z}\} Ω={a,b,,z}
X = { x i } i = 1 n = { x 1 , x 2 , … , x n } \mathbf{X}=\{x_{i}\}_{i=1}^n=\{x_1,x_2,\dots,x_n\} X={xi}i=1n={x1,x2,,xn}
O = { x ∣ x ∈ N , x mod 2 = 1 } = { x ∈ N ∣ x mod 2 = 1 } \mathbf{O}=\{x \vert x \in \mathbf{N},x \textrm{mod} 2=1\}=\{x\in \mathbf{N} \vert x\textrm{mod}2 =1\} O={xxN,xmod2=1}={xNxmod2=1}
⋃ i = 1 n X i \bigcup_{i=1}^n \mathbf{X}_i i=1nXi
∑ i = 1 n i = 1 + 2 + ⋯ + n = n ( n + 1 ) 2 \sum_{i=1}^n i=1+2+\dots+n=\frac{n(n+1)}{2} i=1ni=1+2++n=2n(n+1)
⋂ i = 1 n = X i \bigcap_{i=1}^n=\mathbf{X}_i i=1n=Xi
X ∖ Y \mathbf{X}\setminus\mathbf{Y} XY
X ‾ = U ∖ X \overline \mathbf{X} = \mathbf{U} \setminus \mathbf{X} X=UX
∣ 2 A ∣ = 2 ∣ A ∣ = 2 3 = 8 \vert 2^\mathbf{A} \vert =2^{\vert \mathbf{A} \vert}=2^3=8 2A=2A=23=8
A × B = { ( a , b ) ∣ a ∈ A , b ∈ B } \mathbf{A} \times \mathbf{B}=\{(a,b) \vert a \in \mathbf{A} ,b\in \mathbf{B}\} A×B={(a,b)aA,bB}
( a , b ) ≠ ( b , a ) (a,b)\ne(b,a) (a,b)=(b,a)
A × B ≠ B × A \mathbf{A} \times \mathbf{B} \ne \mathbf{B} \times \mathbf{A} A×B=B×A

三、晚上

1. 自 己 出 数 据 , 做 一 个 3 × 2 与 2 × 4 的 矩 阵 乘 法 . 1.自己出数据, 做一个3\times 2 与 2 \times 4的矩阵乘法. 1.,3×22×4.

package basic;
import java.util.Arrays;

/**
 * This is the eighth code. Names and comments should follow my style strictly.
 *
 * @author Liu Botao.
 */
public class MatrixMultiplication {
    /**
     *********************
     * The entrance of the program.
     *
     * @param args Not used now.
     *********************
     */
    public static void main(String args[]) {
        matrixMultiplicationTest();
    }// Of main

    /**
     *********************
     * Matrix multiplication. The columns of the first matrix should be equal to the
     * rows of the second one.
     *
     * @param paraFirstMatrix  The first matrix.
     * @param paraSecondMatrix The second matrix.
     * @return The result matrix.
     *********************
     */
    public static int[][] multiplication(int[][] paraFirstMatrix, int[][] paraSecondMatrix) {
        int m = paraFirstMatrix.length;
        int n = paraFirstMatrix[0].length;
        int p = paraSecondMatrix[0].length;

        // Step 1. Dimension check.
        if (paraSecondMatrix.length != n) {
            System.out.println("The two matrices cannot be multiplied.");
            return null;
        } // Of if

        // Step 2. The loop.
        int[][] resultMatrix = new int[m][p];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < p; j++) {
                for (int k = 0; k < n; k++) {
                    resultMatrix[i][j] += paraFirstMatrix[i][k] * paraSecondMatrix[k][j];
                } // Of for k
            } // Of for j
        } // Of for i

        return resultMatrix;
    }// Of multiplication

    /**
     *********************
     * Unit test for respective method.
     *********************
     */
    public static void matrixMultiplicationTest() {
        int[][] tempFirstMatrix ={{3,2},{2,3},{1,1}};
        System.out.println("The first matrix is: \r\n" + Arrays.deepToString(tempFirstMatrix));

        int[][] tempSecondMatrix ={{1,2,3,4},{2,4,5,3}};
        System.out.println("The second matrix is: \r\n" + Arrays.deepToString(tempSecondMatrix));

        int[][] tempThirdMatrix = multiplication(tempFirstMatrix, tempSecondMatrix);
        System.out.println("The third matrix is: \r\n" + Arrays.deepToString(tempThirdMatrix));

    }// Of matrixMultiplicationTest

}// Of class MatrixMultiplication

运行结果

The first matrix is: 
[[3, 2], [2, 3], [1, 1]]
The second matrix is: 
[[1, 2, 3, 4], [2, 4, 5, 3]]
The third matrix is: 
[[7, 14, 19, 18], [8, 16, 21, 17], [3, 6, 8, 7]]

Process finished with exit code 0`

2.查找文献中的表达式错误
暂时看不懂,找不出来问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值