Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Relation to square roots times a constant greater than 1"
- (*start*)
- a = 1/10;(*"a" is a fraction of the form 1/positiveInteger*)
- b = 0;
- nn = 64;
- TableForm[
- L2 = Table[
- LinearProgramming[
- Table[1/n, {n, 1, k}], {Table[If[n == 1, k, 1], {n, 1, k}]}, {{1,
- 0}}, Table[
- If[n == 1, {-1, 1}, {-a*(n - 1), b*(n - 1)}], {n, 1, k}]], {k,
- 1, nn}]];
- t1 = Table[Sum[If[L2[[n, k]] <= -1, 1, 0], {k, 2, n}], {n, 2, nn}]
- t2 = Table[
- Round[-(a^(-1) - 1) + Sqrt[2/a*(n - 1 - (1 - a))]], {n, 2, nn}]
- Show[ListLinePlot[t1],
- ListLinePlot[t2]]
- (*end*)
- "Relation to square roots times a constant a = 1 upperbound + 1"
- (*start*)
- a = 1/1;(*"a" is a fraction of the form 1/positiveInteger*)
- b = 0;
- c = 1;
- nn = 20;
- TableForm[
- L2 = Table[
- LinearProgramming[
- Table[1/n, {n, 1, k}], {Table[If[n == 1, k, 1], {n, 1, k}]}, {{1,
- 0}}, Table[
- If[n == 1, {-1, 1}, {-a*(n - 1), 1 + b*(n - 1)}], {n, 1,
- k}]], {k, 1, nn}]];
- t1 = Table[Sum[If[L2[[n, k]] <= -1, 1, 0], {k, 2, n}], {n, 2, nn}]
- t2 = Table[
- Round[-(a^(-1) - 1) - 1 +
- Sqrt[-1/1 + 2*2/a*((n - 1 + 1) - 1 - (1 - a))]], {n, 2, nn}]
- Show[ListLinePlot[t1], ListLinePlot[t2]]
- Clear[a, n]
- Expand[-(a^(-1) - 1) - 1 +
- Sqrt[-1/1 + 2*2/a*((n - 1 + 1) - 1 - (1 - a))]]
- (*end*)
- "Relation to square roots times a constant a = 2 upperbound + 2"
- (*start*)
- a = 2/1;(*"a" is a fraction of the form 1/positiveInteger*)b = 0;
- nn = 20;
- TableForm[
- L2 = Table[
- LinearProgramming[
- Table[1/n, {n, 1, k}], {Table[If[n == 1, k, 1], {n, 1, k}]}, {{1,
- 0}},
- Table[If[n == 1, {-1, 1}, {-a*(n - 1), 2 + b*(n - 1)}], {n, 1,
- k}]], {k, 1, nn}]];
- t1 = Table[Sum[If[L2[[n, k]] <= -1, 1, 0], {k, 2, n}], {n, 2, nn}]
- t2 = Table[
- Round[-(a^(-1) - 1) - 1 - 1/2 +
- Sqrt[-1/2 + 3*2/a*((n - 1) - 1 - (1 - a))]], {n, 2, nn}]
- Show[ListLinePlot[t1], ListLinePlot[t2]]
- Clear[a, n]
- Expand[-(a^(-1) - 1) - 1 - 1/2 +
- Sqrt[-1/2 + 3*2/a*((n - 1) - 1 - (1 - a))]]
- (*end*)
- "Relation to square roots times a constant a = 3 upperbound + 3"
- (*start*)
- a = 3/1;(*"a" is a fraction of the form 1/positiveInteger*)b = 0;
- c = 3;
- nn = 80;
- TableForm[
- L2 = Table[
- LinearProgramming[
- Table[1/n, {n, 1, k}], {Table[If[n == 1, k, 1], {n, 1, k}]}, {{1,
- 0}}, Table[
- If[n == 1, {-1, 1}, {-a*(n - 1), c + b*(n - 1)}], {n, 1,
- k}]], {k, 1, nn}]];
- t1 = Table[Sum[If[L2[[n, k]] <= -1, 1, 0], {k, 2, n}], {n, 2, nn}]
- t2 = Table[
- Round[-(1/a - 1) - (-1 + c - 1/c) +
- Sqrt[-1/c + (c + 1)*2/a*((n - 1 - 1) - 1 - (1 - a))]], {n, 2, nn}]
- Show[ListLinePlot[t1, PlotStyle -> Red], ListLinePlot[t2]]
- Clear[a, n];
- Expand[-(1/a - 1) - (-1 + c - 1/c) +
- Sqrt[-1/c + (c + 1)*2/a*((n - 1 - 1) - 1 - (1 - a))]]
- (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement