1. Invent Yourself source: www.dilbert.com Byung Hoon Cho New - - PowerPoint PPT Presentation

1 invent yourself
SMART_READER_LITE
LIVE PREVIEW

1. Invent Yourself source: www.dilbert.com Byung Hoon Cho New - - PowerPoint PPT Presentation

1. Invent Yourself source: www.dilbert.com Byung Hoon Cho New Zealand 2016 1 The Problem Truly random numbers are a very valuable and rare resource. Design, produce, and test a mechanical device for producing random numbers. Analyse to


slide-1
SLIDE 1
  • 1. Invent Yourself

Byung Hoon Cho New Zealand 2016

1

source: www.dilbert.com

slide-2
SLIDE 2

The Problem

2

Design Generation Randomness Definitions Testing Tampering Problem

Truly random numbers are a very valuable and rare

  • resource. Design, produce, and test a mechanical

device for producing random numbers. Analyse to what extent the randomness produced is safe against tampering

slide-3
SLIDE 3

The Problem

Truly random numbers are a very valuable and rare

  • resource. Design, produce, and test a mechanical

device for producing random numbers. Analyse to what extent the randomness produced is safe against tampering

3

Design Generation Randomness Definitions Testing Tampering Problem

slide-4
SLIDE 4

Defining “Random”

  • 1. Independent and equal probability
  • 2. Unrelated cause
  • 3. PaQernless/Unpredictable

4

Design Generation Randomness Definitions Testing Tampering Problem

slide-5
SLIDE 5

Defining “Tampering”

  • Any change causing a change in the:
  • Independence of the numbers, or
  • DistribuTon of the numbers, or
  • Predictability of the next number
  • “Safe against tampering”
  • “Safe” if tampering can be detected

5

Design Generation Randomness Definitions Testing Tampering Problem

slide-6
SLIDE 6

Random: Local vs Global

6

11 12 10 19 20 08 13 14 05 07 16 03 15 23 00 21 06 01 22 17 09 04 02 18 13 17 00 08 06 22 16 02 18 11 15 01 04 09 07 19 20 21 23 12 10 14 05 03 12 05 16 17 08 01 06 10 15 20 22 09 21 23 00 02 18 14 04 03 11 19 13 07 17 18 10 11 15 01 14 21 06 05 09 16 13 23 07 12 00 20 04 08 22 02 03 19 11 12 10 19 20 08 13 14 05 07 16 03 15 23 00 21 06 01 22 17 09 04 02 18

Design Generation Randomness Definitions Testing Tampering Problem

slide-7
SLIDE 7

Random: Local vs Global

7

11 12 10 19 20 08 13 14 05 07 16 03 15 23 00 21 06 01 22 17 09 04 02 18 13 17 00 08 06 22 16 02 18 11 15 01 04 09 07 19 20 21 23 12 10 14 05 03 12 05 16 17 08 01 06 10 15 20 22 09 21 23 00 02 18 14 04 03 11 19 13 07 17 18 10 11 15 01 14 21 06 05 09 16 13 23 07 12 00 20 04 08 22 02 03 19 11 12 10 19 20 08 13 14 05 07 16 03 15 23 00 21 06 01 22 17 09 04 02 18

Design Generation Randomness Definitions Testing Tampering Problem

slide-8
SLIDE 8

Random: Local vs Global

8

11 12 10 19 20 08 13 14 05 07 16 03 15 23 00 21 06 01 22 17 09 04 02 18 13 17 00 08 06 22 16 02 18 11 15 01 04 09 07 19 20 21 23 12 10 14 05 03 12 05 16 17 08 01 06 10 15 20 22 09 21 23 00 02 18 14 04 03 11 19 13 07 17 18 10 11 15 01 14 21 06 05 09 16 13 23 07 12 00 20 04 08 22 02 03 19 11 12 10 19 20 08 13 14 05 07 16 03 15 23 00 21 06 01 22 17 09 04 02 18

Design Generation Randomness Definitions Testing Tampering Problem

