#7123: cryptanalysis of the shift cipher
----------------------------+-----------------------------------------------
   Reporter:  mvngu         |       Owner:  somebody       
       Type:  enhancement   |      Status:  needs_review   
   Priority:  major         |   Milestone:  sage-4.1.3     
  Component:  cryptography  |    Keywords:                 
Work_issues:                |      Author:  Minh Van Nguyen
   Reviewer:                |      Merged:                 
----------------------------+-----------------------------------------------

Comment(by rbeezer):

 Hi Minh,

 Finally have a chance to comment carefully on the various ways to measure
 the distributions.

 1.  For a chi-square used for goodness-of-fit between distributions see
 Hogg and Tannis, Probbilit and Stastical Inference, 6th Ed., Section 8.4.
 Use the actual counts of each letter in a candidate decipher and call
 these "observed."  Then multiply frequences from
 {{{frequency_distribution()}}} times the length of the message.  Call
 these theoretical counts the "expected" and carry them as non-integers,
 even if we know they should be integral.  Then the statistic is the sum
 over all the letters of

 {{{(observed - expected)^2/expected}}}

 I would use the keyword "chisquare" for this.

 2.  The sum of squared differences should probably be computed as the sum
 over all letters using counts, not frequencies, ie

 {{{(observed - expected)^2}}}

 This is equivalent in this case to the coefficient of determination, or
 more informally "r-squared."  Another name is "residual sum of squares."

 3.  Not at all clear to me how [SavHar99] justifies the use of their
 expression and naming it a chi-square statistic.  If anything, it looks to
 me like a noncentral chisquare statistic.  But it may do a good job of
 "scoring" candidate decipherments.  Can you be sure if they mean to square
 just the numerator of each term ({{{FD^2/CD}}}), or square the whole
 fraction ({{{FD/CF}}})?

 Rob

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7123#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to