diff --git a/hw1/YushengZhao/p9_16.jl b/hw1/YushengZhao/p9_16.jl new file mode 100644 index 0000000..3ae65e0 --- /dev/null +++ b/hw1/YushengZhao/p9_16.jl @@ -0,0 +1,2 @@ +# min(b') s.t A' x' + b' = b x'>= 0 and b' >= 0 +# trivial solution is x' = 0 and b' = b \ No newline at end of file diff --git a/hw1/YushengZhao/p9_6.jl b/hw1/YushengZhao/p9_6.jl new file mode 100644 index 0000000..e27c33f --- /dev/null +++ b/hw1/YushengZhao/p9_6.jl @@ -0,0 +1,2 @@ +# standard DP problem +# needs $log(v_max)$ bits to describe $v_max$. Exponential time \ No newline at end of file diff --git a/hw1/YushengZhao/p9_7.jl b/hw1/YushengZhao/p9_7.jl new file mode 100644 index 0000000..c5586b4 --- /dev/null +++ b/hw1/YushengZhao/p9_7.jl @@ -0,0 +1,7 @@ +# floor division of K rounds some weights to 0, such weights maybe added in correctly to solution +# very roughly +# ϵ ∝ Σ_i floor(v_i / K) +# ϵ ∝ floor(v_i / K) * l +# K ∝ l/ϵ +# but also need to supress v_max to be small, let +# K = v_max * l / ϵ diff --git a/hw2/YushengZhao/9_26.jl b/hw2/YushengZhao/9_26.jl new file mode 100644 index 0000000..c04969a --- /dev/null +++ b/hw2/YushengZhao/9_26.jl @@ -0,0 +1,7 @@ +# according to hint, when formula is satisfied, we have 1/2 - y_0/3 <= y_i <= 1/2 +y_0 +# and to minimize f(x) need to maximize (y_i-1/2)^2, which is y_i at its upper bound and gives (y_i - 1/2)^2 = y_0^2, that gives lower bound of f(x) = -1/2y_0^2 +# on the other hand if the formula is not satisfied, the bound of at least one y_i is 1/2 - y_0/3 <= y_i <= 1/2 +y_0, and the min f(x) is num unsat * y_0^2 - y_0^2/9 + sum_(sat clause) (y_0^2 - y_0^2) - y_0^2/2 + num_unsat * y_0^ / 2*n*9 which is at least 7/18 y_0^2 + +# using hint, if formula is satisfied, y^* cannot be local minimum because can slide over y_0 axis a little bit, epsilon, and get lower. this is in the neighborhood of y^* because y_i' 's difference from y_i = 1/2 is bounded by the epsilon. And f(x)'s min is -y_0^2/2 when formula is satisfied. This min is smaller than f(y^*) = 0. + +# so x_i means is y_i >= 1/2 - y_0/3 ? \ No newline at end of file diff --git a/hw2/YushengZhao/9_27.jl b/hw2/YushengZhao/9_27.jl new file mode 100644 index 0000000..6cc5af7 --- /dev/null +++ b/hw2/YushengZhao/9_27.jl @@ -0,0 +1 @@ +# x0 + sum ki vi where Avi = 0 and Ax0 = b , use https://en.wikipedia.org/wiki/Smith_normal_form to solve \ No newline at end of file