slide-9
SLIDE 9

Possible Devices

  • RouleQe wheel
  • DeterminisTc
  • Simulators allow for predicTon

9

slide-10
SLIDE 10

Possible Devices

  • Compound pendulum
  • Non-uniform distribuTon

10

slide-11
SLIDE 11

Possible Devices

  • RadioacTve decay
  • Truly random
  • Non-mechanical

11

slide-12
SLIDE 12

Part 1 - Design

  • Fluids
  • Currently very difficult to model
  • ChaoTc system
  • Closed system
  • ConTnuous process
  • Increases speed/efficiency of RNG

12

Design Generation Randomness Definitions Testing Tampering Problem

slide-13
SLIDE 13

Reynolds Number

  • Predicts how turbulent a fluid system is
  • Dh = length of square side
  • ν = kinemaTc viscosity of fluid (air)
  • v = velocity of fluid
  • Re of produced tube = 8.0 x 105

13

Re = vDh ν

Design Generation Randomness Definitions Testing Tampering Problem

slide-14
SLIDE 14

Device Design

14

Design Generation Randomness Definitions Testing Tampering Problem

1.2 m

36 mm

slide-15
SLIDE 15

MoTon of the Balls

16

Design Generation Randomness Definitions Testing Tampering Problem

pi pf Ffluid

slide-16
SLIDE 16

MoTon of the Balls

17

Weight Force Fluid Force Net Force

Design Generation Randomness Definitions Testing Tampering Problem

slide-17
SLIDE 17

MoTon of the Balls

18

Weight Force Fluid Force Net Force

Design Generation Randomness Definitions Testing Tampering Problem

Force due to Collision

slide-18
SLIDE 18

MoTon of the Balls

19

Weight Force Fluid Force Net Force

Design Generation Randomness Definitions Testing Tampering Problem

Force due to Collision Magnus Force

slide-19
SLIDE 19

GeneraTng Numbers

20

Design Generation Randomness Definitions Testing Tampering Problem

slide-20
SLIDE 20

GeneraTng Numbers

21

Design Generation Randomness Definitions Testing Tampering Problem

slide-21
SLIDE 21

GeneraTng Numbers

22

Design Generation Randomness Definitions Testing Tampering Problem

slide-22
SLIDE 22

GeneraTng Numbers

23

Design Generation Randomness Definitions Testing Tampering Problem

slide-23
SLIDE 23

GeneraTng Numbers

  • Raw data is in binary (each 0 or 1 is a ‘bit’)
  • Take a number of bits (for now, 3 bits)
  • Convert from binary to decimal
  • 3 bits generate a number in range [0, 7]

24

Design Generation Randomness Definitions Testing Tampering Problem

slide-24
SLIDE 24

GeneraTng Numbers

25

10100100010111001111010000110011001011011100010100 10000001100010100100111011000000111111111000101010 01110100110101111110011100001001000010010011111101 00111010000001110001100110011010010110011111001011 01110010100110111001011000001110001110000111110111 11001100000111100011100100101000100111011101010111 00010000101111001110110111100110010111101111110011 11101110011111110111110011110100101001111101100111 01111010100001110111110011001000011101010111001100 11010111000110111011101011000110110011111101010011 00110111000011011010111111111010100011011100011110 10010010011110100100001010011011101010100001010011 11000110001110101011011010001110110101111000101001 00011000010011010101011100111111111001100001010100 01001101011101110011011010110111011100101101011001

Design Generation Randomness Definitions Testing Tampering Problem

slide-25
SLIDE 25

TesTng Randomness

  • Uniform distribuTon
  • Frequency of 1s and 0s
  • Frequency of 3-bit numbers
  • “Binomial poker test”
  • Independence
  • Frequency of 0 → 0, 0 → 1, 1 → 1, 1 → 0
  • CondiTonal frequency of 3-bit numbers
  • PaQern
  • Longest repeated subsequence
  • Hidden paQerns: Fourier transform

26

Design Generation Randomness Definitions Testing Tampering Problem

