23
Dynamics of Some Maps Associated with Number Theoretic Functions. ITEC809 Project Report. Semester 2, 2011 Jeffrey Smith – 30503523 Supervisor : Igor Shparlinski

Dynamics of Some Maps Associated with Number Theoretic Functions

  • Upload
    booker

  • View
    27

  • Download
    0

Embed Size (px)

DESCRIPTION

Dynamics of Some Maps Associated with Number Theoretic Functions. ITEC809 Project Report. Semester 2, 2011 Jeffrey Smith – 30503523 Supervisor : Igor Shparlinski. Presentation Outline. Project Objectives Pseudorandom numbers and applications - PowerPoint PPT Presentation

Citation preview

Page 1: Dynamics of Some Maps Associated with Number Theoretic Functions

Dynamics of Some Maps Associated with Number Theoretic Functions.

ITEC809 Project Report.Semester 2, 2011Jeffrey Smith – 30503523Supervisor : Igor Shparlinski

Page 2: Dynamics of Some Maps Associated with Number Theoretic Functions

2

Presentation Outline Project Objectives

◦ Pseudorandom numbers and applications◦ Iterative maps for Number Theoretic Functions (NTFs)◦ Building an analysis tool◦ Data Analysis

Background◦ Iterative processing of NTFs ◦ Cycle and Tail length analysis for pseudorandom number generation◦ Cycle detection◦ The NTFs implemented with the tool

Analysis tool development◦ Development choices◦ Calculations with NTL and lessons learned◦ Implementing NTFs◦ Using the Analysis tool

Performance Enhancements◦ Checking for previously calculated maps◦ Enhancement results and future experimentation

Analysis Results◦ Sample Results data◦ Sample Frequency distribution

Conclusion

Page 3: Dynamics of Some Maps Associated with Number Theoretic Functions

3

Project ObjectivesThe need for Pseudorandom numbers in

computing.◦ Sources of random numbers with complex

algorithms

◦ Used to create hashing functions for cryptographic methods to provide security

◦ Pseudorandom numbers need complex methods of generation to prevent prediction

◦ Would be useful to find a simple method of producing a highly complex sequences of numbers

Page 4: Dynamics of Some Maps Associated with Number Theoretic Functions

4

Project ObjectivesIterative maps of Number Theoretic Functions.

◦ Generated by taking relatively simple number theoretic functions and produce iterative sequences of numbers.

◦ Generates a sequence of seemingly random numbers for some functions.

◦ Simple method of generating complex output.

◦ Possible source of pseudorandom numbers for computing applications.

Page 5: Dynamics of Some Maps Associated with Number Theoretic Functions

5

Project ObjectivesBuilding an Analysis Tool

◦Project goal is to build a tool that can produce iterative maps of Number Theoretic Functions

◦Tool implements several Number Theoretic Functions and allows analysis over ranges of values to study the behaviour of these maps.

◦Tool will produce data for range analysis on variance and dispersion characteristics for the length of maps generated to assess how effective the technique is.

Page 6: Dynamics of Some Maps Associated with Number Theoretic Functions

6

Project ObjectivesData Analysis

◦The analysis tool should allow us to investigate how Maps of Number Theoretic Function behave.

◦ Investigation of implemented NTFs and assessment of pseudorandom behaviour with respect to the dispersion of the tail lengths.

◦Tool allows us to investigate characteristic behaviour including average tail and cycle lengths, distinct cycles and variance.

Page 7: Dynamics of Some Maps Associated with Number Theoretic Functions

7

BackgroundIterative maps of Number

Theoretic Functions◦Iterative maps are created by

resubmitting the result of the function on successive iterations.

Page 8: Dynamics of Some Maps Associated with Number Theoretic Functions

8

BackgroundCycle and tail length analysis

◦Looking at the cycle length and the length of the ‘tail’ before the sequence add complexity.

Page 9: Dynamics of Some Maps Associated with Number Theoretic Functions

9

Background Cycle detection

◦Floyd’s Algorithm vs Brent’s Algorithm

Source: http://en.wikipedia.org/wiki/Cycle_detection#Tortoise_and_hare

Page 10: Dynamics of Some Maps Associated with Number Theoretic Functions

10

BackgroundNumber Theoretic Functions

◦Collatz function:

Page 11: Dynamics of Some Maps Associated with Number Theoretic Functions

11

BackgroundNumber Theoretic Functions

◦Collatz function modulus p:

Page 12: Dynamics of Some Maps Associated with Number Theoretic Functions

12

BackgroundNumber Theoretic Functions

◦Fermat Quotient (Type 1):

Page 13: Dynamics of Some Maps Associated with Number Theoretic Functions

13

BackgroundNumber Theoretic Functions

◦Fermat Quotient (Type 2):

Page 14: Dynamics of Some Maps Associated with Number Theoretic Functions

14

