
==About me==
Professor
Department of Computer Science and Information Engineering
Ming Chuan University
5 De Ming Rd., Gui Shan, Taoyuan 333, Taiwan
:email: sjshyu@mail.mcu.edu.tw, sjshyu@gmail.com
Permutations/Combinations of size $r$ from $n$ distinct objects
Order Relevant
Repetition
Number of Distributions
Interpretation
yes
no
$P(n, r)$
# Arrangements with repetition of size $r$ from $n$ distinct objects
sjshyu changed 5 months agoView mode Like Bookmark
An $L_1$-block is a fundamental block structure composed of three 1×1 tiles arranged in an 'L' shape. There are four possible orientations for an $L_1$-block, each corresponding to a different rotation of the 'L' shape as shown in Fig. 1.
$$\text{Fig. 1 Four types of } L_1\text{-blocks}$$
In fact, we can describe an $L_1$-block as a $2\times 2$ square containing three tiles and one empty cell. Let $L_1(x,y)$ denote the $L_1$-block with its empty cell positioned at $(x, y)$ for $0\le x,\ y\le 1$. Specifically, the above four $L_1$-blocks are designated as $L_1(0,0)$, $L_1(0,1)$, $L_1(1,0)$ and $L_1(1,1)$, respectively.
We define an $L_n$-block as a $2^n\times 2^n$ square composed of $2^n\times 2^n-1$ tiles and a single empty cell, which can be specifically denoted as $L_n(x,y)$ with its empty cell positioned at $(x, y)$ for $0\le x,\ y\le 2^n-1$. Then, the following theorem holds.
:::info
sjshyu changed 9 months agoView mode Like Bookmark
Building Generating Functions
In some circustances, we utilize a function to encode an infinite sequence. Specifically, we look at a function whose power series “displays” the terms of the sequence. For example, we would look at the power series $1+x+2x^2+3x^3+5x^4+8x^5+\cdots$
which displays the sequence $1, 1, 2, 3, 5, 8, \cdots$ as coefficients.
Since an infinite power series is simply an infinite sum of terms of the form $c_nx^n$ where $c_n$ is some constant, we might write a power series as:
$\qquad\qquad\qquad\sum_{k=0}^{\infty}c_kx^k$,
or expand it as
$\qquad\qquad\qquad c_0+c_1x+c_2x^2+c_3x^3+c_4x^4+\cdots$.
In the context of generating functions, we call such a power series a $generating\ series$. The generating series generates the sequence
$\qquad\qquad\qquad c_0,\ c_1x,\ c_2x^2,\ c_3x^3,\ c_4x^4,\ \cdots$ .
In other words, the sequence generated by a generating series is simply the sequence of coefficients of the infinite polynomial.
sjshyu changed 10 months agoView mode Like Bookmark
for i1 = 1 to n do
for i2 = 1 to min(i1,n-1) do
for i3 = 1 to min(i2,n-2) do
...
for in_1 = 1 to min(in-2,2) do
for in = 1 to 1 do
print i1,i2,i3,...,in
Show that print statement is executed $C_n$ times,where $C_n$ denotes the $n$th Catalan number.
:::info
sjshyu changed 10 months agoView mode Like Bookmark
:::info
$Visual\ cryptography$ was first introduced by Naor and Shamir at Eurocrypt’94.
 $\quad$ 
Moni Naor $\qquad\qquad$ Adi Shamir

:::
sjshyu changed 10 months agoBook mode Like 1 Bookmark
Test_0510
1. Ex. 9.1
Mildred buys 12 oranges for her children, Grace, Mary, and Frank. In how many ways can she distribute the oranges so that Grace gets at least four, and Mary and Frank get at least two, but Frank gets no more than five?
image
2. Combinations with repetition of 3 distinct objects
In how many ways can we select distinct objects $a, b, c$ such that at most $3, 2, 1$ times, respectively?
純粹看電影
只有感動
The Godfather (1972)
:::spoiler 謝謝教父讓我認識電影的魔力;大一的某個週六在中正堂見識到了...
"The Godfather" is a 1972 American crime film D: Francis Ford Coppola, based on the novel of the same name by Mario Puzo.
A: Marlon Brando, Al Pacino,
Academy Award for Best Picture and Best Adapted Screenplay for Mario Puzo and Francis Ford Coppola.
"The Godfather Part II" (1974)
sjshyu changed a year agoView mode Like 1 Bookmark
Given a number $x$, $clz(x)$ returns the number of leading zeros in the binary representation of $x$. Below show some examples where the word size storing $x$ is 8:
Table 1. Examples of $x$ and $clz(x)$ of word-size 8
$x$
$(x)_2$
$clz(x)$
2
00000010
第一章 基本概念
1. 寫一個程序,將傳入的整數參數 x、y 和 z 由小到大印出。此程序的計算時間為多少?
:::spoiler 可利用 bubble sort 的概念:
# include <stdio.h>
# include <iostream>
using namespace std;
void print_nondecreasingly(int x, int y, int z)
{ int t;
Yung 0736 changed 3 years agoView mode Like 2 Bookmark