slide-26
SLIDE 26

Chi-square (휒2)

  • For each category (e.g. 3-bit number or 1 →0),

work out expected frequency

  • Use the formula:

27

χ 2 = ∑ (Observed(X) - Expected(X))2 Expected(X)

Design Generation Randomness Definitions Testing Tampering Problem

slide-27
SLIDE 27

Chi-square (휒2)

  • Degrees of freedom (DoF) = # categories - 1
  • Find table value for significance level (5%) and DoF
  • If calculated value > table value, reject null

hypothesis

  • Non-randomness of the sequence is probably

NOT due to global randomness

  • Tampering is probably occurring

28

Design Generation Randomness Definitions Testing Tampering Problem

slide-28
SLIDE 28

Chi-square (휒2)

  • Degrees of freedom (DoF) = # categories - 1
  • Find table value for significance level (5%) and DoF
  • If calculated value > table value, reject null

hypothesis

  • Non-randomness of the sequence is probably

NOT due to global randomness

  • Tampering is probably occurring

28

DoF Cri'cal Value at 5% Significance Level 1 3.841 2 5.991 3 7.815 4 9.488 5 11.070 6 12.592 7 14.067 8 15.507

Design Generation Randomness Definitions Testing Tampering Problem

slide-29
SLIDE 29

Hypotheses

  • H0: distribuTon is independent / random
  • H1: distribuTon is not independent / random

29

Design Generation Randomness Definitions Testing Tampering Problem

slide-30
SLIDE 30

Test Results - Bits

30

Colour Frequency % of N Red (0) 2536 50.7 Green (1) 2464 49.3

N = 5000 휒2 = 1.04 (< 3.84 ∴ random)

Design Generation Randomness Definitions Testing Tampering Problem

slide-31
SLIDE 31

Test Results - 3 Bits

31

N = 1666 휒2 = 7.67 (< 14.07 ∴ random)

Frequency 50 100 150 200 250 300 3-bit Number 1 2 3 4 5 6 7

Design Generation Randomness Definitions Testing Tampering Problem

Expected: 208

slide-32
SLIDE 32

Predictability TesTng

  • Longest repeated subsequence
  • Whole sequence: 5000 bits
  • Longest repeat: 22 bits
  • 0.88% of whole sequence

32

Design Generation Randomness Definitions Testing Tampering Problem

slide-33
SLIDE 33

Fourier Transform

33

Design Generation Randomness Definitions Testing Tampering Problem

Power / Arbitrary Units 20 40 60 80 100 120 Frequency / Hz 0.2 0.4 0.6 0.8 1

slide-34
SLIDE 34

Part 5 - Tampering

  • Colour of light
  • Camera detects light reflected off balls
  • Ball paint colour determines which wavelengths
  • f light are reflected
  • Ball properTes
  • Shape
  • Mass

34

Design Generation Randomness Definitions Testing Tampering Problem

slide-35
SLIDE 35

Light

35

Design Generation Randomness Definitions Testing Tampering Problem

slide-36
SLIDE 36

Light

36

Design Generation Randomness Definitions Testing Tampering Problem

slide-37
SLIDE 37

Part 5 - Tampering

37

Design Generation Randomness Definitions Testing Tampering Problem

slide-38
SLIDE 38

Part 5 - Tampering

37

Design Generation Randomness Definitions Testing Tampering Problem

slide-39
SLIDE 39

Number of Balls - Part 1

38

Green : Red Red / % N 휒2 bits 휒2 3-bits 20 : 20 50.7 5000 1.04 7.67 20 : 18 48.8 5000 2.78 25.30 20 : 16 45.7 5000 37.32 55.27 20 : 14 39.7 5000 213.00 255.31 20 : 10 32.9 5000 583.45 717.64 휒2 threshold at p = 0.05 3.84 14.07

Design Generation Randomness Definitions Testing Tampering Problem

slide-40
SLIDE 40

Number of Balls - Part 2

39