Analysis Tool DevelopmentDevelopment Choices

◦Visual Studio C++ Useful as already knew VS development

environment Compatible with the C++ libraries required for

NTL.Calculations with NTL and lessons learned

◦NTL – Library for number theoretic calculations – Victor Shoup.

◦Required for large integer calculations.◦NTL library allows accurate and efficient

calculations.

Page 15: Dynamics of Some Maps Associated with Number Theoretic Functions

15

Analysis Tool DevelopmentImplementing Number Theoretic

Functions◦Functions must be broken down to

algorithms, using the NTL operators and big integer variables.

Page 16: Dynamics of Some Maps Associated with Number Theoretic Functions

16

Analysis Tool DevelopmentUsing the Analysis tool

Console applicationTakes variables command line variables

Page 17: Dynamics of Some Maps Associated with Number Theoretic Functions

17

Analysis Tool DevelopmentUsing the Analysis tool

◦Console output for progress and debug:

Page 18: Dynamics of Some Maps Associated with Number Theoretic Functions

18

Analysis Tool DevelopmentUsing the Analysis tool

◦Range Analysis Output as CSV or as summary of analysis information.

Page 19: Dynamics of Some Maps Associated with Number Theoretic Functions

19

Performance Enhancements Tool takes days to produce some of the data sets. Improvements were investigated by keeping track of

previously generated paths and using this to greatly reduce the processing overhead by back filling new data rather than computing complete maps.

Leverages the finding of rather small numbers of unique cycles.

Processing time comparison:P Fermat Quotient (Type 2) Fermat Quotient (Type 2) Enhanced

1000003 15:37:49 0:23:00

1150027 15:20:39 Error processing

1350229 44:37:16 0:31:44

1499977 41:34:55 Error processing

1800167 29:07:35 0:47:59

1999993 More than 72:00:00 0:51:20

Page 20: Dynamics of Some Maps Associated with Number Theoretic Functions

20

Performance Enhancements◦ Enhanced range analysis processing time vs number of maps.

Future work using this enhanced method would allow a much greater range of data to be analysed at once.

On discussion with faculty staff, this would be well suited to distributed computing approaches for future implementations.

1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 20000000:00:000:07:120:14:240:21:360:28:480:36:000:43:120:50:240:57:36

R² = 0.990178061424473

Fermat Quotient (Type 2) Enhanced

Fermat Quotient (Type 2) Enhanced Linear (Fermat Quotient (Type 2) Enhanced)

Page 21: Dynamics of Some Maps Associated with Number Theoretic Functions

21

Analysis ResultsSample Analysis data:

Collatz Mod P dataP

Average Cycle Average Tail Largest Tail Tail Variance Dispersion Index Distinct Cycles

No. Stopping Points

1000003 3.00 116.34 325 2557.80 21.98 3 11150027 3.00 118.10 330 2608.02 22.08 2 11350229 3.00 119.60 378 2699.65 22.57 2 01499977 3.00 120.36 373 2620.16 21.77 1 01800167 3.00 122.34 366 2752.27 22.50 4 11999993 3.00 123.15 362 2664.72 21.64 1 0

0

5000

10000

15000

20000

1 12 23 34 45 56 67 78 89 100

111

122

133

144

155

166

177

188

199

210

221

232

243

254

265

276

287

298

309

320

331

342

353

Frequency Distribution - Collatz Mod P -P = 1999993

Frequency

Page 22: Dynamics of Some Maps Associated with Number Theoretic Functions

22

Analysis ResultsSample Analysis data:

Fermat Quotient (Type 2).P

Average Cycle

Average Trajectory

Largest Trajectory

Trajectory Variance Dispersion Index Distinct Cycles

No. Stopping Points

1000003 467.07 692.48 1951 184773 266.83 8 21150027 399.6 498.66 1422 110961 222.52 10 21350229 1450.5 564.06 1581 146059 258.94 10 21499977 750.52 1168.7 3353 728444 623.30 13 31800167 247.28 704.25 1718 186674 265.07 13 21999993 1079.8 752.84 2486 326884 434.20 10 4

0

500

1000

1500

2000

110

320

530

740

951

161

371

581

791

910

2111

2312

2513

2714

2915

3116

3317

3518

3719

3920

4121

4322

4523

4724

4925

5126

5327

5528

5729

5930

6131

6332

65

Frequency Distribution - Fermat Quotient (Type 2) -P = 1499977

Frequency

Page 23: Dynamics of Some Maps Associated with Number Theoretic Functions

23

ConclusionAnalysis tool built to produce maps of number

theoretic functions and compile useful results for analysis.

Performance enhancements investigated to alleviate enormous processing overhead and reduce processing time from days to minutes.

Brief analysis of large primes found that we can produce pseudorandom numbers with number theoretic function maps. More analysis would give us better insight into selecting the right functions and values to do this.