![Page 1: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/1.jpg)
1 2 k...
21
n
2
...
Is there a search plan for the highest safe rung, with q tests in the worst case?
HSR(n, k, q)
0 (safe)
![Page 2: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/2.jpg)
Search Plan
x?x? noyes
Test node; do jars break
when thrown from rung x?
xx
Conclusion; x is the highest
safe rung
A search plan is a tree made up of two kinds of nods
![Page 3: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/3.jpg)
1 2 k...
2
n
2
...
Is q the worst case minimum number of tests to be performed by a search plan for the highest safe rung?
minHSR(n, k, q)
10 (safe)
![Page 4: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/4.jpg)
2
n
2
...
rungs 1,3,..., n must be sequentially (a.k.a. linearly) tested.
minHSR(n, 1, n)
10 (safe)
![Page 5: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/5.jpg)
Linear Search Plan3 rungs, 3 jars
1?1?
22 33
2?2?
3?3?
00 11
yesno
q = 3
![Page 6: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/6.jpg)
2
n
2
...
binary search is feasible.
minHSR(n, ⌈lg n⌉, lg n)
10 (safe)
![Page 7: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/7.jpg)
Binary Search Plan7 rungs, ⌈lg 7⌉ = 3
jars4?4?
66 77
6?6?
7?7?
44 55
5?5?
22 33
2?2?
3?3?
00 11
1?1?
q = 3yes no
![Page 8: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/8.jpg)
2
n
2
...
If 1<k<lg n,what is the search plan with the minimum number of tests?
1 2 k...
minHSR(n, k, q)
10 (safe)
![Page 9: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/9.jpg)
![Page 10: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/10.jpg)
1 2 K...
21 (safe)
N
2
...
What is the highest rung a jar can be
safely thrown from?
![Page 11: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/11.jpg)
21 (safe)
N
2
...
If K=1,rungs 2,3,..., N must be sequentially tested.
![Page 12: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/12.jpg)
21 (safe)
N
2
...
If K>lg N,binary search is feasible.
![Page 13: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/13.jpg)
21 (safe)
N
2
...
If1<K<lg N,what is the search plan with the minimum number of tests?
![Page 14: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/14.jpg)
Search Plan (a.k.a. Decision
Tree)
x?x? noyes
Test node; do jars break
when thrown from rung x?
xx
Conclusion; x is the highest
safe rung
A search plan is a tree made up of two kinds of nods
![Page 15: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/15.jpg)
Binary Search Plan8 rungs, lg 8 = 3
jars5?5?
77 88
7?7?
8?8?
55 66
6?6?
33 44
3?3?
4?4?
11 22
2?2?
Jar1 breaks
Jar 2 breaks
Jar 3 breaks
Depth = 3 tests
![Page 16: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/16.jpg)
![Page 17: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/17.jpg)
1 2 k...
21 (safe)
n
2
...
•HSR(n, k, q) = ∃ p ∈ SearchPlans: correct(p, n, k, q).
HSR(n, k, q)
![Page 18: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/18.jpg)
![Page 19: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/19.jpg)
What is the Formal Science Wikipedia
(FSW) and How to Use it and Contribute to it?
![Page 20: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/20.jpg)
Introduction to the Formal Science Wikipedia (FSW)
![Page 21: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/21.jpg)
Agenda
•What is FSW?
•How to use FSW?
•How to contribute to FSW?
![Page 22: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/22.jpg)
What is FSW?
![Page 23: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/23.jpg)
FSW Wikipedia
Lab(parameterized
logical statement)
Page(informal text)
Develop an Avatar Edit Pages
vs.
Code the lab Create a page
![Page 24: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/24.jpg)
How to use FSW?
![Page 25: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/25.jpg)
Investigation Cycle
![Page 26: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/26.jpg)
How to contribute to FSW?
(as a user)
![Page 27: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/27.jpg)
3 Toy Labs
Ineq(c ∈ [0,2], x ∈ [0,1], y ∈ [0,1]) := x + y > c
Given c ∈ [0,2], x ∈ [0,1] and y ∈ [0,1], does the inequality x+y > c hold?
AxEyIneq(c ∈ [0,2]) := ∀x ∈ [0,1]: EyIneq(c, x)
Given c ∈ [0,2], does every x ∈ [0,1] make EyIneq(c, x) hold?EyIneq(c ∈ [0,2], x ∈ [0,1]) := ∃y ∈ [0,1]: Ineq(c, x, y)
Given c ∈ [0,2] and x ∈ [0,1], is there y ∈ [0,1] that makes Ineq(c, x, y) hold?
![Page 28: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/28.jpg)
3 Toy LabsCompact Notation
AxEyIneq(c ∈ [0,2]) := ∀x ∈ [0,1]:EyIneq: ∃y ∈ [0,1]:Ineq: x + y > c
Given c ∈ [0,2], does every x ∈ [0,1] has a y ∈ [0,1]such that x+y>c .
![Page 29: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/29.jpg)
Developing Avatars
Implement an interface derived from the logical
statement.
![Page 30: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/30.jpg)
An Avatar for the “Toy” Lab
interface AxEyIneqAvatar {/** Given c ∈ [0,2] and x ∈ [0,1], which y ∈ [0,1] makes Ineq(c, x, y) hold? */double move (EyIneq dummy, double c, double x);
/** Given c ∈ [0,2], which x ∈ [0,1] makes EyIneq(c, x) NOT hold? */double move (AxEyIneq dummy, double c);
/** Given c ∈ [0,2], do all x ∈ [0,1] make EyIneq(c, x) hold? */Position position (AxEyIneq dummy, double c);}
![Page 31: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/31.jpg)
33
An Avatar for the “Toy” Lab
AxEyIneq(c ∈ [0,2]) := ∀x ∈ [0,1]:EyIneq: ∃y ∈ [0,1]:Ineq: x + y > c
/** Given c ∈ [0,2] and x ∈ [0,1], which y ∈ [0,1] makes Ineq(c, x, y) hold? */double move (EyIneq dummy, double c, double x){
return 1;}
EyIneq: ∃y ∈ [0,1]:Ineq: x + y > c
Best strategy: y as big as possible
![Page 32: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/32.jpg)
34
An Avatar for the “Toy” Lab
AxEyIneq(c ∈ [0,2]) := ∀x ∈ [0,1]:EyIneq: ∃y ∈ [0,1]:Ineq: x + y > c
/** Given c ∈ [0,2], which x ∈ [0,1] makes EyIneq(c, x) NOT hold? */double move (AxEyIneq dummy, double c){
return 0;}
∀x ∈ [0,1]:EyIneq
Best strategy: x as small as possible
![Page 33: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/33.jpg)
35
An Avatar for the “Toy” Lab
/** Given c ∈ [0,2], do all x ∈ [0,1] make EyIneq(c, x) hold? */Position position (AxEyIneq dummy, double c){return c<1?Position.VERIFIER:Position.FALSIFIER;}
AxEyIneq(c) is true for c ∈ [0,1) and false for c ∈ [1,2]
AxEyIneq(c ∈ [0,2]) := ∀x ∈ [0,1]:EyIneq: ∃y ∈ [0,1]:Ineq: x + y > c
∀x ∈ [0,1]:EyIneq
![Page 34: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/34.jpg)
How Are Avatars Used?
![Page 35: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/35.jpg)
37
![Page 36: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/36.jpg)
How to contribute to FSW?
(as a user)
![Page 37: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/37.jpg)
Coding Labs
Develop a set of nested Java classes
![Page 38: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/38.jpg)
Coding the “Toy” Lab
AxEyIneq(c) :=
public class AxEyIneq {@Param double c;
}
![Page 39: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/39.jpg)
Coding the “Toy” Lab
AxEyIneq(c) := ∀x
public class AxEyIneq implements IForall{@Param double c;double x;
}
![Page 40: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/40.jpg)
Coding the “Toy” Lab
AxEyIneq(c) := ∀x :EyIneq: ∃y
public class AxEyIneq implements IForall{@Param double c;double x;public class EyIneq implements IExists{
double y;
}}
![Page 41: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/41.jpg)
Coding the “Toy” Lab
AxEyIneq(c) := ∀x :EyIneq: ∃y : Ineq: x + y > c
public class AxEyIneq implements IForall{@Param double c;double x;public class EyIneq implements IExists{
double y;public class Ineq implements IPred{
public boolean execute() {return x+y>c;
}}
}}
![Page 42: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/42.jpg)
Coding the “Toy” Lab
AxEyIneq(c) := ∀x ∈ [0,1]:EyIneq: ∃y : Ineq: x + y > c
public class AxEyIneq implements IForall{@Param double c;double x;public boolean checkecProvidedValue() {
return 0<=x && x<=1;}
public class EyIneq implements IExists{double y;public class Ineq implements IPred{
public boolean execute() {return x+y>c;
}}
}}
∈ [0,1]
![Page 43: Is there a search plan for the highest safe rung, with q tests in the worst case?](https://reader035.vdocuments.us/reader035/viewer/2022070405/56814027550346895dab8733/html5/thumbnails/43.jpg)
Coding the “Toy” LabAxEyIneq(c ∈ [0,2]) := ∀x ∈ [0,1]:EyIneq: ∃y ∈
[0,1]:Ineq: x + y > cpublic class AxEyIneq implements IForall{@Param double c;double x;public class EyIneq implements IExists{
double y;public class Ineq implements IPred{
public boolean execute() {
return x+y>c;}
}public boolean
checkecProvidedValue() {return 0<=y && y<=1;
}}public boolean checkecProvidedValue() {
return 0<=x && x<=1;}public AxEyIneq(double c) {
if( c<0 || c>3 ){throw new
RuntimeException();}this.c = c;
}}
∈ [0,2]