Green : Red Red / % N 휒2 bits 휒2 3-bits 20 : 20 50.9 2000 0.65 4.84 15 : 15 48.4 2000 2.05 6.19 10 : 10 52.9 2000 6.50 10.65 5 : 5 54.1 2000 13.45 36.58 1 : 1* 40.5 200 7.22 14.50 휒2 threshold at p = 0.05 3.84 14.07

Design Generation Randomness Definitions Testing Tampering Problem

* Longest repeated subsequence: 16%

slide-41
SLIDE 41

Ball ProperTes - Area

40

Red FlaNened Red / % N 휒2 bits 휒2 3-bits No 50.7 5000 1.04 7.67 Yes 53.8 5000 28.58 57.61 휒2 threshold at p = 0.05 3.84 14.07

Design Generation Randomness Definitions Testing Tampering Problem

Flattened vs Not Flattened

slide-42
SLIDE 42

Ball ProperTes - Mass

41

Red : Green Mass Red / % N 휒2 bits 휒2 3-bits 13 : 13 50.7 5000 1.04 7.67 19 : 13 58.6 5000 147.23 165.88 휒2 threshold at p = 0.05 3.84 14.07

Design Generation Randomness Definitions Testing Tampering Problem

13 grams :13 grams vs 19 grams : 13 grams

slide-43
SLIDE 43

Ball ProperTes - Mass

42

Design Generation Randomness Definitions Testing Tampering Problem

slide-44
SLIDE 44

The Problem

43

Truly random numbers are a very valuable and rare

  • resource. Design, produce, and test a mechanical

device for producing random numbers. Analyse to what extent the randomness produced is safe against tampering

slide-45
SLIDE 45

Conclusion - TesTng

44

Problem Conclusion Sound Refraction Superposition Diffraction Parameters

  • Randomness
  • Uniform distribuTon
  • Independence
  • PaQernless
  • Tampering
  • All staTsTcal tests must pass
  • Tampering with light can be detected
slide-46
SLIDE 46

References

  • D. Biebighauser, “TesTng Random Number Generators,” University of Minnesota (2000)
  • O. Goldshmidt, “Pseudo-, Quasi-, and Real Random Numbers,” IBM Haifa Research

Laboratories (2003)

  • hQps://www.random.org/randomness/
  • hQp://mpe2013.org/2013/03/17/chaos-in-an-atmosphere-hanging-on-a-wall/
  • hQps://courses.physics.illinois.edu/phys598aem/Sotware/CriTcal_Values_of_the_Chi-

Squared_DistribuTon.pdf

  • hQps://www.youtube.com/v/9rIy0xY99a0, Vsauce, “What is Random?”
  • hQps://www.youtube.com/v/sMb00lz-IfE, Veritasium, “What is NOT Random?”
  • hQp://www.radford.edu/~rsheehy/Gen_flash/Tutorials/Chi-Square_tutorial/x2-tut.htm

45

slide-47
SLIDE 47

Acknowledgements

  • Gavin Jennings (Auckland Grammar School)
  • Kent Hogan (Onslow College)
  • Sang Wook Kim
  • Carlos Aguilera Cortes
  • Catherine Pot
  • Jack Tregidga
  • Sue Napier (Riccarton High School)
  • Felicia Ullstad
  • Michael Pot

46

slide-48
SLIDE 48
  • 1. Invent Yourself

Byung Hoon Cho New Zealand 2016

47

slide-49
SLIDE 49
  • 1. Invent Yourself

Byung Hoon Cho New Zealand 2016

48

source: www.dilbert.com

slide-50
SLIDE 50

ConverTng to Decimal

49

Bit 3 Bit 2 Bit 1 MulTplier 22 21 20 Value [0, 1] 1 1 Decimal Value 4 1

Decimal number = 4 + 0 + 1 = 5

Design Generation Randomness Definitions Testing Tampering Problem

slide-51
SLIDE 51

Scalability

50

N = 1000 휒2 = 24.19 (vs 44.99)

Frequency 10 20 30 40 50 60 5-bit Number 5 10 15 20 25 30

