text:
# Showing symmetry of the stress tensor by applying divergence theorem to $\int\int_{\delta V(t)} \vec{x}\times \vec{t} dS$

I'm currently working through the symmetry of the stress tensor, in relation to viscous flow. I am looking at this by examining the conservation of angular momentum equation for a material volume $V(t)$ with unit normal $\vec{n}=(n_1,n_2,n_3)$. I am having issue with applying the divergence theorem to this term

$$\int\int_{\delta V(t)} \vec{x}\times \vec{t} dS$$

Where $\vec{x}=(x_1,x_2,x_3)$ and $\vec{t}$ is the stress vector where $\vec{t}=\vec{e}_i\sigma_{ij}n_j$, using the summation convenction, where $\sigma_{ij}$ is stress vector.

If I can extract a normal from this expression I can use the divergence theorem to convert to a volume integral and combine with the other terms of the conservation of angular momentum equation, which are volume integrals, this will lead to showing $\sigma_{ij}=\sigma_{ji}$.

Many thanks to anyone who could help.

EDIT: Under angular momentum on this page is basically doing what i'm looking for, but can't for the life of me see how they do it -or what their notation relates to http://bobbyness.net/NerdyStuff/Navier%20Stokes%20Equations/Navier%20Stokes.html

EDIT2: Here is a link to the notes i'm learning from, page 14 http://www.maths.ox.ac.uk/system/files/coursematerial/2012/2386/9/B6aLectureNotes_img.pdf

-
Is it fair to say that $\vec{e}_i$ are tangent to the surface $\delta V(t)$? I need a few more details on the conventions of your notation. Interesting problem. I have a derivation of the inertia tensor from KE of a rigid body, the inertia tensor naturally arises a symmetric tensor which gives the components of the quadratic form in the angular velocity... but your problem is fluid physics so perhaps my starting point is wrong. –  James S. Cook Dec 6 '12 at 18:25
@JamesS.Cook: At sorry, I tried to include as many possible but I see that now could be confusing, $\vec{e_1}=\vec{i}, \vec{e_2}=\vec{j}, \vec{e_3}=\vec{k}$ –  Freeman Dec 6 '12 at 19:02

Sorry, this is a bit too late but here goes.

The first thing is to rewrite the cross product using indices and the summation convention

$\mathbf{x} \times \mathbf{t}|_r = \epsilon_{rmn} x_m t_n$

where $\epsilon_{rmn}$ is the Levi-Civita symbol.

Now rewrite the traction vector $t_n$ as $\sigma_{jn} n_j$ which is how you sneak a normal into the equation.

Before you can apply the Divergence theorem to the resulting integral, ie.

$\int_{S} \epsilon_{rmn} x_m \sigma_{jn} n_j dS$

you have to understand that the integrand without the $n_j$ is an object $T$ with two free indices. So you can think of this integrand as

$\int_{S} T_{rj} n_j dS$

By the Divergence theorem this is

$$\int_{S} T_{rj} n_j dS = \int_{V} \frac{\partial T_{rj}}{\partial x_j} dV$$

Now you can resub for $T_{rj}$, so the integral is

$$\int_{V} \frac{\partial ({\epsilon_{rmn} x_m \sigma_{jn}})}{\partial x_j} dV$$

Take the constant $\epsilon$ out, apply partial derivatives and simplify; you get

$$\int_{V} \epsilon_{rmn} \left ( \sigma_{mn} + x_m \frac{\partial {\sigma_{jn}}}{\partial x_j} \right) dV$$

You can proceed from here. You'll see the momentum balance appear if you group the other terms, and you'll finally just have

$$\int_{V} \epsilon_{rmn} \sigma_{mn} dV = 0$$

which yields the result because $V$ is an arbitrary fluid volume and the Levi-Civita symbol is skew-symmetric.

-


text:
# zbMATH — the first resource for mathematics

Analysis and application of ellipticity of stability equations on fluid mechanics. (English) Zbl 1145.76381
Summary: By using characteristic analysis of the linear and nonlinear parabolic stability equations (PSE), PSE of primitive disturbance variables are proved to be parabolic in total. By using sub-characteristic analysis of PSE, the linear PSE are proved to be elliptical and hyperbolic-parabolic for velocity $$U$$ in subsonic and supersonic, respectively; the nonlinear PSE are proved to be elliptical and hyperbolic-parabolic for velocity $$U+u$$ in subsonic and supersonic, respectively. Methods are gained that remove the remaining ellipticity from the PSE by characteristic and sub-characteristic theories, the results for the linear PSE are consistent with the known results, and the influence of the Mach number is also given out. At the same time, the methods of removing the remained ellipticity are further obtained from the nonlinear PSE.
##### MSC:
 76E30 Nonlinear effects in hydrodynamic stability 35Q35 PDEs in connection with fluid mechanics 35K55 Nonlinear parabolic equations 35K65 Degenerate parabolic equations
Full Text:
##### References:
 [1] Herbert Th, Bertolotti F P. Stability analysis of non-parallel boundary layers[J].Bull American Phys Soc, 1987,32(8):2097. · Zbl 0748.76050 [2] GAO Zhi. Grade structure theory for the basic equations of fluid mechanics (BEFM) and the simplied Navier-Stokes equations (SNSE) [J].Acta Mechanica Sinica, 1988,20(2), 107–116. (in Chinese) [3] Herbert Th. Nonlinear stability of parallel flows by high-order amplitude expansions[J].AIAA J, 1980,18(3):243–248. · Zbl 0427.76046 · doi:10.2514/3.50755 [4] Haj-Hariri H. Characteristics analysis of the parabolic stability equations [J].Stud Appl Math, 1994,92(1):41–53. · Zbl 0802.76025 [5] Chang C L, Malik M R, Erleracher G,et al. Compressible stability of growing boundary layers using parabolic stability equations[Z].AAIA 91–1636, New York: AAIA, 1991. [6] GAO Zhi. Grade structure of simplified Navier-Stokes equations and its mechanics meaning and application[J].Science in China, Ser A, 1987,17(10):1058–1070. (in Chinese) [7] GAO Zhi, ZHOU Guang-jiong. Some advances in high Reynolds numbers flow theory, algorithm and application[J].Advances in Mechanics, 2001,31(3):417–436. [8] GAO Zhi, SHEN Yi-qing. Discrete fluid dynamics and flow numerical simulation [A]. In: F Dubois, WU Hua-mu Eds.New Advances in Computational Fluid Dynamics [C]. Beijing: Higher Education Press, 2001, 204–229. [9] Schlichting H.Boundary-Layer Theory[M]. 7th ed. New York: McGraw-Hill, 1979. · Zbl 0434.76027
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.

format: plain


text:
{{ message }}

Instantly share code, notes, and snippets.

# dan mackinlay danmackinlay

