From 61e81d411b097ad7d946c2bf770563c07c645bbb Mon Sep 17 00:00:00 2001 From: PaddyKe <34421580+PaddyKe@users.noreply.github.com> Date: Sat, 23 Oct 2021 13:58:42 +0200 Subject: [PATCH] fixed print statements --- .../approximate_counting/code/c++/approximate_counting.cpp | 6 +++--- contents/approximate_counting/code/c/approximate_counting.c | 6 +++--- .../approximate_counting/code/julia/approximate_counting.jl | 6 +++--- .../code/python/approximate_counting.py | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contents/approximate_counting/code/c++/approximate_counting.cpp b/contents/approximate_counting/code/c++/approximate_counting.cpp index 7f3f1a16c..53f4641af 100644 --- a/contents/approximate_counting/code/c++/approximate_counting.cpp +++ b/contents/approximate_counting/code/c++/approximate_counting.cpp @@ -61,11 +61,11 @@ auto test_approximate_count( int main() { std::cout << "Counting Tests, 100 trials\n"; - std::cout << "testing 1,000, a = 30, 1% error " + std::cout << "testing 1,000, a = 30, 10% error " << test_approximate_count(100, 1000, 30, 0.1) << "\n"; - std::cout << "testing 12,345, a = 10, 1% error " + std::cout << "testing 12,345, a = 10, 10% error " << test_approximate_count(100, 12345, 10, 0.1) << "\n"; // Note : with a lower a, we need more trials, so a higher % error here. - std::cout << "testing 222,222, a = 0.5, 10% error " + std::cout << "testing 222,222, a = 0.5, 20% error " << test_approximate_count(100, 222222, 0.5, 0.2) << "\n"; } diff --git a/contents/approximate_counting/code/c/approximate_counting.c b/contents/approximate_counting/code/c/approximate_counting.c index ded7a518e..da44334a7 100644 --- a/contents/approximate_counting/code/c/approximate_counting.c +++ b/contents/approximate_counting/code/c/approximate_counting.c @@ -71,11 +71,11 @@ int main() srand(time(NULL)); printf("Counting Tests, 100 trials\n"); - printf("testing 1000, a = 30, 1%% error\n"); + printf("testing 1000, a = 30, 10%% error\n"); test_approximation_count(100, 1000, 30, 0.1); - printf("testing 12345, a = 10, 1%% error\n"); + printf("testing 12345, a = 10, 10%% error\n"); test_approximation_count(100, 12345, 10, 0.1); - printf("testing 222222, a = 0.5, 10%% error\n"); + printf("testing 222222, a = 0.5, 20%% error\n"); test_approximation_count(100, 222222, 0.5, 0.2); return 0; diff --git a/contents/approximate_counting/code/julia/approximate_counting.jl b/contents/approximate_counting/code/julia/approximate_counting.jl index 36b07651e..c6cf3b223 100644 --- a/contents/approximate_counting/code/julia/approximate_counting.jl +++ b/contents/approximate_counting/code/julia/approximate_counting.jl @@ -51,11 +51,11 @@ function test_approximate_count(n_trials, n_items, a, threshold) end @testset "Counting Tests, 100 trials" begin - println("testing 1,000, a = 30, 1% error") + println("testing 1,000, a = 30, 10% error") test_approximate_count(100, 1000, 30, 0.1) - println("testing 12,345, a = 10, 1% error") + println("testing 12,345, a = 10, 10% error") test_approximate_count(100, 12345, 10, 0.1) # Note: with a lower a, we need more trials, so a higher % error here. - println("testing 222,222, a = 0.5, 10% error") + println("testing 222,222, a = 0.5, 20% error") test_approximate_count(100, 222222, 0.5, 0.2) end diff --git a/contents/approximate_counting/code/python/approximate_counting.py b/contents/approximate_counting/code/python/approximate_counting.py index eb31b2b24..0088debcc 100644 --- a/contents/approximate_counting/code/python/approximate_counting.py +++ b/contents/approximate_counting/code/python/approximate_counting.py @@ -41,9 +41,9 @@ def test_approximate_count(n_trials, n_items, a, threshold): if abs((avg - n_items)/n_items) < threshold: print("passed") -print("testing 1,000, a = 30, 1% error") +print("testing 1,000, a = 30, 10% error") test_approximate_count(100, 1000, 30, 0.1) -print("testing 12,345, a = 10, 1% error") +print("testing 12,345, a = 10, 10% error") test_approximate_count(100, 12345, 10, 0.1) -print("testing 222,222, a = 0.5, 10% error") +print("testing 222,222, a = 0.5, 20% error") test_approximate_count(100, 222222, 0.5, 0.2)