Expected: 31

slide-52
SLIDE 52

Ball ProperTes - Mass

  • Rearranging gives
  • ↑ mass decreases acceleraTon and max height

51

a = F m F = ma

Design Generation Randomness Definitions Testing Tampering Problem

Colour Extra Mass Mass of 20 Balls / g Red No 13 Red Yes 19 Green No 13 ± 0.5

slide-53
SLIDE 53

Ball ProperTes - Area

  • Rearranging gives
  • Since pressure from the air blower remains

relaTvely constant,

  • Increasing area increases the force

52

P = F A F = PA F ∝ A

Design Generation Randomness Definitions Testing Tampering Problem

slide-54
SLIDE 54

Ball ProperTes - Area

53

Design Generation Randomness Definitions Testing Tampering Problem

slide-55
SLIDE 55

Fourier Transform

54

Design Generation Randomness Definitions Testing Tampering Problem

Power / Arbitrary Units 20 40 60 80 100 120 Frequency / Hz 0.2 0.4 0.6 0.8 1

slide-56
SLIDE 56

Fourier Transform

55

Design Generation Randomness Definitions Testing Tampering Problem

Frequency 50 100 150 200 250 300 Maximum Power / Arbitrary Units 85 95 105 115 125 135 145

slide-57
SLIDE 57

Fourier Transform - 1:1

56

Design Generation Randomness Definitions Testing Tampering Problem

Power / Arbitrary Units 5 10 15 20 Frequency / Hz 0.2 0.4 0.6 0.8 1

slide-58
SLIDE 58

Fourier Transform - 1:1

57

Design Generation Randomness Definitions Testing Tampering Problem

Frequency 200 400 600 800 1000 1200 Maximum Power / Arbitrary Units 10 15 20 25

slide-59
SLIDE 59

Fourier - Pure Sine

58

Design Generation Randomness Definitions Testing Tampering Problem

Power / Arbitrary Units 500 1000 1500 2000 2500 Frequency / Hz 0.2 0.4 0.6 0.8 1

slide-60
SLIDE 60

Fourier - Two Sines

59

Design Generation Randomness Definitions Testing Tampering Problem

Power / Arbitrary Units 1000 2000 3000 4000 5000 Frequency / Hz 0.2 0.4 0.6 0.8 1

slide-61
SLIDE 61

Fourier - Hidden PaQern

60

Design Generation Randomness Definitions Testing Tampering Problem

Amplitude / Arbitrary Units

  • 2

2 4 6 8 10 12 Time / ms 100 200 300 400 500

slide-62
SLIDE 62

Fourier - Hidden PaQern

61

Design Generation Randomness Definitions Testing Tampering Problem

Amplitude / Arbitrary Units

  • 2

2 4 6 8 10 12 Time / ms 100 200 300 400 500

slide-63
SLIDE 63

Fourier - Hidden PaQern

62

Design Generation Randomness Definitions Testing Tampering Problem

Power / Arbitrary Units 500 1000 1500 2000 2500 Frequency / Hz 0.2 0.4 0.6 0.8 1

slide-64
SLIDE 64

Chaos / “Bu$erfly Effect”

  • “When the present determines the future, but the

approximate present does not approximately determine the future” - Edward Lorenz

  • Highly sensiTve to iniTal condiTons
  • PredicTon is possible (determinisTc)
  • But not feasible: it would take 3.3 x 107 years

to accurately predict the posiTons of each parTcle of air in 1 dm3 ater 1 second

63

Design Generation Randomness Definitions Testing Tampering Problem

slide-65
SLIDE 65

Random MoTon

64

  • 50

225 500 775 1,050 75 206.25 337.5 468.75 600

slide-66
SLIDE 66

Improvements/LimitaTons

  • 0.5 s / bit = 1.5 s / 3-bit number
  • Stronger air supply and increased sampling

increases rate of generaTon

  • Increase shuQer speed to reduce moTon blur
  • Allows more accurate determinaTon of ball

posiTons

65