Click here to Skip to main content
15,896,492 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionAlgorithm - cars crossing the bridge Pin
Member 113453804-Jan-15 6:42
Member 113453804-Jan-15 6:42 
AnswerRe: Algorithm - cars crossing the bridge Pin
jschell5-Jan-15 9:17
jschell5-Jan-15 9:17 
GeneralRe: Algorithm - cars crossing the bridge Pin
Member 113453806-Jan-15 2:37
Member 113453806-Jan-15 2:37 
GeneralRe: Algorithm - cars crossing the bridge Pin
Eddy Vluggen6-Jan-15 5:36
professionalEddy Vluggen6-Jan-15 5:36 
GeneralRe: Algorithm - cars crossing the bridge Pin
jschell7-Jan-15 8:59
jschell7-Jan-15 8:59 
QuestionHamming algorithm. Pin
Member 113468241-Jan-15 10:50
Member 113468241-Jan-15 10:50 
AnswerRe: Hamming algorithm. Pin
PIEBALDconsult1-Jan-15 11:03
mvePIEBALDconsult1-Jan-15 11:03 
QuestionBignum timing Pin
Member 419459312-Dec-14 16:59
Member 419459312-Dec-14 16:59 
I am working on a bignum library and have been checking out some of the functions. I would like to know it the times I am seeing are good, bad, or indifferent.

To test big numbers, I used the RSA challenge file.

The times are in seconds and hundredths.
The initialize time is setting high priority and allocating all of virtual memory.
The read and split time is the time to read the file (one time) and tokenize it.
The edit time is for deleting unneeded lines in the file.

To get any difference in time between the different RSA instances, I had to loop 100,000 times to get different time values for the different instances (as you can see, the read/split time and the edit time are the default .01 second), thus those times are listed as 100K*xxx, i.e. "RSA-2048 100K*DTB conversion time: 2.06" means 20.6 microseconds for any single loop.

A single RSA instance includes the following data which is verified during the conversion (the first RSA instance is used as this example):

RSA-576

Status: Factored

Decimal Digits: 174

18819881292060796383869723946165043980716356337941
73827007633564229888597152346654853190606065047430
45317388011303396716199692321205734031879550656996
221305168759307650257059

Decimal Digit Sum: 785


The edit deletes the blank lines and the Status line. The initialize, read, and edit are only done one time.

The conversion time for each RSA instance includes validating that only decimal digits are present in the data, and that there the correct number of digits, and that the digit sum matches. I load the number as a radix 10 value and convert it to binary, and verify that the result has the correct number of bits. I save this binary value over the decimal digits so I can load it later without conversion. I also load this binary value to insure correct operation with radix 1. Each RSA instance is processed 100,000 times and then the time is calculated.

The SQRT times include loading the binary value and taking the SQRT and getting its remainder, and then squaring the SQRT and adding the remainder and comparing the result with the RSA instance value. Each RSA instance is processed 100,000 times and then the time is calculated.


With all of the above operations as described, are the times at all reasonable, i.e. 20.6 microseconds for DTB conversion and validation of a 2048 bit binary number and 63.6 microseconds to load and take the SQRT and validate (SQRT**2 + remainder == semi prime) for the 2048 bit binary value?

Dave.

Time to initialize:                       0.06

Time to read and split RSA.TXT:           0.01

Time to edit RSA.TXT:                     0.01

RSA-576  100K*DTB conversion time:        0.49
RSA-640  100K*DTB conversion time:        0.56
RSA-704  100K*DTB conversion time:        0.59
RSA-768  100K*DTB conversion time:        0.79
RSA-896  100K*DTB conversion time:        0.98
RSA-1024 100K*DTB conversion time:        1.13
RSA-1536 100K*DTB conversion time:        1.54
RSA-2048 100K*DTB conversion time:        2.06

Time to DTB convert 100K*RSA.TXT:         8.34

RSA-576  SQRT Time - 100k*RSA.TXT:        1.46
RSA-640  SQRT Time - 100k*RSA.TXT:        2.51
RSA-704  SQRT Time - 100k*RSA.TXT:        2.71
RSA-768  SQRT Time - 100k*RSA.TXT:        2.12
RSA-896  SQRT Time - 100k*RSA.TXT:        2.40
RSA-1024 SQRT Time - 100k*RSA.TXT:        2.80
RSA-1536 SQRT Time - 100k*RSA.TXT:        5.69
RSA-2048 SQRT Time - 100k*RSA.TXT:        6.36

GeneralRe: Bignum timing Pin
PIEBALDconsult12-Dec-14 17:12
mvePIEBALDconsult12-Dec-14 17:12 
GeneralRe: Bignum timing Pin
Member 419459313-Dec-14 7:13
Member 419459313-Dec-14 7:13 
GeneralRe: Bignum timing Pin
Member 419459314-Jan-15 11:20
Member 419459314-Jan-15 11:20 
GeneralRe: Bignum timing Pin
PIEBALDconsult14-Jan-15 12:40
mvePIEBALDconsult14-Jan-15 12:40 
GeneralRe: Bignum timing Pin
Member 419459314-Jan-15 14:47
Member 419459314-Jan-15 14:47 
Questionsimple maby for you Pin
Member 1130547811-Dec-14 23:00
Member 1130547811-Dec-14 23:00 
SuggestionRe: simple maby for you Pin
ZurdoDev12-Dec-14 4:14
professionalZurdoDev12-Dec-14 4:14 
QuestionI'm looking for an algorithm ... Pin
filos14-Dec-14 1:45
filos14-Dec-14 1:45 
AnswerRe: I'm looking for an algorithm ... Pin
Patrice T22-Jun-15 9:36
mvePatrice T22-Jun-15 9:36 
QuestionRandomizing Flickr Tags Based on Search Term Pin
Member 1051454915-Nov-14 1:15
Member 1051454915-Nov-14 1:15 
QuestionAlgorithm to count how many "1" in binary o(1) Pin
Member 1105509311-Nov-14 2:13
Member 1105509311-Nov-14 2:13 
AnswerRe: Algorithm to count how many "1" in binary o(1) PinPopular
Kornfeld Eliyahu Peter11-Nov-14 2:33
professionalKornfeld Eliyahu Peter11-Nov-14 2:33 
GeneralRe: Algorithm to count how many "1" in binary o(1) Pin
Member 1105509312-Nov-14 1:07
Member 1105509312-Nov-14 1:07 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
Richard Deeming11-Nov-14 2:39
mveRichard Deeming11-Nov-14 2:39 
SuggestionRe: Algorithm to count how many "1" in binary o(1) Pin
Kornfeld Eliyahu Peter11-Nov-14 2:43
professionalKornfeld Eliyahu Peter11-Nov-14 2:43 
GeneralRe: Algorithm to count how many "1" in binary o(1) Pin
harold aptroot12-Nov-14 9:36
harold aptroot12-Nov-14 9:36 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
Aurimas11-Nov-14 3:27
Aurimas11-Nov-14 3:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.