Created Jul 15, 2014 — forked from sixtenbe/analytic_wfm.py
View peakdetect.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 import numpy as np from math import pi, log import pylab from scipy import fft, ifft from scipy.optimize import curve_fit i = 10000 x = np.linspace(0, 3.5 * pi, i) y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 * np.random.randn(i))
Created Mar 2, 2012
gpu kernel panic report
View gist:1954656
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Fri Mar 2 11:04:59 2012 panic(cpu 0 caller 0xffffff7f80a87907): NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xc0000000 0xffffff8115c2d000 0x0a5480a2, D0, P3/4 Backtrace (CPU 0), Frame : Return Address 0xffffff811560ae70 : 0xffffff8000220702 0xffffff811560aef0 : 0xffffff7f80a87907 0xffffff811560af80 : 0xffffff7f80b77a64 0xffffff811560afd0 : 0xffffff7f80b77b24 0xffffff811560b030 : 0xffffff7f80e24749 0xffffff811560b170 : 0xffffff7f80b96bad 0xffffff811560b1a0 : 0xffffff7f80a91282
Created Jan 30, 2012
View log.sc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* * file-based loggers, because logging to a GUI window is no good when SuperCollide does its segfault thing. */ NullLogger { /* this parent class provdes a black hole logger so that you can stop logging without changing code. */ formatMsg {|msgs| var stampedMsgs = msgs; //A nil in the first msg argument will be replaced by a datestamp msgs[0].isNil.if({
Created Jan 26, 2012 — forked from terryrjb/information_criticality_society.texjn
View information_criticality_society.texjn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 information and Phase Transitions in Socio-Economic Systems Terry Bossomaier, Dan Mackinlay, Lionel Barnett... \section{Introduction} \label{sec:intro} Diamonds are not a good very long term investment! They are steadily turning into graphite. It will take millions of years, but the most stable form of carbon at room temperature and pressure is graphite. Thus diamonds will undergo a phase transition to graphite, albeit over a very long timescale. When we normally think of phase transitions we think of the states of matter, ice melting to water or water turning to steam. They are order/disorder transitions. In graphite the carbon atoms are linked together in layers. The layers can slide over one another giving graphite its excellent lubricant properties. In diamond the carbon atoms are linked together in a three dimensional structure with each carbon at the centre of a tetrahedron linked to carbons at all four corners. Thus carbon has to go through a major structural reorganization to change from diamond t
Created Jan 23, 2012
View information_criticality_society.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 information and Phase Transitions in Socio-Economic Systems Terry Bossomaier, Dan Mackinlay, Lionel Barnett... \section{Introduction} \label{sec:intro} Diamonds are not a good very long term investment! They are steadily turning into graphite. It will take millions of years, but the most stable form of carbon at room temperature and pressure is graphite. Thus diamonds will undergo a phase transition to graphite, albeit over a very long timescale. When we normally think of phase transitions we think of the states of matter, ice melting to water or water turning to steam. They are order/disorder transitions. In graphite the carbon atoms are linked together in layers. The layers can slide over one another giving graphite its excellent lubricant properties. In diamond the carbon atoms are linked together in a three dimensional structure with each carbon at the centre of a tetrahedron linked to carbons at all four corners. Thus carbon has to go through a major structural reorganization to change from diamond t
Created Jan 16, 2012
pure python bezier smoothing for matplotlib
View bezier_smooth_plot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 """ For http://stackoverflow.com/q/5255932 """ def tangent_interpolate(index, x_array, y_array, dist=0.5): before_index = max(index - 1, 0) after_index = min(index + 1, len(x_array)) chord_vector_x = x_array[after_index] - x_array[before_index] chord_vector_y = y_array[after_index] - y_array[before_index] if dist>0:
Created Nov 25, 2011
reduce PDF file size by optimising it for screen viewing
View shrinkpdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/bin/bash # copied from http://www.tatome.de/bliki/doku.php?id=projects:shrinkpdf if [ $# -lt 2 ] || [$# -gt 3 ]; then echo usage: shrinkpdf \ \ $\$ exit fi if [ ! -e "$1" ]; then echo "$1" does not exist. Exiting.
Created Nov 3, 2011
Submit jobs with arguments to openPBS
View run_script_with_args.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/bin/sh # Because OpenPBS is fucked, it cannot pass arguments to scripts, but only set environment variables. # So we build this sophisticated functionality for ourselves, using a tottering monolith of subtle and # hairy code that shows how functionality such as this might be accomplished despite # the fierce difficulty, and yet how it is clearly such a shambolic affair that it can not possibly have seemed # reasonable to provide as a service to users # # Usage: # qsub run_script_with_args.sh -v 'PBS_COMMAND=ls -l' exec \$PBS_COMMAND
Created Oct 18, 2011 — forked from tkf/gdmp.py
View gdmp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env python """ Command line tool for google-diff-match-patch """ from diff_match_patch import diff_match_patch HTMLTEMP = '''\
Created Oct 14, 2011
View welcome.md

# Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.


text:
• ### To Do Lessons

Mathematics » Introducing Polynomials » Integer Exponents and Scientific Notation

# Multiplying and Dividing Using Scientific Notation

This is a lesson from the tutorial, Introducing Polynomials and we encourage you to log in or register before you continue, so that you can track your progress.

## Multiplying and Dividing Using Scientific Notation

We use the Properties of Exponents to multiply and divide numbers in scientific notation.

## Example

Multiply. Write answers in decimal form: $$\left(4\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{5}\right)\left(2\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{-7}\right).$$

### Solution

 $$\left(4\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{5}\right)\left(2\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{-7}\right)$$ Use the Commutative Property to rearrange the factors. $$4·2·{10}^{5}·{10}^{-7}$$ Multiply 4 by 2 and use the Product Property to multiply $${10}^{5}$$ by $${10}^{-7}$$. $$8\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{-2}$$ Change to decimal form by moving the decimal two places left. $$0.08$$

## Example

Divide. Write answers in decimal form: $$\frac{9\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{3}}{3\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{-2}}.$$

### Solution

 $$\frac{9\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{3}}{3\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{-2}}$$ Separate the factors. $$\frac{9}{3}\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}\frac{{10}^{3}}{{10}^{-2}}$$ Divide 9 by 3 and use the Quotient Property to divide $${10}^{3}$$ by $${10}^{-2}$$. $$3\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}{10}^{5}$$ Change to decimal form by moving the decimal five places right. $$300,000$$


text:
# Batch script to build a Python package using the Windows SDK

I'm currently building 64-bit extensions on Windows following the instruction in Compiling 64-bit extension modules on Windows.

I want to script this, so I don't have to open the Windows SDK Command Shell every time I want to do this, so I have a batch file:

setlocal EnabledDelayedExpansion
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /x64 /release
set DISTUTILS_USE_SDK=1
\path\to\python.exe \path\to\setup.py bdist --format=msi

However, I get these errors. How do I get cl.exe back on the path?

Could not locate executable cl.exe
Executable cl.exe does not exist

Fair warning, I know little about building extensions on Windows as is obvious from this post, so please suggest a better way if there is one.

EDIT: The original call to SetEnv.cmd does raise an error.

The x64 compilers are not currently installed.
.
Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
.
The system cannot find the batch label specified - Set_x64

There are then some errors for various commands I use based on the system path (e.g., subprocess calls to git that it can't find git).

CL.exe is installed here at C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\cl.exe. If I just open the Windows SDK Cmd Shell by the shortcut and install the usual way from here, it is found.

-
How did you take it off the path in the first place? – Ignacio Vazquez-Abrams Apr 10 '12 at 16:06
I didn't take it off the path. It's not available on the path in the batch file environment. I assume it happens by the call to the SetEnv.cmd. When running the Windows SDK Command Shell, it calls CMD.exe with the /K option, which I suspect has something to do with it. I don't know how to replicate such behavior in a batch file. – jseabold Apr 10 '12 at 16:12
Christoph, I edited the original post with some more information. – jseabold Apr 10 '12 at 17:36
Ah, ok. Well, unfortunately, we have a bit of magic that checks for a C compiler and it does not detect a C compiler installing this way. Either I have to set compiler=mingw32 in distutils.cfg for 32-bit or install from the SDK environment. github.com/statsmodels/statsmodels/blob/master/tools/… Maybe I could uninstall VS and reinstall the SDK compiler? – jseabold Apr 10 '12 at 18:41
If I set compiler=msvc in distutils.cfg. I get error: Unable to find vcvarsall.bat which I do not have anywhere on my machine. See other comment thread. – jseabold Apr 10 '12 at 20:23

For posterity's sake. This works as expected. However, there's a typo in my batch file. If you replace the first line with

setlocal EnableDelayedExpansion

Everything works as expected. The problem was that !PATH! wasn't being properly expanded in SetEnv.cmd.

-

My solution to this problem is to use a Python script - it's much easier for me than a Windows batch script. You can use the subprocess module to call other programs, and it will keep you environment variables intact, unless you explicitly change them.

BTW, Cython is not the only way of compiling Python to an EXE file. You can use a tool like cz_freeze too, which I think is slightly easier if you don't need the other features of Cython.

-

If Visual Studio is installed in your system, add a step in your batch script to run vcvarsall.bat. For ex if Visual Studio 2010 is installed, this batch file should be present in

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat",

or which ever drive you have installed Visual Studio, provided you did not override the default installation location.

-
I don't have vcvarsall.bat. I have C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat, but adding a call to it did not seem to fix the problem. – jseabold Apr 10 '12 at 17:41


text:
Conference Paper

# Characterization of Matrices Generating Orthogonal Multi-Wavelets

Coll. of Sci., China Three Gorges Univ., Yichang, China
DOI: 10.1109/CSO.2009.32 Conference: Computational Sciences and Optimization, 2009. CSO 2009. International Joint Conference on, Volume: 1
Source: IEEE Xplore

ABSTRACT

Theoretically, multiwavelets hold significant advantages over standard wavelets, particularly for solving more complicated problems, and hence are of great interest. It is pointed out in this paper that we must avoid those "multi-wavelets" being just pairs of standard wavelets. The main purpose of this paper is to charaterize a class of matrices which is crucial for the construction of orthogonal multi-wavelets with uniform linear phase.

0 Followers
·
• Source
##### Article: Approximation Orders of FSI Spaces in L 2 (R d )
[Hide abstract]
ABSTRACT: A second look at the authors' [BDR1], [BDR2] characterization of the approximation order of a Finitely generated Shift-Invariant (FSI) subspace of L 2(R d ) results in a more explicit formulation entirely in terms of the (Fourier transform of the) generators of the subspace. Further, when the generators satisfy a certain technical condition, then, under the mild assumption that the set of 1-periodizations of the generators is linearly independent, such a space is shown to provide approximation order k if and only if contains a (necessarily unique) satisfying for |j|<k , . The technical condition is satisfied, e.g., when the generators are at infinity for some >k+d. In the case of compactly supported generators, this recovers an earlier result of Jia [J1], [J2].
Constructive Approximation 01/1998; 14(4):631-652. DOI:10.1007/s003659900094 · 1.15 Impact Factor
• ##### Article: Multivariate Filter Banks Having Matrix Factorizations
[Hide abstract]
ABSTRACT: We design vector-valued multivariate filter banks with a polyphase matrix built by a matrix factorization. These filter banks are suitable for the construction of multivariate multiwavelets with a general dilation matrix. We show that block central symmetric orthogonal matrices provide filter banks having a uniform linear phase. Several examples are included to illustrate our construction.
SIAM Journal on Matrix Analysis and Applications 01/2003; 25(2):517-531. DOI:10.1137/S0895479802412735 · 1.59 Impact Factor
• ##### Book: Matrix Analysis
01/1996; Springer.


text:
# The number of regions into which a plane is divided by n lines in generic position [duplicate]

Suppose that $n$ lines are drawn on a plane in such a way that no lines are parallel and no three of them intersect at a point. Let $r(n)$ be the number of regions the plane is divided into after drawing the $n$ lines. Find a recursive formula and prove it without induction.

### Progress

I found that the formula $r(n)=r(n-1) + n$ works but am having trouble proving it.

## marked as duplicate by Joel Reyes Noche, user147263, Rebecca J. Stones, Surb, Najib IdrissiMar 12 '15 at 9:20

Suppose that you have $n$ lines and $r(n)$ regions, and you add a line that is not parallel to any of the current $n$ and does not pass through any point where two of them intersect. The new line must intersect each of the $n$ original lines in a single point; why? Suppose that it intersects them in the points $p_1,\ldots,p_n$, in that order. These $n$ points divide the new line into $n+1$ sections: the $n-1$ bounded sections $\overline{p_1p_2},\overline{p_2p_3},\ldots,\overline{p_{n-1}p_n}$, and the unbounded rays ‘before’ $p_1$ and ‘after’ $p_n$. Each of these sections divides a region into two regions, so each of them adds one region to the total. Therefore $r(n+1)=r(n)+\ldots\;$?


text:
# Finding a secret cipher given the key and known plaintext?

Let $x,y,k$ be plain text, cipher text and key respectively. Also suppose $\operatorname{Enc}$ is the algorithm of encryption for block cipher with size $n$. So we have $$\operatorname{Enc}_k(x)=y$$

We know that if $x,y$ are given finding $k$ for big $n$ is so hard. Now we change the problem:

Let $k$(with size $l$) be given and $\operatorname{Enc}$ secret. We want to find the function for $\operatorname{Enc}$. At least how many $(x,y)$ are needed to find $\operatorname{Enc}$?

• Hint: assume $\operatorname{Enc}_k(x)$ is defined as $\operatorname{AES-128}_{k\oplus c}(x)$ for some unknown 128-bit constant $c$. – fgrieu Jan 26 '16 at 21:13
• @fgrieu, key is constant and I know it. Algorithm of encrypting is unknown. What is relation between your comment and my question? – Meysam Ghahramani Jan 27 '16 at 17:28
• The function that I propose is a partially unknown function, since you do not know $c$. Hence if one could solve your problem in general, (s)he could find the constant $c$ in my function. – fgrieu Jan 27 '16 at 19:11

As fgrieu hints at in the comments, it is not in general possible to find $\operatorname{Enc}$. Otherwise you would be able to break an arbitrary block cipher, because the key of any block cipher can be cast as part of the algorithm instead.
Even if you ignore the computational cost, there is no way to find $\operatorname{Enc}$ given values for only one $k$, even if you know all pairs $x, y$ for that key. There is of course a limited number of (distinct) $n$-bit block ciphers with $l$-bit keys, but the different keys can be completely independent.
For example, I could define AES' which works just like AES, except with the key value $42$ it performs the identity permutation instead. You could not know that difference from observing the outputs for any other keys.


text:
Large eddy simulation of turbulent cavitating flow in a venturi nozzle is conducted. The fully compressible Favre-filtered Navier–Stokes equations are coupled with a homogeneous equilibrium cavitation model. The dynamic Smagorinsky subgrid-scale turbulence model is employed to close the filtered nonlinear convection terms. The equations are numerically integrated in the context of a generalized curvilinear coordinate system to facilitate geometric complexities. A sixth-order compact finite difference scheme is employed for the Navier–Stokes equations with the $AUSM+-up$ scheme to handle convective terms in the presence of large density gradients. The stiffness of the system due to the incompressibility of the liquid phase is addressed through an artificial increase in the Mach number. The simulation predicts the formation of a vapor cavity at the venturi throat with an irregular shedding of the small scale vapor structures near the turbulent cavity closure region. The vapor formation at the throat is observed to suppress the velocity fluctuations due to turbulence. The collapse of the vapor structures in the downstream region is a major source of vorticity production, resulting into formation of hair-pin vortices. A detailed analysis of the vorticity transport equation shows a decrease in the vortex-stretching term due to cavitation. A substantial increase in the baroclinic torque is observed in the regions where the vapor structures collapse. A spectra of the pressure fluctuations in the far-field downstream region show an increase in the acoustic noise at high frequencies due to cavitation.

1.
Brennen
,
C. E.
, 1995,
Cavitation and Bubble Dynamics
,
Oxford University Press
,
Oxford
.
2.
Seo
,
J. H.
,
Moon
,
Y. J.
, and
Shin
,
B. R.
, 2008, “
Prediction of Cavitating Flow Noise by Direct Numerical Simulations
,”
J. Comput. Phys.
0021-9991,
227
, pp.
6511
6531
.
3.
Knapp
,
R. T.
, 1995, “
Recent Investigation on the Mechanics of Cavitation and Erosion Damage
,”
Trans. ASME
0097-6822,
77
, pp.
1045
1054
.
4.
Stutz
,
B.
, and
Reboud
,
J.
, 1997, “
,”
Exp. Fluids
0723-4864,
22
, pp.
191
198
.
5.
Pham
,
T.
,
Larrarte
,
F.
, and
Fruman
,
D.
, 1999, “
Investigation of Unsteady Sheet Cavitation and Cloud Cavitation Mechanisms
,”
ASME J. Fluids Eng.
0098-2202,
121
, pp.
289
295
.
6.
De Lange
,
F.
, and
De Bruin
,
J.
, 1997, “
Sheet Cavitation and Cloud Cavitation, Re-Entrant Jet and Three-Dimensionality
,”
Appl. Sci. Res.
0003-6994,
58
, pp.
91
114
.
7.
Callenaere
,
M.
,
Franc
,
J. -P.
,
Michel
,
J. -M.
, and
Riondet
,
J.
, 2001, “
The Cavitation Instability Induced by the Development of a Re-Entrant Jet
,”
J. Fluid Mech.
0022-1120,
444
, pp.
223
256
.
8.
Coutier-Delgosha
,
O.
,
Reboud
,
J. L.
, and
Delannoy
,
Y.
, 2003, “
Numerical Simulation of the Unsteady Behaviour of Cavitating Flows
,”
Int. J. Numer. Methods Fluids
0271-2091,
42
, pp.
527
548
.
9.
Kawanami
,
Y.
,
Kato
,
H.
,
Yamaguchi
,
H.
,
Tanimura
,
M.
, and
Tagaya
,
Y.
, 1997, “
Mechanism and Control of Cloud Cavitation
,”
ASME J. Fluids Eng.
0098-2202,
119
, pp.
788
794
.
10.
Gopalan
,
S.
, and
Katz
,
J.
, 2000, “
Flow Structure and Modeling Issues in the Closure Region of Attached Cavitation
,”
Phys. Fluids
0031-9171,
12
, pp.
895
911
.
11.
Iyer
,
C.
, and
Ceccio
,
S.
, 2002, “
The Influence of Developed Cavitation on the Flow of a Turbulent Shear Layer
,”
Phys. Fluids
0031-9171,
14
, pp.
3414
3430
.
12.
Shin
,
B. R.
,
Yamamoto
,
S.
, and
Yuan
,
X.
, 2004, “
Application of Pre-Conditioning Method to Gas-Liquid Two-Phase Flow Computations
,”
ASME J. Fluids Eng.
0098-2202,
126
, pp.
605
612
.
13.
Singhal
,
A.
,
Athavale
,
M. M.
,
Li
,
H.
, and
Yu
,
J.
, 2002, “
Mathematical Basis and Validation of Full Cavitation Model
,”
ASME J. Fluids Eng.
0098-2202,
124
, pp.
617
624
.
14.
Lele
,
S. K.
, 1992, “
Compact Finite Difference Schemes With Spectral-Like Resolution
,”
J. Comput. Phys.
0021-9991,
103
, pp.
16
42
.
15.
Liou
,
M. S.
, 2006, “
A Sequel to AUSM, Part II: AUSM+-UP for All Speeds
,”
J. Comput. Phys.
0021-9991,
214
, pp.
137
170
.
16.
Liu
,
T. G.
,
Khoo
,
B. C.
, and
Xie
,
W.
, 2004, “
Isentropic One-Fluid Modelling of Unsteady Cavitating Flow
,”
J. Comput. Phys.
0021-9991,
201
, pp.
80
108
.
17.
Coutier-Delgosha
,
O.
,
Fortes-Patella
,
R.
, and
Reboud
,
J.
, 2004, “
Test Case Number 30: Unsteady Cavitation in a Venturi Type Section (PN)
,”
Multiphase Sci. Technol.
0276-1459,
16
, pp.
207
218
.
18.
Wilcox
,
C. D.
, 2004,
Turbulence Modeling for CFD
,
DCW Industries Inc.
,
California
.
19.
Poinsot
,
T.
, and
Lele
,
S. K.
, 1992, “
Boundary Conditions for Direction Simulations of Compressible Viscous Flows
,”
J. Comput. Phys.
0021-9991,
101
, pp.
104
129
.
20.
Colonius
,
T.
,
Moin
,
P.
, and
Lele
,
S. K.
, 1995, “
Direct Computation of Aerodynamic Sound
,” Technical Report No. TF-65, Stanford University, Stanford, CA.
21.
,
B.
,
Franc
,
P.
, and
Michel
,
M.
, 1995, “
Cavitation in the Rotational Structures of a Turbulent Wake
,”
J. Fluid Mech.
0022-1120,
287
, pp.
383
403
.
22.
Xing
,
T.
,
Li
,
Z.
, and
Frankel
,
S.
, 2005, “
Numerical Simulation of Vortex Cavitation in a Three Dimensional Submerged Transitional Jet
,”
ASME J. Fluids Eng.
0098-2202,
127
, pp.
714
725
.
23.
Laberteaux
,
K.
and
Ceccio
,
L.
, 2001, “
Partial Cavity Flows. Part 1: Cavities Forming on Models Without Spanwise Variation
,”
J. Fluid Mech.
0022-1120,
431
, pp.
1
41
.
24.
Laberteaux
,
K.
and
Ceccio
,
L.
, 2001, “
Partial Cavity Flows. Part 2: Cavities Forming on Test Objects With Spanwise Variation
,”
J. Fluid Mech.
0022-1120,
431
, pp.
43
63
.


text:
# Properties of Square Roots | Square Root Properties

In this section, we will discuss all properties of square roots.

##### Property 1

If a number is a perfect square, then its square root will be a whole number. For example, we know that 100 is a perfect square number. Its square root √100=10 is a whole number.

More examples of perfect squares: $4, 9, 16, 25, 36, 49, 64, 81$ etc.

##### Property 2

The square root is denoted by the radical symbol $\sqrt{}.$ If $x$ is a non-perfect number, then its square root $\sqrt{x}$ is a quadratic surd. In this case, $\sqrt{x}$ will be an irrational number.

For example, as $11$ is not a perfect square, $\sqrt{11}$ represents an irrational number.

##### Property 3

The square root can be expressed as power 1/2. So the square root of a number $x$ is written as $x^{1/2}$or $x^{0.5}$ in exponential form (Laws of Exponents).

For example, $5^{1/2}$ or $5^{0.5}$ is the exponential form of the square root of $5.$

##### Property 4

If the square root of a number is an integer, then the integer has the last digit $0, 1, 4, 5$ and $9.$ Thus if an integer is the square root of some numbers, then the integer cannot have the last digit $2, 3, 6, 7$ or $8.$

For example: √100=10, √121=11, √16=4, √25=5, √81=9. Note that all these square roots end with the digits $0, 1, 4, 5$ or $9.$

##### Property 5

If the last digit of a number is either $2, 3, 7$ or $8,$ then the square root of that number cannot be a whole number. Thus, the square root of any even number with last digit 2 or 8 is an integer.

For example, the square roots of the numbers 22, 228, 888, 772 are not integers.

##### Property 6

As $0^2=0,$ $1^2=1,$ $2^2=4,$ $3^2=9,$ $4^2=16,$ $5^2=25,$ $6^2=36,$ $7^2=49,$ $8^2=64$ and $9^2=81$, we deduce the following Important Properties for the square root of a number:

1. If a number has last digit $0,$ then its square root will have the last digit $0.$

2. If a number has last digit $1,$ then its square root will have the last digit either $1$ or $9.$

3. If a number has last digit $4,$ then its square root will have the last digit $2.$

4. If a number has last digit $5,$ then its square root will have the last digit $5.$

5. If a number has last digit $6,$ then its square root will have the last digit either $4$ or $6.$

6. If a number has last digit $9,$ then its square root will have the last digit either $3$ or $7.$

##### Property 7

The square root of an even number is always even. For example, $\sqrt{64}=8.$ Note that both $8$ and $64$ are even numbers.

##### Property 8

The square root of an odd number is always odd. For example, √121=11. Note that both 11 and 121 are odd numbers.

##### Property 9

If a number ends with an even number of zeros, then the square root of that number will be an integer.

For example, 100 has 2 zeros at the end and √100=10 is an integer. Similarly, the number 10000 ends with four zeros, and its square root √10000=100 is an integer.

##### Property 10

If a number ends with an odd number of zeros, then the square root of that number will not be a whole number. As a result, we can say that the square root of a number with an odd number of zeros at the end will be an irrational number.

For example, 10 has only one zero at the end and √10 is not a rational number. Similarly, the number 1000 ends with three zeros, and its square root √1000 is also an irrational number.

##### Property 11

If $x$ is a square root of a number X, then $-x$ is also a square root of the number $X.$ More specifically, we have $\sqrt{X}=\pm x.$

##### Property 12

The square root of a negative number does not exist in the set of real numbers. But they do exist in the set of complex numbers. Note that the square root of a negative number is called a purely imaginary number. For example,

$\sqrt{-7}=\sqrt{7 \times -1}$ $=\sqrt{7} \times \sqrt{-1}$ $=7i,$

where $i=\sqrt{-1}$ (a square root of 1).

##### Property 13

For a natural number $n,$ the square $n^2$ is equal to the sum of first $n$ odd numbers. Mathematically, 1+3+5+…+(2n-1)=n2, that is, the sum of first n odd natural numbers is n2.

For example, 25 = 52 = 1+3+5+7+9 = the sum of first 5 odd numbers.

##### Property 14

Multiplication rule for square roots: For two numbers $x$ and $y,$ we have $\sqrt{x \times y}=\sqrt{x} \times \sqrt{y}.$

This shows that the square root of the product of two numbers is equal to the product of the square roots of those two numbers. The same rule holds for more than two numbers.

For example, $\sqrt{8}=\sqrt{4 \times 2}$ $=\sqrt{4} \times \sqrt{2}$

##### Property 15

Division rule for square roots: For two numbers $x$ and $y$ with $y \neq 0,$ we have $\sqrt{\frac{x}{y}}=\frac{\sqrt{x}}{\sqrt{y}}.$

∴ the quotient of the square roots of two numbers is the same as the square root of the quotient of those two numbers.

For example, $2=\sqrt{\frac{8}{2}}=\frac{\sqrt{8}}{\sqrt{2}}$


text:
# Revision history [back]

To check the first one

sage: bool(diff(F1) == F2^2)
True

However, I doubt the others are correct as evaluating at a specific x the difference you do not get a zero

sage: B = diff(F2) - (F1*F2 + G1)
sage: B.subs(x=0)
1
sage: C = diff(G1) - (F2*(F2-G2)+F2)
sage: C.subs(x=1).n()
10.5654556363032
sage: D = diff(G2) - (F2*(F1-G1)+G1)
sage: D.subs(x=0)
1


text:
# Defining unordered pairs in set theory

I am reading Naive Set Theory by Paul Halmos and am on section 3 (page 9) where he is talking about the axiom of pairing. In his explanation he states that a and b are two sets and A is the set containing a and b. He defines the unordered pair {a,b} as

$$\{x \epsilon A: x=a \ \ or \ \ x=b\}$$

1. How do we know that the set/unordered pair contains both of the sets a and b if the condition for the element x of the given set is that it is equal to a or equal to b (I'm interpreting the 'or' as the logical operator).

2. If A had no elements other than the sets a and b, does A={a,b}?

3. Is {a,b} read as 'the set containing a and b (and the empty set)'?

• The word "contains" is ambiguous and sometimes means "as an element" and sometimes "as a subset". If $x$ is an element of $X$, then it is not necessarily a subset. So $X$ contains $x$ as an element, but not necessarily as a subset. – Asaf Karagila Dec 28 '18 at 7:56
• Further to @AsafKaragila's point, in terms of subsets it "contains" $\{a\}$ etc. – J.G. Dec 28 '18 at 8:14

I think you mean that $$A$$ is a set containing $$a$$ and $$b$$ (but perhaps contains other sets, so there could be other sets containing both $$a$$ and $$b$$—like $$\{a,b\}$$ itself). There is not such thing as the set containing $$a$$ and $$b$$.

What there is, though, is the set containing exactly $$a$$ and $$b$$ and nothing else; what is defined as $$\{a,b\}$$. Don't be confused by the or in the definition: it is not a set containing $$a$$ or $$b$$, but the set whose elements $$x$$ are in $$A$$ and also satisfy the condition $$x=a \vee x=b$$. If $$x=a$$, then satisfies the condition, and so $$x=a\in \{a,b\};$$ if $$x=b$$, then satisfies the condition, and so $$x=b\in \{a,b\};$$ if none of $$x=a$$ or $$x=b$$ is true, then $$x\notin \{a,b\},$$ so $$\{a,b\}$$ contains both $$a$$ and $$b$$, but nothing different from them both. Also, if both $$x=a$$ and $$x=b$$ are true, which implies $$a=b$$, then $$x\in \{a,b\}$$, too (the set contains only one element).

Your second affirmation is true, since two sets are equal if they have the same elements, or more precisely $$A=B \iff (x\in A \iff x\in B).$$

Finally, $$\{a,b\}$$ does not necessarily contain $$\emptyset$$; just $$a$$ and $$b$$. It only turns out to be the case that $$\emptyset \in \{a,b\}$$ if $$a=\emptyset$$ or $$b=\emptyset$$ (or both, of course).

You should not confuse the statements $$x\in A$$ and $$x\subset A.$$ While in common speech both could be read as '$$x$$ is contained in $$A$$', I'm only using this expression to mean the former, not the later. The former is also read as '$$x$$ is one of the elements of the set $$A$$'. The later, instead, means that every element of the set $$x$$ is also an element of the set $$A$$, but not necessarily that $$x$$ is itself an element of the set $$A$$ (this could be the case, though).

Since it is never the case that some set is an element of $$\emptyset$$, it is true for any set $$A$$ that $$\emptyset \subset A,$$ but not always $$\emptyset \in A.$$

1. You can verify $$a$$ satisfies the condition $$x=a\lor x=b$$, so $$a\in A$$. Similarly, $$b\in A$$.
2. Yes.
3. It has $$a$$ and $$b$$ as elements and nothing else, and in particular $$\emptyset\not\in\{a,\,b\}$$ (unless $$a=\emptyset\lor b=\emptyset$$).
• @drhab Thanks; fixed. – J.G. Dec 28 '18 at 15:23


text:
# Deriving the standard error of the mean formula

I don't understand , here $X$ is data like for ex. height in a class :

$X_1=186cm$

$X_2=186.9cm$

$X_3=188cm$

and so on ... or they are independent random vars like one var for height other for weight and so on ?

The first step is confusing for me , please explain the following :

The variance of $T=(X_1+X_2+X_3 + ... X_n)$ is $n\sigma^2$

Why ?

The variance of the sum of independent random variables is the sum of their variances. So if $X_1$, $X_2$... all have variance $\sigma^2$ then the sum is $n\sigma^2$.
• so the $X_i$ here are all random vars, it confused me because the article says observations .... so I thought that they meant observations for a particular random var. – Oleg Mar 22 '17 at 0:24


text:
# Difference between revisions of "Codebusters"

This page contains a large number of equations and mathematical symbols, which may take some time to load.

Codebusters is an event in Division C for the 2020 season and was held as trial event at both the 2016 National Tournament and the 2018 National Tournament. It was last held as an official event in 2019. It is also being held as a trial event for Division B at the 2020 National Tournament. In this event, up to 3 participants must decode encrypted messages, or they may be required to encode messages with certain advanced ciphers. Competitors are not allowed to bring any resources to this event, but can bring a 4 or 5 function calculator - no scientific or graphing calculators allowed.

## Test Format

### Format and Scoring

Tests are composed of a variety of questions where teams will encrypt or decrypt various code types. The number of questions on a given test is variable, but tests often contain anywhere from 6-24 questions, depending on the difficulty of the questions. The first question of a test is timed, and a time bonus is given for the question based on how quickly it is completed. Points may be deducted from questions based on the number of mistakes found in the answer given. If the answer differs from the solution by only one or two letters, then no points are removed, despite the answer having errors. Each additional error after two errors will result in a deduction of 100 points. The number of points removed from a question through deductions will not exceed the value of the question (meaning that deductions will never result in a question score below 0).

#### The First Question

The very first question is timed - when solved, a team member should signal the event supervisor that they have finished the question, such as raising their hand, shouting "bingo!", or another method determined by the supervisor before the event begins. The first question will be an Aristocrat with or without a hint. Teams will receive bonus points depending on their time, and they may make as many attempts as they want to break the code without any penalties. The timing bonus will be calculated from the start of the event until the question is answered successfully, or until 10 minutes have elapsed, and is calculated with the formula: 4*(600-number of seconds taken). Teams may still answer the question after 10 minutes; however, the timing bonus is 0. The first cryptogram may also be used as a tiebreaker. Solutions are given full points only if the solution is an exact match or differs by only one or two letters. Deductions for inconsistencies in the answer to the first question are treated the same as deductions for a non-timed question.

### Question Point Distribution

The amount of points each question is worth will be distributed by the following:

• An easy question: 100-150 points
• A medium question: 200-300 points
• A hard question: 350-500 points
• A very hard question: 550-700 points

In the case of a tie, select questions predetermined by the event supervisor will serve as a tiebreaker. The tie is broken using the following criteria in this order: score, degree of correctness, and number attempted.

## Code Types

### Atbash Cipher

The Atbash Cipher is a variant of the affine cipher (see above) in which both a and b equal 25. This results in the alphabet essentially becoming a mirror (A corresponds to Z, B corresponds to Y, C corresponds to X, etc.).

 Original Alphabet Ciphertext Alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Z Y X W V U T S R Q P O N M L K J I H G F E D C B A

Following the affine cipher, the encryption formula would be:

$E(x) = (25x + 25) \mod 26$

However, observing the mirror like alphabet yields a much simpler equation of:

$E(x) = D(x) = 25 - x$

Since the alphabet is like a mirror, encryption is the same as decryption.

#### Encryption Example

Encode "encrypt" with the Atbash Cipher.

 Plaintext Numeric Component $25 - x$ Ciphertext E N C R Y P T 4 13 2 17 24 15 19 21 12 23 8 1 10 6 V M X I B K G

The cipher text is "vmxibkg."

#### Decryption Example

Decode "decrypt" with the Atbash Cipher.

 Plaintext Numeric Component $25 - x$ Ciphertext Z M H D V I 25 12 7 3 21 8 0 13 18 22 4 17 A N S W E R

The plaintext is "answer."

### Caesar Cipher

One example of a mono-alphabetic substitution is Caesar shift cipher, where each letter is replaced by one shifted by a certain amount. For example, the following table has each letter shifted three positions to the right.

 Original Alphabet Shifted Alphabet (to the right 3) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

From this table, it is clear that each shifted letter is the same as the original letter three spaces from it (A becomes D, B becomes E, etc). Thus, a message like "Science Olympiad is cool" would become "Vflhqfh Robpsldg lv frro" using a Caesar shift of 3. The alphabet can be shifted any number of times. This type of cryptogram can be solved through brute force, by taking a section of the message and writing out all 26 possible shifts below it, upon which the message is easily revealed.

#### Encryption Example

Encode "example" with a shift of 7.

By shifting each letter 7 times, we can encrypt the text.

Example Encoding
Encryption Shift Possible Plaintext
0 example
1 fybnqmf
2 gzcorng
4 ibeqtpi
5 jcfruqj
6 kdgsvrk
7 lehtwsl

The encrypted text is lehtwsl.

#### Decryption Example

Decode "xhntqd".

We must test all possible shifts of our text to solve this prompt, since we do not know the shift. By repeatedly testing different shifts, we will eventually arrive at our answer.

Example Decoding
Decryption Shift Possible Plaintext
0 xhntqd
1 wgmspc
2 vflrob
3 uekqna
4 tdjpmz
5 scioly

After shifting "xhntqd" five times, the plaintext is revealed to be scioly, and no further shifts need to be tested.

### Mono-alphabetic Substitution

A mono-alphabetic substitution is one where the same plaintext letters are replaced by the same ciphertext letters. Since specific encryption/decryption methods are not mentioned in the rules, a variety of ways will be covered in the following section. Mono-alphabetic ciphers may contain spaces (Aristocrats) or may have spaces removed (Patristocrats). Mono-alphabetic ciphers may use K1, K2, or random alphabets as defined by the ACA.

#### Solving a mono-alphabetic substitution cipher using patterns

Table of letter frequency in English.

This may be the most common way to solve a cipher on a Code Busters test, because the supervisor may not write that a Caesar cipher etc. was used to encrypt.

First, find the corresponding letter for a few cipher letter by:

1. Look for words that are only one letter long. These will almost always be A or I, unless the cryptogram is a poem, in which case O may be used. I usually appears at the start of the sentence, while A is usually more common.
2. Look for repeated blocks of three. The block is often THE: THE is the most common english word, used almost twice as often as the second most common, BE.
3. Look for frequency of letters. The 12 most frequent letters in the English alphabet are ETAOIN SHRDLU, with E being the most common by a significant margin.
4. Look for contractions. If an apostrophe is seen in the ciphertext, it can be an easy way to start deciphering using the table below.
5. Look for double letters. They're often LL, followed in frequency by EE, SS, OO and TT.

Two clues may give different substitution, in which case experimenting may be helpful.

Then, substitute the known letters, and gradually decode more words using the word fragments. Starting with two or three-letter words are often easier, because of the limited possibilities.

Contractions
Endings Examples
'T Won't, Don't, Isn't, Aren't, Weren't, Shouldn't, Couldn't, Didn't, Can't
'S He's, She's, It's, Who's, There's, That's
'D I'd, He'd, She'd, We'd, They'd, You'd
'M I'm
'RE You're, They're, We're
'VE They've, You've, We've
'LL I'll, He'll, She'll, We'll, They'll, It'll, Who'll

Common word patterns include

1. axx- all or too
2. abxcx- there (most common) where or these
3. xabx- that (most common) high or dead
4. axbcx- which
5. xyaxby- people
6. xayybxx- success (abcddxxyxy- succeeded).

Keep in mind less common words may occupy these frequencies. For example xyaxby could be "indian."

#### Messages with Spaces and a Hint

These cryptograms are similar to those published in 20th century newspapers. These are usually solved using patterns, as described above, with the hint providing additional information to assist the decryption.

#### Messages with Spaces

These cryptograms are similar to NSA and diplomatic messages, and do not have a hint. These are usually solved using patterns, as described above.

#### Messages with Spaces and Spelling Errors

These cryptograms are similar to FBI and organized crime messages. These are often solved by patterns, with additional care:

• The letter frequencies likely do not change, and can be applied.
• THE and many of the most common words are seldom misspelled, unless intentionally. OF may be unintentionally misspelled as UV.
• Piecing together words with word fragments may be more difficult. Misspelled words often sound the same as the actual word, which can be used to check the decrypted message.

#### Messages without Spaces

These cryptograms are similar to NSA and espionage messages, and have a hint. An example is: "UVYNYGUSZYSBZBULAPIAZUACAZZAMLGFALPERAJZNYGUUAFBR". Students are told that the last word is TODAY, and the cipher begins with a three-letter word, followed by a four-letter word.

1. Begin by writing in TODAY. UVYNYGUSZYSBZBULAPIAZUACAZZAMLGFALPERAJZNYGUTODAY. From this, we can see that U represents T, A represents O, F represents D, B represents A, and R represents Y.
2. Replace the cipher text with the decrypted letters. TVYNYGTSZYSBZATLOPIOZTOCOZZOMLGDOLPEYOJZNYGTTODAY
3. The first word is a 3 letter word beginning with T, which we can guess decrypts to THE. Replace Vs with H and Y with E. THENEGTSZESAZATLOPIOZTOCOZZOMLGDOLPEYOJZNEGTTODAY
4. In this cipher, we can see the phrase "TOCOZZOM". Because of the double Z in the middle, it can be inferred that this decrypts to TOMORROW. Replace Z with R, C with M, and M with W. THENEGTSRESARATLOPIORTOMORROWLGDOLPEYOJRNEGTTODAY.
5. We can see the letters YOJR. This is probably YOUR. Replace J with U. THENEGTSRESARATLOPIORTOMORROWLGDOLPEYOURNEGTTODAY.
6. The letters LG after the noun TOMORROW likely decrypt to IS. Replace L with I and G with S. THENESTSRESARATIOPIORTOMORROWISDOIPEYOURNESTTODAY.
7. NEST probably decrypts to B, as that is the only word that makes sense in this context. THEBESTSRESARATIOPIORTOMORROWISDOIPEYOURBESTTODAY.
8. At this point, the cipher is able to be solved using common sense. SRESARATIOP likely means PREPARATION. IOR probably means FOR. DOIPE probably means DOING. Thus, the message is THE BEST PREPARATION FOR TOMORROW IS DOING YOUR BEST TODAY.

#### Messages without Spaces or Hints

These cryptograms are extremely difficult and may not be tested very frequently. In the event that a test does contain one, the best method is using the patterns listed above, especially finding repeated three letter "phrases" or double letters.

### Affine Cipher and Modular Arithmetic

The Affine cipher uses an alphabet of size $m$ with keys $a$ and $b$ such that $a,b$ are integers, and $a$ and $m$ are coprime (there is no positive divisor for both of them besides 1). Assuming the alphabet is of size 26, $a$ can be 1, 3, 5, 7, 9, 11 ,15, 17, 19, 21, 23 and 25. Each letter in the alphabet corresponds to a number from $0$ to $m-1$. The most common correspondence for the English alphabet is shown below.

 Letter Number A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

The encryption formula for an Affine cipher is:

$E(x)=(ax+b)\bmod m.$

In the formula, $x$ is the corresponding number of plaintext. For example, if encrypting N, $x$ would be 13. Essentially, numbers are plugged into the formula and the resulting number corresponds to the encrypted letter.

For this example, we encode the message CODEBUSTERS using $a=9$ and $b=42$. To slightly speed up the process, use the fact from modular arithmetic that the function $ax+b$ does not change if we also take $a, b$ modulo 26: the function $9x+42$ is equivalent to the function $9x+16$ or $9x-10$.

 Plaintext $x$ $9x+42$ $(9x+42)\bmod 26$ Ciphertext C O D E B U S T E R S 2 14 3 4 1 20 18 19 4 17 18 60 168 69 78 51 222 204 213 78 195 204 8 12 17 0 25 14 22 5 0 13 22 I M R A Z O W F A N W

The encrypted message is IMRAZOWFANW.

To decrypt the message given the key, use the decryption formula:

$D(x)=a^{-1}(x-b)\bmod 26$

In this case, $a^{-1}$ is the multiplicative inverse of $a$ modulo $m$ ($aa^{-1}\bmod m=1$). Because there are only 26 values, one can brute force it to find the value of $t$ where $ta \bmod m=1$. $t$ represents $a^{-1}$.

 $t$ $9t \bmod 26$ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 9 18 1 10 19 2 11 20 3 12 21 4 13 22 5 12 14 23 6 15 24 7 16 25 8 17

The table reveals that $a^{-1}=3$. Below is a table of $a^{-1}$ for $m=26$:

 $a$ $a^{-1}$ 1 3 5 7 9 11 15 17 19 21 23 25 1 9 21 15 3 19 7 23 11 5 17 25

Decrypting then becomes a task of plugging into the formula.

 Ciphertext $x$ $3(x-42)$ $3(x-42) \bmod 26$ Plaintext I M R A Z O W F A N W 8 12 17 0 25 14 22 5 0 13 22 -102 -90 -75 -126 -51 -84 -60 -111 -126 -87 -60 2 14 3 4 1 20 18 19 4 17 18 C O D E B U S T E R S

Sometimes, some characters are given, which makes decryption much easier. For example, one might be given the ciphertext "CXWZ ZRC OWGW" and told that the first word is "EDIT". Thus, the characters are mapped as:

Plaintext Ciphertext
E (4) C (2)
D(3) X (23)
I (8) W (22)
T (19) Z (25)

Write out two equations using the first two values and the equation $Output=ax+b \bmod 26$ in order to solve for $b$.

$a\cdot4+b\bmod 26=2$

$a\cdot3+b\bmod 26=23$

Cancel out the $a$ by multiplying to get the same value (same process as solving a system of equations).

$12a+3b\bmod 26=6$

$12a+4b\bmod 26=92$

Subtract the equations.

$b\bmod 26=86$

Take the mod of the right side.

$b\bmod 26=8$

Compute the modulus values to see which works. In this case, 8 works. Now, substitute $b$ into the equation and repeat the process.

$a\cdot3+8\bmod 26=23$

$a\cdot3\bmod 26=15$

$a=5$

### Vigenère Cipher

The Vigenère cipher, invented by Blaise de Vigenère in the 16th century, is a polyalphabetic cipher. This means that each letter is shifted by a different amount. According to the rules, students will probably be asked to encrypt rather than decrypt Vigenère ciphers. Encrypting is a fairly straightforward procedure.

#### Encryption/Decryption With a Table

First, write out the message with the key under it, repeating the key as many times as necessary. An example is shown.

 Message Key S C I E N C E O L Y M P I A D I S C O O L S C I O L Y S C I O L Y S C I O L Y S C I

Then, take out the alphabet square, as shown below. This will typically be provided on the test.

Vigenère Alphabet Table

Using the alphabet square, encode the plaintext. The first message letter is S and the first key letter is S, therefore, look at the table to see where row S and column S intersect. It is clear that they intersect at K, so write down K as the first letter of the ciphertext. Repeat this with the rest of the message. Thus, the encrypted text is "KEQSYAW QTMXNACL WD AGQT"

If the key and ciphertext are both given, decoding is also possible. This is done by taking a letter of the key and finding its row, finding the corresponding letter of ciphertext in that row, and seeing what column that letter falls in. The letter in the column is the letter of the plaintext. In the previous example, the first letter is decoded by going to row S and finding K, which is located in column S. Thus, the plaintext letter is S.

#### Encryption/Decryption Without a Table

Tables are typically given on the test, but in the event they are not, the following strategy may be more helpful.

Remember or recreate the correspondence between letter and number like in Affine and Hill Cipher, with A being 0 and Z being 25. Then, for each letter, convert the plain text and key to a sequence of numbers, and add the numbers modulo 26. Then, convert the number back to letter.

For example, if we encode the message "SCIENCEOLYMPIADISCOOL" using the key SCIOLY, we get

To decode a message using this method, subtract instead of add the key's corresponding number: The cipher text K with the corresponding key letter S gives plain text $10-18=-8\equiv18\pmod{26}\to \text{S}$.

### Baconian Cipher

The Baconian cipher replaces each letter of the plaintext with a 5 letter combination of 'A' and 'B'. This replacement is a binary form of encoding, in which 'A' may be considered as 0 and 'B' as 1. One variant of the Baconian Cipher uses a 24 letter alphabet with the letters 'I' and 'J' having the same code, as well as 'U' and 'V'.

 Letter Code Binary A B C D E F G H I J K L M N O P Q R S T U V W X Y Z aaaaa aaaab aaaba aaabb aabaa aabab aabba aabbb abaaa abaaa abaab ababa ababb abbaa abbab abbba abbbb baaaa baaab baaba baabb baabb babaa babab babba babbb 00000 00001 00010 00011 00100 00101 00110 00111 01000 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10011 10100 10101 10110 10111

Another variant of this cipher uses a unique code for each letter (26 letter alphabet). However, in a rule clarification, only the 24 letter variation is to be used on Codebusters tests for the 2019 season.

 Letter Code Binary A B C D E F G H I J K L M N O P Q R S T U V W X Y Z aaaaa aaaab aaaba aaabb aabaa aabab aabba aabbb abaaa abaab ababa ababb abbaa abbab abbba abbbb baaaa baaab baaba baabb babaa babab babba babbb bbaaa bbaab 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001

Standard numbering systems use a base 10 method of counting (ones place, tens place, hundreds place, etc). What this means is that normally for example 24 = (2*10 + 4*1). The Baconian Cipher uses a base 2 system. The following is an example of base 2 converted to standard base 10: 01001 (base 2) = (0*16 + 1*8 + 0*4 + 0*2 + 1*1) = (1*8 + 1*1) = 9 (base 10). As seen in the chart above, 01001 corresponds to J, which is the 9th letter in the alphabet (assuming A = 0). When the first variant is shown, the numbering system will be off by 1 from J to U and off by 2 from V to Z. For example, 10100 = W, even though 10100 = 20 (base 10) which corresponds to U on the alphabet chart when A = 0.

When solving a question encoded with the Baconian Cipher, it is very likely that they won't explicitly give you "A" and "B" to use to find the corresponding letters. Most of the time, they'll have certain symbols or letters that are meant to represent "A" and "B". One example of this would be using all of of the even letters in the alphabet to represent "A" while all the odd letters represent "B". There are many different variants of this, including symbols on a keyboard and vowel/consonants. To solve a Baconian, try to group the different symbols/letters into two groups based on their properties, and assign one group "A" and the other group "B". If it doesn't work the first time, then switch the groups so that the previous "A" group is now the "B" group. If even then it doesn't seem to be working, then start over again and find a different characteristic to base the groups off of. For this reason, the Baconian Cipher can take longer than some of the other ciphers.

### Xenocrypt

At the invitational/Regional level, one cryptogram may be in Spanish as a challenge. At the state level, there will be at least one. It may be helpful if one of the partners is fluent in or has a few years of knowledge in Spanish.

For Spanish cryptograms, n and ñ are treated as different letters. However, letters with accents are treated the same as without (a and á are the same). This means that, when working with cryptograms, accent marks do not factor in. Also, ch, ll, and rr are NOT considered distinct letters. Thus, "churro" would have 6 letters: c-h-u-r-r-o. The Spanish alphabet used for cryptograms is as follows:

 A B C D E F G H I J K L M N Ñ O P Q R S T U V W X Y Z

The frequency table of Spanish letters is as follows, from most to least frequent:

 Letter Frequency Letter Frequency E A O S N R I L U D T C M P 14.08% 12.16% 9.20% 7.20% 6.83% 6.41% 5.98% 5.24% 4.69% 4.67% 4.60% 3.87% 3.08% 2.89% B H Q Y V G F J Z Ñ X K W 1.49% 1.18% 1.11% 1.09% 1.05% 1.00% 0.69% 0.52% 0.47% 0.17% 0.14% 0.11% 0.04%

Spanish cryptograms are often solved with patterns as well, with a few differences:

• Look for the two most common letters, instead of the most common letters: E and A have relatively close frequency, and are much higher than the rest.
• The most common spanish words are DE, LA, QUE, EL, EN. Since Spanish has far more two-letter words, it is helpful to decrypt them, using the placement of the letter E. QUE is the most common three-letter word, almost twice as common as the next ones.
• Decrypting words using word fragments are much more difficult for teams without fluency in Spanish.

### Hill Cipher

NOTE: These cryptograms will be matrix based, and only use 2x2 or 3x3 matrices.

The alphabet for the Hill cipher has corresponding numbers as follows:

 Letter Number A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Begin by picking a key matrix of either 2x2 or 3x3. These could be a 4 letter word or three 3 letter words. For this example, the key will be WIKI (2x2 matrix). Then, break the message into groups of two. This example will use the message SCIENCE OLYMPIAD, which would be split up into SC IE NC EO LY MP IA DZ. Notice that a Z is added in order to make the last group a group of two. Write the message and the key as matrices.

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} S \\ C \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 18 \\ 2 \end{pmatrix}=\begin{pmatrix} 412 \\ 196 \end{pmatrix}\bmod 26=\begin{pmatrix} 22 \\ 14 \end{pmatrix}=\begin{pmatrix} W \\ O \end{pmatrix}$

In the second step of the above equation, the matrices are multiplied. Although it may seem complicated, matrix multiplication is fairly straightforward.

$\begin{pmatrix} A & B \\ C & D \end{pmatrix}*\begin{pmatrix} E \\ F \end{pmatrix}$

The matrices are multiplied as follows: $A$ and $E$ are multiplied, then added to the product of $B$ and $F$. $C$ and $E$ are multiplied and added to the product of $D$ and $F$. Thus, the product of the matrices is:

$\begin{pmatrix} AE + BF \\ CE + DF \end{pmatrix}$

Matrix multiplication for 3x3 matrices is very similar.

$\begin{pmatrix} A & B & C \\ D & E & F \\ G & H & I \\ \end{pmatrix}*\begin{pmatrix} J & K & L \\ M & N & O \\ P & Q & R \\ \end{pmatrix}$

Just like in a 2x2 matrix, the row of the first matrix is multiplied by the column of the second matrix, giving the following product.

$\begin{pmatrix} AJ+BM+CP & AK+BN+CQ & AL+BO+CR \\ DJ+EM+FP & DK+EN+FQ & DL+EO+FR \\ GJ+HM+IP & GK+HN+IQ & GL+HO+IR \\ \end{pmatrix}$

It is important to note that in order to multiply matrices, the number of columns in the first matrix MUST equal the number of rows in the second matrix. The size of the product matrix is the number of rows in the first matrix x the number of columns in the second matrix.

The "mod" operation is also fairly straightforward. Essentially, it finds the remainder after dividing. For example, $153 \bmod 26$ is equal to the remainder of $153 / 26$, which is 23. On a scientific calculator, this is found by dividing the two numbers, subtracting the integer value from the answer, and multiplying the decimals by the number after "mod" (in this case, 26). Therefore, the process would be:

$153/26=5.884615385$

$5.884615385-5=0.884615385$

$0.884615385*26=23$

The rest of the encoding of the message is shown below.

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} S \\ C \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 18 \\ 2 \end{pmatrix}=\begin{pmatrix} 412 \\ 196 \end{pmatrix}\bmod 26=\begin{pmatrix} 22 \\ 14 \end{pmatrix}=\begin{pmatrix} W \\ O \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} I \\ E \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 8 \\ 4 \end{pmatrix}=\begin{pmatrix} 208 \\ 112 \end{pmatrix}\bmod 26=\begin{pmatrix} 0 \\ 8 \end{pmatrix}=\begin{pmatrix} A \\ I \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} N \\ C \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 13 \\ 2 \end{pmatrix}=\begin{pmatrix} 302 \\ 146 \end{pmatrix}\bmod 26=\begin{pmatrix} 16 \\ 16 \end{pmatrix}=\begin{pmatrix} Q \\ Q \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} E \\ O \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 4 \\ 14 \end{pmatrix}=\begin{pmatrix} 200 \\ 152 \end{pmatrix}\bmod 26=\begin{pmatrix} 18 \\ 22 \end{pmatrix}=\begin{pmatrix} S \\ W \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} L \\ Y \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 11 \\ 24 \end{pmatrix}=\begin{pmatrix} 434 \\ 302 \end{pmatrix}\bmod 26=\begin{pmatrix} 18 \\ 16 \end{pmatrix}=\begin{pmatrix} S \\ Q \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} M \\ P \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 12 \\ 15 \end{pmatrix}=\begin{pmatrix} 384 \\ 240 \end{pmatrix}\bmod 26=\begin{pmatrix} 20 \\ 6 \end{pmatrix}=\begin{pmatrix} U \\ G \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} I \\ A \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 8 \\ 0 \end{pmatrix}=\begin{pmatrix} 176 \\ 80 \end{pmatrix}\bmod 26=\begin{pmatrix} 20 \\ 2 \end{pmatrix}=\begin{pmatrix} U \\ C \end{pmatrix}$

$\begin{pmatrix} W & I \\ K & I \end{pmatrix}*\begin{pmatrix} D \\ Z \end{pmatrix}=\begin{pmatrix} 22 & 8 \\ 10 & 8 \end{pmatrix}*\begin{pmatrix} 3 \\ 25 \end{pmatrix}=\begin{pmatrix} 226 \\ 230 \end{pmatrix}\bmod 26=\begin{pmatrix} 18 \\ 22 \end{pmatrix}=\begin{pmatrix} S \\ W \end{pmatrix}$

The encoded message is WOAIQQSWSQUGUCSW.

3x3 matrix encryption works in the same way. This example will encrypt "EDIT THE WIKI" using the key "BEE FLY BUG". First, split up the plaintext into groups of three, which becomes EDI TTH EWI KIZ. Once again, the last group has a Z added to make it a group of three.

$\begin{pmatrix} B & E & E \\ F & L & Y \\ B & U & G \end{pmatrix}*\begin{pmatrix} E \\ D \\ I \\ \end{pmatrix}=\begin{pmatrix} 1 & 4 & 4 \\ 5 & 11 & 24 \\ 1 & 20 & 6 \end{pmatrix}*\begin{pmatrix} 4 \\ 3 \\ 8 \end{pmatrix}=\begin{pmatrix} 48 \\ 245 \\ 112 \end{pmatrix}\bmod 26=\begin{pmatrix} 22 \\ 11 \\ 8 \end{pmatrix}=\begin{pmatrix} W \\ L \\ I \end{pmatrix}$

$\begin{pmatrix} B & E & E \\ F & L & Y \\ B & U & G \end{pmatrix}*\begin{pmatrix} T \\ T \\ H \\ \end{pmatrix}=\begin{pmatrix} 1 & 4 & 4 \\ 5 & 11 & 24 \\ 1 & 20 & 6 \end{pmatrix}*\begin{pmatrix} 19 \\ 19 \\ 7 \end{pmatrix}=\begin{pmatrix} 123 \\ 472 \\ 441 \end{pmatrix}\bmod 26=\begin{pmatrix} 19 \\ 4 \\ 25 \end{pmatrix}=\begin{pmatrix} T \\ E \\ Z \end{pmatrix}$

$\begin{pmatrix} B & E & E \\ F & L & Y \\ B & U & G \end{pmatrix}*\begin{pmatrix} E \\ W \\ I \\ \end{pmatrix}=\begin{pmatrix} 1 & 4 & 4 \\ 5 & 11 & 24 \\ 1 & 20 & 6 \end{pmatrix}*\begin{pmatrix} 4 \\ 22 \\ 8 \end{pmatrix}=\begin{pmatrix} 124 \\ 454 \\ 492 \end{pmatrix}\bmod 26=\begin{pmatrix} 20 \\ 12 \\ 24 \end{pmatrix}=\begin{pmatrix} U \\ M \\ Y \end{pmatrix}$

$\begin{pmatrix} B & E & E \\ F & L & Y \\ B & U & G \end{pmatrix}*\begin{pmatrix} K \\ I \\ Z \\ \end{pmatrix}=\begin{pmatrix} 1 & 4 & 4 \\ 5 & 11 & 24 \\ 1 & 20 & 6 \end{pmatrix}*\begin{pmatrix} 10 \\ 8 \\ 25 \end{pmatrix}=\begin{pmatrix} 142 \\ 738 \\ 320 \end{pmatrix}\bmod 26=\begin{pmatrix} 12 \\ 10 \\ 8 \end{pmatrix}=\begin{pmatrix} M \\ K \\ I \end{pmatrix}$

The encoded message is WLITEZUMYMKI.

When given 4 corresponding plaintext and ciphertext create two sets of equations and solve them. For example if ABCD plaintext corresponds to DCBA and you have to find the encryption key $\begin{pmatrix} A & B \\ C & D \\ \end{pmatrix}$ create 2 matrices with AB and CD $\begin{pmatrix} 0\\ 1\\ \end{pmatrix}$ $\begin{pmatrix} 2\\ 3\\ \end{pmatrix}$ You get 0A plus 1B = 3 and 0C plus 1D = 2 2A plus 3B = 1 and 2C plus 3D = 0 With 0A plus 1B = 3 times 3 is 0A plus 3B = 9 2A plus 3B = 3 minus (0A plus 3B = 9 2A = -6 mod 26 or 2A=20 A value = 10 Repeat for other values

### Running Key Cipher

The running key cipher is a variant of the Vigenère Cipher. Rather than using a word as a key, a sentence/paragraph is used as the key. Essentially, instead of repeating a word multiple times as the key, a sentence/paragraph constitutes as the key and is used continuously. If the test was made with Toebes, then the four standard documents used to create a question using the Running Key Cipher are:

• The first line of the Gettysburg Address
• The first line/paragraph of the Declaration of Independence
• The first line of the United States Consitution
• The first line of the Magna Carta (in Latin)

In the event that a question encoded with the running key cipher asks you to decode the phrase but does not give the key for it, then one has to use one of the documents given on the reference sheet (if applicable) and plug them all in to determine which of the documents is the key. If they give the key but do not give the text of the key (ex. "a famous quote by George Washington"), then it is probably best to skip the question.

### RSA Cipher

Choose two primes $p$ and $q$.

Compute $n = pq$.

Compute the least common multiple of $p-1$ and $q-1$, and call it $\lambda(n)$.

Choose an integer $e$ coprime to $\lambda(n)$.

Compute the inverse $d$ of $e$ modulo $\lambda(n)$.

Now, say that Alice wants to receive from Bob a message. Alice sends Bob her public key (n, e) through a reliable channel. Bob translates his message M to an integer m, and then converts it to ciphertext using $c \equiv m^e mod n$.

Alice decodes it using $m \equiv c^d mod n$.

### Sir Arthur Conan Doyle's Cipher from The Adventure of the Dancing Men

While not explicitly stated in the rules, the Dancing Men cipher has appeared in previous tests and possibly may appear as a bonus question in future tests. The Dancing Men cipher is a monoalphabetic substitution cipher with spaces where each letter is represented by a dancing man. A man holding a flag indicates the end of a word. In the story, messages encrypted with this cipher were sent to a woman named Elsie, Sherlock Holmes solved the cipher using that E is the most common letter, and that Elsie's name would likely appear. Since the cipher may be easily decrypted if all the dancing men are memorized, there are a few patterns to help remember them. O and A, R and I, and T and E are flipped. T and E are symmetrical about a vertical axis. N and S have the same legs and right arm. The substitution chart is found below.

Dancing Men Cipher

An example of the Dancing Men cipher is listed below.

contains the message "NOTARIES", which conveniently shows the patterns listed above.

Note: The Dancing Men cipher is not included in 2019 rules. However, it is a common part of tests from past years' trial events.


text:
Post Closed as "duplicate" by Mr.Wizard of
3 Breaking the line before /. makes the code invalid. Breaking after /. would be okay.

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces. Note that PDF[NormalDistribution[m, s], x] was evaluated of the form Times[a,b,c] and thus u was identified as Times.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces. Note that PDF[NormalDistribution[m, s], x] was evaluated of the form Times[a,b,c] and thus u was identified as Times.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]] /. Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces. Note that PDF[NormalDistribution[m, s], x] was evaluated of the form Times[a,b,c] and thus u was identified as Times.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]] /. Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?

2 added 130 characters in body

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces. Note that PDF[NormalDistribution[m, s], x] was evaluated of the form Times[a,b,c] and thus u was identified as Times.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces. Note that PDF[NormalDistribution[m, s], x] was evaluated of the form Times[a,b,c] and thus u was identified as Times.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?

1

A puzzling result of the ReplaceAll

I tried to do something below

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[u_[x__] ] :> Plus @@ Log[List[x]]

which gives a desirable result that splits the expression into pieces.

However, if I replace u_ by Times, i.e.,

Log[PDF[NormalDistribution[m, s], x]]
/.  Log[Times[x__] ] :> Plus @@ Log[List[x]]

then, I got an unexpected result that does not change the expression. Can you explain why I should not use Times even though I know that u_ will match Times in the first example?