text:
# Native Win32 Linux Commands for Windows 7

native Win32 Linux commands! This is a better option than running Cygwin since applications run on native (that word again) Win32 mode and not in an emulation. This means the commands run right off the bat, no need to rebuild apps from source, pretty cool eh? So to get these commands running on your computer, download the original archive here and also get the updates here. Uncompress all the files to some location like C:\bin and add this to your path environment. Commands included in the archive are the following:

agrep.exe
ansi2knr.exe
basename.exe
bc.exe
bison.exe
bunzip2.exe
bzip2.exe
bzip2recover.exe
cat.exe
chgrp.exe
chmod.exe
chown.exe
cksum.exe
cmp.exe
comm.exe
compress.exe
cp.exe
csplit.exe
cut.exe
date.exe
dc.exe
dd.exe
df.exe
diff.exe
diff3.exe
dir.txt
dircolors.exe
dirname.exe
du.exe
echo.exe
egrep.exe
env.exe
expand.exe
expr.exe
factor.exe
fgrep.exe
find.exe
flex.exe
fmt.exe
fold.exe
fsplit.exe
gawk.exe
gclip.exe
gplay.exe
grep.exe
gsar.exe
gunzip.exe
gzip.exe
id.exe
indent.exe
install.exe
join.exe
jwhois.exe
less.exe
lesskey.exe
libfl.a
libfl.lib
ln.exe
logname.exe
ls.exe
m4.exe
make.exe
makedepend.exe
makemsg.exe
man.exe
md5sum.exe
mkdir.exe
mkfifo.exe
mknod.exe
mv.exe
mvdir.exe
nl.exe
od.exe
paste.exe
patch.exe
pathchk.exe
pclip.exe
pr.exe
printenv.exe
printf.exe
ptx.exe
pwd.exe
recode.exe
rm.exe
rman.exe
rmdir.exe
sdiff.exe
sed.exe
seq.exe
sha1sum.exe
shar.exe
sleep.exe
sort.exe
split.exe
stego.exe
su.exe
sum.exe
sync.exe
tac.exe
tail.exe
tar.exe
tee.exe
test.exe
touch.exe
tr.exe
tsort.exe
type.exe
uname.exe
unexpand.exe
uniq.exe
unrar.exe
unshar.exe
unzip.exe
uudecode.exe
uuencode.exe
wc.exe
wget.exe
wget.hlp
which.exe
whoami.exe
xargs.exe
yes.exe
zcat.exe
zip.exe
zsh.exe
Special thanks to Karl M. Syring for this awesome work. You sir provide a ray of hope to humanity.  ]]>


text:
# Express the following rational numbers as decimals:

Question:

Express the following rational numbers as decimals:

(i) $\frac{2}{3}$

(ii) $-\frac{4}{9}$

(iii) $\frac{-2}{15}$

(iv) $-\frac{22}{13}$

(v) $\frac{437}{999}$

(vi) $\frac{33}{26}$

Solution:

(i) Given rational number is $\frac{2}{3}$

Now we have to express this rational number into decimal form. So we will use long division method

(ii) Given rational number is $-\frac{4}{9}$

Now we have to express this rational number into decimal form. So we will use long division method

(iii) Given rational number is $-\frac{2}{15}$

Now we have to express this rational number into decimal form. So we will use long division method

(iv) Given rational number is $-\frac{22}{13}$

Now we have to express this rational number into decimal form. So we will use long division method

(v) Given rational number is $\frac{437}{999}$

Now we have to express this rational number into decimal form. So we will use long division method

(vi) Given rational number is $\frac{33}{26}$

Now we have to express this rational number into decimal form. So we will use long division method

format: plain


text:
# plot_arf¶

sherpa.astro.ui.plot_arf(id=None, resp_id=None, replot=False, overplot=False, clearwindow=True, **kwargs)

Plot the ARF associated with a data set.

Display the effective area curve from the ARF component of a PHA data set.

Parameters: id (int or str, optional) – The data set with an ARF. If not given then the default identifier is used, as returned by get_default_id. resp_id (int or str, optional) – Which ARF to use in the case that multiple ARFs are associated with a data set. The default is None, which means the first one. replot (bool, optional) – Set to True to use the values calculated by the last call to plot_data. The default is False. overplot (bool, optional) – If True then add the data to an exsiting plot, otherwise create a new plot. The default is False. clearwindow (bool, optional) – Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)? sherpa.utils.err.ArgumentErr – If the data set does not contain PHA data.

get_arf_plot()
Return the data used by plot_arf.
plot()
Create one or more plot types.

Examples

Plot the ARF for the default data set:

>>> plot_arf()

Plot the ARF from data set 1 and overplot the ARF from data set 2:

>>> plot_arf(1)
>>> plot_arf(2, overplot=True)

Plot the ARFs labelled “arf1” and “arf2” for the “src” data set:

>>> plot_arf("src", "arf1")
>>> plot_arf("src", "arf2", overplot=True)

The following example requires that the Matplotlib backend is selected, since this determines what extra keywords plot_arf accepts. The ARFs from the default and data set 2 are drawn together, but the second curve is drawn with a dashed line.

>>> plot_arf(ylog=True)
>>> plot_arf(2, overplot=True, linestyle='dashed')


text:
# Codeforces 848B. Rooter’s Song（乱搞）

Wherever the destination is, whoever we meet, let’s render this song together.

On a Cartesian coordinate plane lies a rectangular stage of size w × h, represented by a rectangle with corners (0, 0)(w, 0)(w, h) and (0, h). It can be seen that no collisions will happen before one enters the stage.

On the sides of the stage stand n dancers. The i-th of them falls into one of the following groups:

• Vertical: stands at (xi, 0), moves in positive y direction (upwards);
• Horizontal: stands at (0, yi), moves in positive x direction (rightwards).

According to choreography, the i-th dancer should stand still for the first ti milliseconds, and then start moving in the specified direction at 1unit per millisecond, until another border is reached. It is guaranteed that no two dancers have the same group, position and waiting time at the same time.

When two dancers collide (i.e. are on the same point at some time when both of them are moving), they immediately exchange their moving directions and go on.

Dancers stop when a border of the stage is reached. Find out every dancer’s stopping position.

Input

The first line of input contains three space-separated positive integers nw and h (1 ≤ n ≤ 100 0002 ≤ w, h ≤ 100 000) — the number of dancers and the width and height of the stage, respectively.

The following n lines each describes a dancer: the i-th among them contains three space-separated integers gipi, and ti (1 ≤ gi ≤ 21 ≤ pi ≤ 99 9990 ≤ ti ≤ 100 000), describing a dancer’s group gi (gi = 1 — vertical, gi = 2 — horizontal), position, and waiting time. If gi = 1 then pi = xi; otherwise pi = yi. It’s guaranteed that 1 ≤ xi ≤ w - 1 and 1 ≤ yi ≤ h - 1. It is guaranteed that no two dancers have the same group, position and waiting time at the same time.

Output

Output n lines, the i-th of which contains two space-separated integers (xi, yi) — the stopping position of the i-th dancer in the input.

Examples
input

output

input

output

Note

The first example corresponds to the initial setup in the legend, and the tracks of dancers are marked with different colours in the following figure.

In the second example, no dancers collide.

Input

Output

Input示例

Output示例

# hdu 5745 La Vie en rose（bitset优化字符串匹配）

Problem Description
Professor Zhang would like to solve the multiple pattern matching problem, but he only has only one pattern string p=p1p2...pm. So, he wants to generate as many as possible pattern strings from p using the following method:

1. select some indices i1,i2,...,ik such that 1i1<i2<...<ik<|p| and |ijij+1|>1 for all 1j<k.
2. swap pij and pij+1 for all 1jk.

Now, for a given a string s=s1s2...sn, Professor Zhang wants to find all occurrences of all the generated patterns in s.

Input
There are multiple test cases. The first line of input contains an integer T, indicating the number of test cases. For each test case:

The first line contains two integers n and m (1n105,1mmin{5000,n}) — the length of s and p.

The second line contains the string s and the third line contains the string p. Both the strings consist of only lowercase English letters.

Output
For each test case, output a binary string of length n. The i-th character is “1” if and only if the substring sisi+1...si+m1 is one of the generated patterns.

Sample Input
3
4 1
abac
a
4 2
aaaa
aa
9 3
abcbacacb
abc
Sample Output
1010
1110
100100100


text:
mersenneforum.org Wildly differing times for step 2 with ecm-6.0.1
 Register FAQ Search Today's Posts Mark Forums Read

 2005-09-07, 21:33 #1 Jushi     Sep 2005 UGent 22·3·5 Posts Wildly differing times for step 2 with ecm-6.0.1 I recently started exploring GMP-ECM and noted that for a given number and given parameters, the Step 1 time is almost constant, but Step 2 time varies from run to run up to a factor 5 or so. This is on one and the same machine for 5 curves: Code: Step 1 took 1188420ms Step 1 took 1188460ms Step 1 took 1189800ms Step 1 took 1188310ms Step 1 took 1189760ms Code: Step 2 took 671880ms Step 2 took 718610ms Step 2 took 2851240ms Step 2 took 475260ms Step 2 took 558580ms Is this normal or am I doing something wrong?
 2005-09-07, 21:38 #2 akruppa     "Nancy" Aug 2002 Alexandria 2,467 Posts Stage 2 can use quite a lot of RAM. Is the computer running out of memory and starting to swap to disk a lot? In that case, the performance you'd get would depend i.e. on how many other applications are running. What system are you on, what number are you factoring and with what parameters? Alex
 2005-09-10, 08:11 #3 Jushi     Sep 2005 UGent 22×3×5 Posts Looking at a top', I think I can explain the problem: a load average of 1.3 (should be 1.0). However, apart from ecm' I see nothing else running... so that will require some investigation. By the way: the machine is a PentiumIV 3.0GHz with 2GB ram and zero swap. The number is a C288, and I'm running ecm-6.0.1 with B1=11e6. Other question: Is there any difference between running `ecm' ten times, as opposed to running once with a -c 10 option?
2005-09-10, 09:23   #4
geoff

Mar 2003
New Zealand

13·89 Posts

Quote:
 Originally Posted by Jushi By the way: the machine is a PentiumIV 3.0GHz with 2GB ram and zero swap. The number is a C288, and I'm running ecm-6.0.1 with B1=11e6.
Those stage one times (and the fastest stage two time) are almost double what a number that size should require on that machine.

2005-09-11, 21:25   #5
Jushi

Sep 2005
UGent

22×3×5 Posts

The problem with differing times seems to have resolved itself by rebooting (I still don't know what caused it).

Quote:
 Originally Posted by geoff Those stage one times (and the fastest stage two time) are almost double what a number that size should require on that machine.
Are you sure? What else could influence the running time...?

2005-09-11, 23:19   #6
Mystwalker

Jul 2004
Potsdam, Germany

3·277 Posts

Quote:
 Originally Posted by Jushi Are you sure? What else could influence the running time...?
Maybe another application that takes "full" processing power, in case you have Hyperthreading enabled?

2005-09-12, 00:33   #7
geoff

Mar 2003
New Zealand

13×89 Posts

Quote:
 Originally Posted by Mystwalker Maybe another application that takes "full" processing power, in case you have Hyperthreading enabled?
Another possibility is that you are using a GMP library optimised for the wrong processor. If that is the case then recompiling with P4-specific optimisations could give a very large improvement. (For example, the precompiled Debian library is optimised for a 486, recompiling for a P4 makes ecm run more than 70% faster).

 2005-09-12, 01:30 #8 geoff     Mar 2003 New Zealand 13×89 Posts As a reference point, here is a curve for a general 284 digit number on a 2.66GHz P4: GMP-ECM 6.0 [powered by GMP 4.1.4] [ECM] Input number is 1659 ... 8037 (284 digits) Using B1=11000000, B2=25577181640, polynomial Dickson(12), sigma=3150013712 Step 1 took 645928ms Step 2 took 208735ms

 Similar Threads Thread Thread Starter Forum Replies Last Post lycorn Lone Mersenne Hunters 37 2011-10-09 16:09 CRGreathouse Factoring 9 2010-10-30 16:38 Andi47 GMP-ECM 9 2007-04-12 11:40 alpertron Software 4 2006-01-11 17:27 Ken_g6 Puzzles 1 2005-01-16 15:03

All times are UTC. The time now is 16:29.

Sat May 21 16:29:18 UTC 2022 up 37 days, 14:30, 0 users, load averages: 1.87, 1.48, 1.36


text:
Fun with Fibonacci

Algebra Level 3

Let $$F_{n}$$ be an infinite sequence, in which $$F_{1} = F_{2} = 1$$, and satisfies the recurrence relation $$F_{n} = F_{n-1} + F_{n - 2}$$, for positive integers $$n \geq 3$$.

Let $$S$$ be an infinte series in which $$S$$ is defined as

$$\Large\displaystyle\sum_{n = 1}^{\infty} \frac{F_{n}}{2^{n}}$$

Calculate the value of $$S$$

This problem appeared in the AITMO 2013

×


text:
Publicité ▼

## définition - Kármán_line

voir la définition de Wikipedia

Wikipedia

# Kármán line

Layers of Atmosphere.[1] (not to scale)

The Kármán line lies at an altitude of 100 kilometres (62 mi) above the Earth's sea level, and is commonly used to define the boundary between the Earth's atmosphere and outer space.[2] This definition is accepted by the Fédération Aéronautique Internationale (FAI), which is an international standard setting and record-keeping body for aeronautics and astronautics.

The line was named after Theodore von Kármán, (1881–1963) a Hungarian-American engineer and physicist who was active primarily in the fields of aeronautics and astronautics. He first calculated that around this altitude the Earth's atmosphere becomes too thin for aeronautical purposes (because any vehicle at this altitude would have to travel faster than orbital velocity in order to derive sufficient aerodynamic lift from the atmosphere to support itself).[3] Also, there is an abrupt increase in atmospheric temperature and interaction with solar radiation.[citation needed]

## Definition

An atmosphere does not abruptly end at any given height, but becomes progressively thinner with altitude. Also, depending on how the various layers that make up the space around the Earth are defined (and depending on whether these layers are considered as part of the actual atmosphere), the definition of the edge of space could vary considerably: If one were to consider the thermosphere and exosphere part of the atmosphere and not of space, one might have to extend the boundary to space to at least 10,000 km (6,200 mi) above sea level. The Kármán line thus is an arbitrary definition based on the following considerations:

An aeroplane only stays in the sky if it is constantly traveling forward relative to the air (airspeed is not dependent on speed relative to ground), so that the wings can generate lift. The thinner the air, the faster the plane has to go to generate enough lift to stay up.

If the lift coefficient for a wing at a specified angle of attack is known (or estimated using a method such as thin-airfoil theory), then the lift produced for specific flow conditions can be determined using the following equation

$L = \tfrac12\rho v^2 A C_L$

where

L is lift force
ρ is air density
v is true airspeed
A is wing area,
CL is the lift coefficient at the desired angle of attack, Mach number, and Reynolds number.

Lift (L) generated is directly proportional to the air density (ρ). All other factors remaining unchanged, true airspeed (v) has to be increased to compensate for less air density (ρ) at higher altitudes.

An orbiting spacecraft only stays in the sky if the centrifugal component of its movement around the Earth is enough to balance the downward pull of gravity. If it goes any more slowly, the pull of gravity will gradually cause its altitude to decrease. The required speed is called orbital velocity, and it varies with the height of the orbit. For the International Space Station or a space shuttle in low Earth orbit, the orbital velocity is about 27,000 km per hour (17,000 miles per hour).

For an aeroplane that is trying to fly higher and higher, the thinning air gives less and less lift, requiring a higher speed to create enough lift to hold the airplane up. There comes an altitude where it needs to fly so fast to generate lift that it reaches orbital velocity. The concept of the Kármán Line is the altitude where the required flying speed would be equal to orbital velocity (assuming the wing loading of a typical airplane).

When studying aeronautics and astronautics in the 1950s, Kármán calculated that above an altitude of roughly 100 km (62 mi), a vehicle would have to fly faster than orbital velocity in order to derive sufficient aerodynamic lift from the atmosphere to support itself.[citation needed] At this altitude, the air density is about 1/2200000 the density on the surface.[4]

Although the calculated altitude was not exactly 100 km, Kármán proposed that 100 km be the designated boundary to space, since the round number is more memorable, and the calculated altitude varies minutely as certain parameters are varied. An international committee recommended the 100 km line to the FAI, and upon adoption, it became widely accepted as the boundary to space for many purposes.[5] However, there is still no international legal definition of the demarcation between a country's air space and outer space.[6]

Another hurdle to strictly defining the boundary to space is the dynamic nature of Earth's atmosphere. For example, at an altitude of 1,000 km (620 mi), the atmosphere's density can vary by a factor of five, depending on the time of day, time of year, AP magnetic index, and recent solar flux.[citation needed]

The FAI uses the Kármán line to define the boundary between aeronautics and astronautics:[7]

• Aeronautics — For FAI purposes, aerial activity, including all air sports, within 100 kilometres of Earth's surface.
• Astronautics — For FAI purposes, activity more than 100 kilometres above Earth's surface.

## Interpretations of the definition

Some people (including the FAI in some of their publications) also use the expression "edge of space" to refer to a region below the conventional 100 km boundary to space, which is often meant to include substantially lower regions as well. Thus, certain balloon or airplane flights might be described as "reaching the edge of space". In such statements, "reaching the edge of space" merely refers to going higher than average aeronautical vehicles commonly would.[8][9]

## Alternatives to the definition

Although the United States does not officially define a boundary of space, the U.S. definition of an astronaut, which is still held today, is a person who has flown more than 50 miles (~80 km) above mean sea level. (This is approximately the line between the mesosphere and the thermosphere.) This definition of an astronaut had been somewhat controversial, due to differing definitions between the United States military and NASA.[8]

In 2005, three veteran NASA X-15 pilots (John B. McKay, Bill Dana and Joseph Albert Walker) were retroactively (two posthumously) awarded their astronaut wings, as they had flown between 90 and 108 km in the 1960s, but at the time had not been recognized as astronauts.[8]

International law defines the lower boundary of space as the lowest perigee attainable by an orbiting space vehicle, but does not specify an altitude. Due to atmospheric drag, the lowest altitude at which an object in a circular orbit can complete at least one full revolution without propulsion is approximately 150 km (93 mi), while an object can maintain an elliptical orbit with perigee as low as 129 km (80 mi) with propulsion. [10]

Atmospheric gases scatter blue wavelengths of visible light more than other wavelengths, giving the Earth’s visible edge a blue halo. At higher and higher altitudes, the atmosphere becomes so thin that it essentially ceases to exist. Gradually, the atmospheric halo fades into the blackness of space.

• V2 rocket - the first vehicle to cross the Kármán line

## References

1. ^ http://www.srh.noaa.gov/srh/jetstream/atmos/layers.htm
2. ^ "The 100 km Boundary for Astronautics" (DOC). Fédération Aéronautique Internationale Press Release. 2004-06-24. Retrieved 2006-10-30.
3. ^ O'Leary, Beth Laura (2009). Ann Garrison Darrin. ed. Handbook of space engineering, archaeology, and heritage. Advances in engineering. CRC Press. pp. 84. ISBN 1-4200-8431-3.
4. ^ Squire, Tom (September 27, 2000), "U.S. Standard Atmosphere, 1976", Thermal Protection Systems Expert and Material Properties Database (NASA), retrieved 2011-10-23
5. ^ "Schneider walks the Walk [A word about the definition of space"]. NASA. 2005-10-21. Retrieved 2008-04-29.
6. ^ International Law: A Dictionary, by Boleslaw Adam Boczek; Scarecrow Press, 2005; page 239: "The issue whether it is possible or useful to establish a legal boundary between airspace and outer space has been debated in the doctrine for quite a long time. . . . no agreement exists on a fixed airspace - outer space boundary . . ."
7. ^ PDF on the FAI website
8. ^ a b c "A long-overdue tribute". NASA. 2005-10-21. Retrieved 2006-10-30.
9. ^ "World Book @ NASA". NASA. Retrieved 2006-10-18.
10. ^ "Space Environment and Orbital Mechanics". United States Army. Retrieved 24 April 2012.

Publicité ▼

Contenu de sensagent

• définitions
• synonymes
• antonymes
• encyclopédie

• definition
• synonym

dictionnaire et traducteur pour sites web

Alexandria

Une fenêtre (pop-into) d'information (contenu principal de Sensagent) est invoquée un double-clic sur n'importe quel mot de votre page web. LA fenêtre fournit des explications et des traductions contextuelles, c'est-à-dire sans obliger votre visiteur à quitter votre page web !

Essayer ici, télécharger le code;

Solution commerce électronique

Augmenter le contenu de votre site

Ajouter de nouveaux contenus Add à votre site depuis Sensagent par XML.

Parcourir les produits et les annonces

Obtenir des informations en XML pour filtrer le meilleur contenu.

Indexer des images et définir des méta-données

Fixer la signification de chaque méta-donnée (multilingue).

Renseignements suite à un email de description de votre projet.

Jeux de lettres

Les jeux de lettre français sont :
○   Anagrammes
○   jokers, mots-croisés
○   Lettris
○   Boggle.

Lettris

Lettris est un jeu de lettres gravitationnelles proche de Tetris. Chaque lettre qui apparaît descend ; il faut placer les lettres de telle manière que des mots se forment (gauche, droit, haut et bas) et que de la place soit libérée.

boggle

Il s'agit en 3 minutes de trouver le plus grand nombre de mots possibles de trois lettres et plus dans une grille de 16 lettres. Il est aussi possible de jouer avec la grille de 25 cases. Les lettres doivent être adjacentes et les mots les plus longs sont les meilleurs. Participer au concours et enregistrer votre nom dans la liste de meilleurs joueurs ! Jouer

Dictionnaire de la langue française
Principales Références

La plupart des définitions du français sont proposées par SenseGates et comportent un approfondissement avec Littré et plusieurs auteurs techniques spécialisés.
Le dictionnaire des synonymes est surtout dérivé du dictionnaire intégral (TID).
L'encyclopédie française bénéficie de la licence Wikipedia (GNU).

Changer la langue cible pour obtenir des traductions.
Astuce: parcourir les champs sémantiques du dictionnaire analogique en plusieurs langues pour mieux apprendre avec sensagent.

5415 visiteurs en ligne

calculé en 0,125s

Je voudrais signaler :
section :
une faute d'orthographe ou de grammaire
un contenu abusif (raciste, pornographique, diffamatoire)
une violation de copyright
une erreur
un manque
autre
merci de préciser :
allemand anglais arabe bulgare chinois coréen croate danois espagnol espéranto estonien finnois français grec hébreu hindi hongrois islandais indonésien italien japonais letton lituanien malgache néerlandais norvégien persan polonais portugais roumain russe serbe slovaque slovène suédois tchèque thai turc vietnamien
allemand anglais arabe bulgare chinois coréen croate danois espagnol espéranto estonien finnois français grec hébreu hindi hongrois islandais indonésien italien japonais letton lituanien malgache néerlandais norvégien persan polonais portugais roumain russe serbe slovaque slovène suédois tchèque thai turc vietnamien


text:
# Pydon'ts

## Improve your Python programming skills

### Start here.

294
##### Pydon't ask for permission, apologise

In Python, if you are doing something that may throw an error, there are many cases in which it is better to "apologise than to ask for permission". This means you should prefer using a try block to catch the error, instead of an if statement to prevent the error.

165
##### Pydon't unpack with slices

How should you unpack a list or a tuple into the first element and then the rest? Pydon't unpack with slices, prefer starred assignment instead.

815
##### Pydon't disrespect the Zen of Python

The "Zen of Python" is the set of guidelines that show up in your screen if you import this. If you have never read them before, read them now and again from time to time. If you are looking to write Pythonic code, write code that abides by the Zen of Python.


text:
mersenneforum.org Carol / Kynea Coordinated Search - Reservations/Status
 Register FAQ Search Today's Posts Mark Forums Read

2018-01-12, 05:22   #111
gd_barnes

May 2007
Kansas; USA

5·2,143 Posts

Quote:
 Originally Posted by wombatman Lucky for you I'm taking tomorrow off from work, so here's a Windows version compiled with the generic x86-64 GCC flags. Try it out and see if it works for you.
Excellent! It works! Thank you!

Perhaps Mark could post this more generic version on his site.

Mark, I will reserve bases 56 and 58 to n=10K. I'll post primes in the other thread.

2018-01-12, 06:35   #112
wombatman
I moo ablest echo power!

May 2013

22·449 Posts

Quote:
 Originally Posted by gd_barnes Excellent! It works! Thank you! Perhaps Mark could post this more generic version on his site. Mark, I will reserve bases 56 and 58 to n=10K. I'll post primes in the other thread.
Very welcome!

2018-01-12, 14:09   #113
rogue

"Mark"
Apr 2003
Between here and the

19·347 Posts

Quote:
 Originally Posted by gd_barnes Make or Makefile are not executables so trying to execute them does not work. When I type "make" or "makefile" at the command prompt it just says: Code: 'make' is not recognized as an internal or external command, operable program or batch file. What does "mingw64" mean? I have not compiled C programs in Windows/Linux before so you are going to have to be very basic here.
mingw64 is an application which give you access to many of the unix command line programs that you are familiar with from Linux, such as grep and diff. It also has gcc/g++, a compiler for C/C++ code. make is another program that is bundled with mingw64 that will build libraries or executables using a makefile, which has the switches and other settings needed to build said library/executable.

mingw64 is free to d/l and install and everything that comes with it is free to use. You just need to add mingw64's bin directory to the PATH environment variable.

For your Linux distro you would need to install the packages that include make and gcc/g++ then you can build.

2018-01-12, 14:13   #114
rogue

"Mark"
Apr 2003
Between here and the

19×347 Posts

Quote:
 Originally Posted by wombatman Lucky for you I'm taking tomorrow off from work, so here's a Windows version compiled with the generic x86-64 GCC flags. Try it out and see if it works for you.
I assume you modified the makefile. Let me know what compile and link switches you used I would guess that you removed "-march=native". In most of my software I avoid using -march as much as possible as it reduces cross-platform compatibility, but not in cksieve as I started with a makefile used by another program. I will eventually make that multi-threaded and when I do it will not use that switch.

2018-01-12, 16:11   #115
wombatman
I moo ablest echo power!

May 2013

22·449 Posts

Quote:
 Originally Posted by rogue I assume you modified the makefile. Let me know what compile and link switches you used I would guess that you removed "-march=native". In most of my software I avoid using -march as much as possible as it reduces cross-platform compatibility, but not in cksieve as I started with a makefile used by another program. I will eventually make that multi-threaded and when I do it will not use that switch.
I changed from "native" to "x86-64" as that appeared to be the most generalized 64-bit flag I could use. That was the only change and it compiled under MinGW and the Win10 Ubuntu bash shell without any other modification needed.

The GLIBC error Gary got appears to be due to using the older version of Ubuntu. From a quick search around, it seems that one simply can't get the appropriate version of GLIBC unless you compile it yourself for the older distros.

Edit: And I set the ARCH flag to x86-64, not sse.

Last fiddled with by wombatman on 2018-01-12 at 16:11

 2018-01-12, 22:31 #116 gd_barnes     May 2007 Kansas; USA 29DB16 Posts Base 56 is complete to n=10K; 3 new primes were found for n=1000-10K; base released. Base 58 is complete to n=10K; 3 new primes were found for n=1000-10K; base released. Reserving base 202 to n=10K.
 2018-01-14, 10:04 #117 gd_barnes     May 2007 Kansas; USA 5·2,143 Posts Base 202 is complete to n=10K; 11 new primes were found for n<=10K; base released. All bases <= 204 are now complete to n=10K. :-) Last fiddled with by gd_barnes on 2018-01-14 at 10:04
 2018-01-17, 01:54 #118 gd_barnes     May 2007 Kansas; USA 5×2,143 Posts For historical reference: All bases shown on the primes page have been doublechecked to n=2500. Base 22 has been doublechecked to n=10K. PRP tests have been run on primes n>2500 for all bases. All corrections have been made. This includes all bases <= 204, 214, 218, 220, 222, 228, 252, 278, 290, 316, 326, 640, 688, 720, 1656, 1968, 2010, 2026, 2264, 2482, and 2634.
 2018-01-17, 03:43 #119 gd_barnes     May 2007 Kansas; USA 5×2,143 Posts Reserving base 34 to n=30K. I will doublecheck it to n=10K.
2018-01-24, 06:52   #120
gd_barnes

May 2007
Kansas; USA

5·2,143 Posts

Base 34 is complete to n=30K. No primes were found for n=10K-30K.

This was unexpected. It is the largest primeless gap for b<38 and n<=30K. It is a fairly heavy weight base and the last prime was at n=8093. For that reason I'm attaching results.

Base 34 was also doublechecked to n=10K. No problems found.
Attached Files
 results-near-squares-base34-10K-30K.txt (383.6 KB, 246 views)

Last fiddled with by gd_barnes on 2018-01-24 at 07:07

2018-01-24, 20:07   #121
sweety439

"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36

23×32×47 Posts

Quote:
 Originally Posted by gd_barnes Base 34 is complete to n=30K. No primes were found for n=10K-30K. This was unexpected. It is the largest primeless gap for b<38 and n<=30K. It is a fairly heavy weight base and the last prime was at n=8093. For that reason I'm attaching results. Base 34 was also doublechecked to n=10K. No problems found.
Don'e forget, the bases b<38 include bases 4, 8, 16, 32 and 36, although they are not shown in the webpage.

 Similar Threads Thread Thread Starter Forum Replies Last Post rogue And now for something completely different 256 2022-05-17 19:50 rogue And now for something completely different 10 2021-10-01 22:17 sweety439 And now for something completely different 3 2020-03-29 23:41 rogue And now for something completely different 37 2016-06-18 17:58 Kosmaj Riesel Prime Search 7 2007-07-13 22:15

All times are UTC. The time now is 08:49.

Sat May 21 08:49:36 UTC 2022 up 37 days, 6:50, 0 users, load averages: 0.72, 1.12, 1.25


text:
# If you supected, but had no evidence, that a firend of yours had committed a crime, what would you do?

For Macbeth written by Shakespeare


text:
Estimating the Time to the Most Recent Common Ancestor for the Y chromosome or Mitochondrial DNA for a Pair of Individuals
Bruce Walsh

Abstract

Bayesian posterior distributions are obtained for the time to the most recent common ancestor (MRCA) for a nonrecombining segment of DNA (such as the nonpseudoautosomal arm of the Y chromosome or the mitochondrial genome) for two individuals given that they match at k out of n scored markers. We argue that the distribution of the time t to the MRCA is the most natural measure of relatedness for such nonrecombining regions. Both an infinite-alleles (no recurring mutants) and stepwise mutation model are examined, and these agree well when n is moderate to large and k/n is close to one. As expected, the infinite alleles model underestimates t relative to the stepwise model. Using a modest number (20) of microsatellite markers is sufficient to obtain reasonably precise estimates of t for individuals separated by 200 or less generations. Hence, the multilocus haplotypes of two individuals can be used not only to date very deep ancestry but also rather recent ancestry as well. Finally, our results have forensic implications in that a complete match at all markers between a suspect and a sample excludes only a modest subset of the population unless a very large number of markers (>500 microsatellites) are used.

MOLECULAR marker information has proven an invaluable tool for assessing the degree of relatedness between individuals. To date, most uses of marker information have been concerned with zero-, one- or two-, or deep-generation relatives. By zero-generation, we mean matching/rejecting a forensic sample and a suspect. One- or two-generation assessment includes paternity testing and assessing the degree of relatedness between individuals in natural populations. Typically, these tests have very low power for detecting relatives more distant than sibs and first cousins (Queller and Goodnight 1989; Lynch and Ritland 1999). Finally, human geneticists have been very successful in using marker information to assess very deep relationships, on the order of hundreds (or more typically thousands) of generations. Many of these deep relationship studies have used the haplotypes of nonrecombining chromosomes, such as the nonpseudoautosomal arm of the Y (e.g., Hammer 1995; Dekaet al. 1996; Skoreckiet al. 1997; Bianchiet al. 1998; Kittleset al. 1998; Wilson and Balding 1998; Thomaset al. 2000) and mitochrondial DNA (e.g., Torroniet al. 1994; Merriwetheret al. 1995; Forsteret al. 1996; Brownet al. 1998; Stone and Stoneking 1998; Torroniet al. 1998). Here we show how haplotype information can also be used to estimate the age of the common ancestor for individuals sharing an intermediate ancestry (tens to hundreds of generations) with reasonable precision. Since our comparison is restricted to the time to the common ancestor for a particular pair of individuals of interest, the fine details of the population history and structure do not enter into the analysis, other than very weakly through the mean of the assumed prior (as discussed below).

For unlinked markers, the product rule (multiplying single-locus genotype probabilities together to obtain a multilocus genotype probability) applied to highly polymorphic loci allows just a few (5-10) unlinked markers to be quite sufficient for identifying individuals that share a common relative in the last generation (such as parent-offspring or sibs). However, because of recombination, unlinked markers have very weak power for distinguishing individuals sharing deeper common ancestry. While there is a growing body of literature on estimating relatedness of two individuals given autosomal marker information (Thompson 1975; Queller and Goodnight 1989; Blouinet al. 1996; Ritland 1996; Marshallet al. 1998; Lynch and Ritland 1999), it is less clear how to proceed when using markers from nonrecombining DNAs. The product rule does not hold for such regions, as the markers are inherited as a single block.

The key to assessing the amount of relatedness using markers on a nonrecombining chromosome is that any two individuals (indeed, the entire population) will have a most recent common ancestor for that region. This follows from coalescence theory (Hudson 1991; Donnelly and Tavaré 1995), which shows that in a demographically stable population the expected time back to this most recent common ancestor (MRCA) follows a geometric distribution with parameter λ = 1/Ne, the inverse of the appropriate measure of effective population size [the effective numbers Nm and Nf of males and females for the Y and mitochondrial (mt)DNAs, respectively]. Using marker information, we can estimate the time t to the MRCA, and it is the distribution of t that provides a natural metric for describing the relatedness (at least for that region) between two individuals. It is important to stress this difference between the MRCA of a region of DNA and the MRCA for two individuals. Two individuals can easily share an ancestor that is more recent than their MRCA for a particular DNA region. Hence, estimates of the time to the MRCA using a particular DNA region provide an upper bound on the time back to the most recent common ancestor shared by two individuals.

Here we develop a Bayesian estimator for t, obtaining the complete posterior distribution for the time t to the MRCA. We assume that n markers are scored on the nonrecombining chromosome of interest (either the Y or mtDNA) and that we observe matches in allelic state at k of these. We start by assuming the infinite alleles model, where each mutation is assumed to be unique. We then modify our results by assuming a (symmetric single-step) stepwise mutational model, which is a more appropriate descriptor for microsatellite markers. As we show, when k/n is close to one and n moderate to large, the two different mutational models give essentially the same distribution for t.

THE INFINITE ALLELES MODEL

Suppose we score the allelic states at n defined markers on a nonrecombining segment of DNA for two individuals and we wish to estimate the time back to their MRCA (for this segment). We first assume for each marker that (at most) only a single mutation has occurred over both lineages leading from the MRCA to the two individuals being considered. This is not an unreasonable assumption if the individuals match at most markers. We refer to this model as the infinite alleles model, as our development is also exact for the situation where each mutation is unique so that matches occur only when the marker locus in both lines has not mutated. Finally, we assume that the markers are exchangeable in the sense that the per-generation mutation rate μ is the same for each locus. We relax these assumptions below.

Let q(t) be the probability of a match (at any given single marker) between two individuals with a most recent common ancestor t generations ago. The number of matches (k) out of n loci follows a binomial distribution, with Pr(k)=n!(nk)!k!q(t)k[1q(t)]nk. (1) Ignoring matches created by parallel and/or back mutations, the probability that a marker matches after t generations is simply (1 - μ)2t, as the probability of no mutations occurring in the lineage from the ancestor to individual one is (1 - μ)t, with a similar probability from the MRCA to individual two. Hence, q(t)=(1μ)2te2μt=eτ, (2a) where τ=2μt (2b) is the time scaled as total generations of divergence times the mutation rate. Note that the expression given by Equation 2a is a lower bound for the probability of a match, as if back mutations occurred in one (or both) lineages, or, if both lineages experienced parallel mutations, we also observe a match. These types of matches require at least two mutational events, and hence from the first two terms of the Poisson distribution their probability is bounded above by 1 - exp(-2μt)(1 + 2μt), i.e., on the order of (2μt)2exp(-2μt). Thus if 2μt ≪ 1, the effects of such multiple mutations have only a trivial effect on increasing q(t) over the value assuming no mutations (see Figure 4). When a specific value of μ is required, we generally use μ = 1/500 = 0.20%, motivated by estimates for Y chromosome microsatellites of 0.28% (Kayseret al. 2000) and 0.21% (Heyeret al. 1997), which are very similar to the estimated mutation rates of 0.1 to 0.21% for autosomal microsatellites (Weber and Wong 1993; Brinkmannet al. 1998). We note that these mutation rate estimates are generally done by scoring microsatellites already known to be polymorphic, which introduces a slight ascertainment bias. However, since we assume the markers being scored are also chosen because they are known to be polymorphic (in the population as a whole), then these potentially biased estimates of mutation rates are appropriate for our analysis.

From Equations 1 and 2a, the resulting likelihood for the time t back to the MRCA given that we observe k out of n matches is L(tn,k)=n!(nk)!k!ekτ(1eτ)nk. (3) Setting the derivative of ln(L) equal to zero gives the maximum-likelihood estimate (MLE) for τ^=2t^μ as τ^=2t^μ=ln(nk). (4) Hence, the MLE for the time back to the MRCA becomes t^=12μln(nk). (5) Note that the MLE is not especially informative, as the distribution for t is highly positively skewed, resulting in a considerable variance and highly asymmetric confidence intervals about the MLE. In particular, note that the MLE is zero for all values of n when there are no mismatches (k = n), which tells us nothing about the possible restrictions on the maximal time back to the MRCA (see Fu and Li 1996 and Donnellyet al. 1996 for a related discussion).

BAYESIAN POSTERIOR DISTRIBUTIONS FOR TIME TO MRCA

While the MLE describes one feature of the distribution of t (the mode), the most complete picture is given by the full posterior distribution of t, which can be obtained by a Bayesian analysis (e.g., Lee 1997). Such an analysis proceeds from Bayes’ theorem, with the posterior distribution p(t|k) being proportional to the product of a prior distribution p(t) for t and a likelihood L(t|n, k) given the data (k out of n matches), p(tk)L(tn,k)p(t). (6)

The main objection to a Bayesian analysis raised by non-Bayesians is that the choice of a prior is often very subjective and, as such, this can greatly bias the posterior. For the time back to the MRCA, an appropriate prior naturally follows from standard coalescence theory, as the expected time back to a MRCA under pure drift in an effective population size of Ne follows the geometric distribution with success parameter Ne1 (e.g., Wilson and Balding 1998). The parameter is 1/Ne in this case [as opposed to 1/(2Ne) for an autosomal gene] because the uniparental inheritance means that both mtDNA and the Y chromosome are essentially haploid. As summarized by Hammer (1995), estimates for Ne based on the standing level of variation at presumably neutral markers are on the order of 5000 in humans for both mtDNA and the male-specific region of the Y chromosome.

Treating time as continuous, the geometric prior is equivalent to using an exponential distribution with hyperparameter λ=Ne1 . Thus, the natural prior for the time to MRCA (in the absence of any marker information) is to use p(t)=λexp(λt),whereλ=Ne1. (7) Taking the limit as λ → 0 gives an (improper) flat prior. As we will shortly see, the actual value of λ used has at best a trivial effect on the posterior distribution unless most markers do not match (kn) and the effective population size is extremely small. Thus the prior is both well motivated and the choice of the prior hyperparameter (λ) has very little effect on the final (posterior) distribution in most cases.

Recalling Equation 3, the resulting posterior distribution becomes p(tk)L(tn,k)p(t)=exp[(2μk+λ)t](1exp[(2μt)])nk (8a) so that p(tk)=exp[(2μk+λ)t](1exp[(2μt)])nkI(μ,k,n,λ), (8b) where the normalizing constant is given by I(μ,k,n,λ)=0exp[(2μk+λ)t](1exp[(2μt)])nkdt. (9) The impact of the choice of the hyperparameter λ for the prior immediately follows from Equation 8a. Provided 2μk ≫ λ, alternate choices of λ have little effect on the posterior distribution. Since λ=Ne1 , this rearranges to 2Neμk ≫ 1. For a mutation rate of μ = 1/500, the choice of Ne (and hence λ) has essentially no effect on the prior provided Nek ≫ 250, which is a very mild restriction.

Returning to the posterior distribution, the normalizing constant is easily computed by expanding the (1 - e-2μt)n-k term, noting that we can express the function being integrated as exp[(2μk+λ)t](i=0nk(1)i(nk)!i!(nki)!exp[(2μti)])=i=0nk(1)i(nk)!i!(nki)!exp[(2μ(k+i)+λ)t]. (10) Thus I(μ,k,n,λ)=i=0nk(1)i(nk)!i!(nki)!0exp[(2μ(k+i)+λ)t]dt=i=0nk(1)i(nk)!i!(nki)!12μ(k+i)+λ=2nk(nk)!μnki=0nk[λ+2μ(ni)]. (11a) The last step can be shown either by induction or by using a standard symbolic algebra package (such as Mathematica).

With a flat prior (λ = 0) the normalizing term further simplifies to I(μ,k,n,0)=(nk)!(k1)!(2μ)n!. (11b) Hence, the posterior density becomes p(tk,λ)=(i=0nk[λ+2μ(ni)]2nk(nk)!μnk)(1exp[2μt])nkexp[t(2μk+λ)]. (12)

For zero marker mismatches (k = n), the posterior is simply an exponential distribution with parameter λ + 2nμ, p(tk=n)=(λ+2nμ)exp[(2μn+λ)t]. (13) It immediately follows that the mean (μt) and standard deviation (σt) for the time to MRCA when there are no mismatches are μt=σt=1λ+2nμ12nμ. (14a)

Likewise, the cumulative probability distribution for the time back to the MRCA is just Pr(tT)=0Tp(tk=n)dt=1exp((2μn+λ)T). (14b) In particular, the time Tα satisfying Pr(tTα) = α is given by Tα=ln(1α)2μn+λ. (14c) Assuming a flat prior (λ = 0), if two individuals are identical at all n marker loci, there is a 90% probability they shared a MRCA in the last 1.15/(μn) generations. The values for 50, 95, and 99% are 0.347, 1.498, and 2.303 (μn)-1 generations, respectively.

The posterior distributions with one or more mismatches also follow from Equation 12. For example, for one (k = n - 1) and two (k = n - 2) mismatches, the posteriors are p(tk=n1)=((λ+2nμ)(λ+2μ[n1])2μ)1exp[(2μt)]exp[t(2μ(n1)+λ)] and p(tk=n2)=((λ+2nμ)(λ+2μ[n1])(λ+2μ[n2])8μ2)×(1exp[(2μt)])2exp[t(2μ(n2)+λ)]. The mean and variance for the posterior distribution for any value of k again follow by expanding the (1 - e-2μt)n-k term. Define h(μ,k,n,λ)=0texp[(2μk+λ)t](1exp[2μt])nkdt (15a) and g(μ,k,n,λ)=0t2exp[(2μk+λ)t](1exp[2μt])nkdt. (15b) Expanding and term-by-term integration gives h(μ,k,n,λ)=i=0nk(1)i(nk)!i!(nki)!1(2μ(k+i)+λ)2 (16a) g(μ,k,n,λ)=i=0nk(1)i(nk)!i!(nki)!2(2μ(k+i)+λ)3. (16b) Hence, the mean and variance for the time t to the MRCA, given k of n marker loci match, a prior with hyperparameter λ, and a per marker mutation rate of μ, are given by μt=h(μ,k,n,λ)I(μ,k,n,λ) (17a) and σ2(t)=g(μ,k,n,λ)I(μ,k,n,λ)μt2. (17b)

Figures 1, 2, 3 plot the posterior distributions corresponding to different numbers of matches (k) for n = 5, 10, 20, 50, and 100 markers under the assumption that μ = 1/500 and there is a flat prior (λ = 0). Provided that Ne ≫ 250, the results are the same for any other prior using λ = 1/Ne.

Table 1 summarizes the mean, standard deviation (SD), and mode (the MLE) for the posterior distributions as well as the 2.5, 50, 90, and 97.5% cutoff values. Note that a 95% credible region for t is given by the 2.5 and 97.5% values. As expected, the distribution of t is highly skewed, as mode < median < mean. The distribution becomes increasingly skewed to the right as the number of mismatches increases, which is reflected in not only an increase in the mean but also in the variance. However, note that the mean/SD ratio declines with increasing numbers of mismatches, so that the coefficient of variation declines as k decreases.

Finally, note that the resolution for t offered by using n = 5 markers is very poor, but rather fine precision is offered by using 100 markers. While scoring the latter number of markers may be unrealistic, using 20 markers is both feasible as well as offering reasonable precision.

DIFFERENTIAL MUTATION RATES

As our knowledge of the parameters associated with the mutational process continues to improve, it is likely that we may find significant differences in the mutation rates at different markers. Fortunately, it is straightforward to modify the likelihood function (Equation 3) to take this into account. Suppose n markers are examined, generating the matching data x1,..., xn, where the xi are coded as xk={1match at markerk0no match at markerk.} The likelihood becomes L(x1,,xnt)=k=1nqk(t)xk[1qk(t)]1xk, (18a) where qk(t)=(1μk)2te2tμk, (18b) giving L(x1,,xnt)=exp[2tk=1nμkxk]k=1n[1e2tμi]1xk. (18c) Using an exponential prior with hyperparameter λ, the posterior is proportional to p(tx)exp[t(λ+2k=1nμkxk)]k=1n[1e2tμi]1xk. (19) In any particular data set, the normalization constant is easily obtained by expanding the product involving 1 - e-2tμi, which generally involves only a few terms unless there are a significant number of mismatches.

Figure 1.

—The posterior distributions for the time to the most recent common ancestor (MRCA) between two individuals assuming 5 (top) and 10 (bottom) marker loci were scored and k matches are observed. A flat prior (λ = 0) and a mutation rate of μ = 1/500 were assumed. Numbers indicate number of marker alleles k that match between the two individuals. Values for another mutation rate μ* are given by scaling the values by μ*/μ. Time is measured in generations.

For the simplest case of no mismatches (k = n), the posterior for the time to the MRCA becomes p(tno mismatches)=(λ+2nμ)exp[t(λ+2nμ)], (20a) where μ is the mean mutation rate across all markers. Equations 14a, 14b, 14c hold with μ replaced by the mean mutation rate μ . Likewise, for one mismatch (say marker i), the posterior becomes [2(n1)μi+λ][2(nμ)+λ]2μiexp[t(λ+2(n1)μi)][1e2tμi], (20b) where μi is the mean mutation rate for all markers, excluding marker i.

CORRECTING FOR MULTIPLE HITS: THE STEPWISE MUTATION MODEL

Microsatellites, given their higher mutation rates compared to single nucleotide polymorphisms (SNPs), are clearly the marker of choice for estimating the time to MRCA when the individuals are assumed to be at least modestly related. As microsatellite “alleles” correspond to different lengths of the repeat unit in the microsatellite array, the infinite alleles model assumed previously is not appropriate if multiple mutations are expected in any given marker. Since mutations change the number of repeats (and hence the size) of an array, two (or more) mutations can recover the initial state found in the MRCA. Likewise, parallel mutations in both lineages leading from the MRCA can also lead to the two individuals sharing the same allelic state, even though mutations have occurred. Thus, using an infinite alleles model for microsatellites will tend to underestimate the time to the MRCA. To examine the severity of this underestimation, we consider the divergence, assuming a stepwise mutational model (SMM) assuming equal probabilities of an up (increase array size by one) or down (decrease array size by one) move (the symmetric single-step SMM). The roots of the SMM trace from Ohta and Kimura’s (1973) model of charge differences in electrophoretically scored proteins. A number of workers have shown this model to be a good fit for microsatellites in both indirect studies examining the distribution of array sizes in natural populations (Edwardset al. 1992; Shriveret al. 1993; Valdeset al. 1993; Di Rienzoet al. 1994) and direct studies looking at actual mutations arising in pedigrees (Brinkmannet al. 1998; Kayseret al. 2000). In the latter two studies, the vast majority (35 out of 37) of new mutations were single step, while the remaining (2 out of 37) were two step.

Figure 2.

—Posterior distributions for time to MRCA for 20 (top) and 50 (bottom) markers. Details are as in Figure 1.

Denote the allelic state (array size) in the MRCA as state 0, and let Xt denote the array size at time t. As before we assume a per-generation mutation rate of μ. Under this model, the transition probabilities between states become Pr(X(t+1)=i1X(t)=i)=Pr(X(t+1)=i+1X(t)=i)=μ2Pr(X(t+1)=iX(t)=i)=1μPr(X(t+1)X(t)2X(t)=i)=0. (21)

To apply this model, we need to compute q(t), the probability of a match between two lineages sharing a MRCA t generations ago. A little thought shows that for the one-step model allelic states in two lineages can only match if an even number (2M) of mutations have occurred. The appendix shows that Pr(match2Mmoves)=122M(2MM)=122M(2M)!(M!)2. (22) For example, after a total (between both lineages) of 2, 4, 6, 8, and 10 mutations, the probabilities that the marker allelic states match are 0.5, 0.375, 0.313, 0.273, and 0.246 (respectively). Thus, under this model there is a one in four chance that the two lineages share the same allelic state even after a total of 10 mutations have occurred.

Since the probability of 2M total mutations along both lineages assuming t generations back to the MRCA is given by a Poisson distribution with parameter 2tμ, we have the probability of a match conditioned on t as p(t)=M=0Pr(match2Mmoves)Pr(2Mmovest)=M=0(122M(2M)!(M!)2)((2μt)2M(2M)!)exp(2tμ)=exp(2tμ)(M=0(μt)2M(M!)2). (23) For example, considering only the first 10 mutations, p(t)=exp(2tμ)(1+(tμ)2+(tμ)44+(tμ)636+(tμ)8576+(tμ)1014,400). The general solution to Equation 23 follows by noting that k=0(x)2k(k!)2=I0(2x), (24) where I0 denotes the zero-order modified type I Bessel function (Olver 1964). Hence, under the single-step mutational model, the probability of a match after τ = 2μt generations is q(τ)=exp(τ)I0(τ). (25)

Figure 3.

—Posterior distributions for time to MRCA for 100 markers. Details are as in Figure 1.

Figure 4 compares the probability of a match as a function of τ for the infinite allele and one-step models. The match probabilities under both models are rather similar for τ < 0.5 (125 generations with μ = 1/500), but they diverge rather quickly after that. Note that even after 20τ generations (5000 generations with μ = 1/500), the match probability under the stepwise model is still nontrivial (0.09), reflecting the very slow decrease in the probability of a match as the total number of mutations increases. By contrast, the corresponding match probability is essentially zero (2.06 × 10-9) under the infinite alleles model, as a single mutation causes the allelic states to diverge and subsequent back (and/or parallel) mutations are not allowed.

As shown in Table 2, both the mean and variance (measured by the standard deviation) of the distribution for time to the MRCA are larger under the stepwise model than the infinite alleles model. This is certainly expected, as the effect of the stepwise mutational model is to allow for a match following two (or more) mutations, while a match is assumed to never recover following a mutation under the infinite alleles model. Table 2 gives the ratios of the means and standard deviations for the distribution of t under the stepwise model compared to the same statistic under the infinite alleles model. When the number of markers is large (20 or greater) and the number of mismatches is small, these ratios are close to one. The ratio of standard deviations is always larger than the means ratio, reflecting the longer tail (relative to that for the infinite alleles model) generated under the stepwise model. As the number of mismatches increases, the mean and SD ratios increase, reflecting increasingly larger probabilities for t under the stepwise relative to the infinite alleles model.

View this table:
TABLE 1

Summary of the posterior distribution p(t|k, n), where t is the time back to the most recent common ancestor (MRCA) for two individuals that match at k of n markers

Also note from Table 2 that for the same fraction of observed matches (say 4/5, 8/10, 16/20, 40/50, and 80/100), the ratios of the means and standard errors under the stepwise vs. the infinite alleles model decrease toward 1 as the number n of markers scored increases. For example, for 80% observed matches, assuming a flat prior (λ = 0), the mean ratios are 4.8, 1.34, 1.2, 1.1, and 1.1 (for n = 5, 10, 20, 50, and 100 markers). Likewise, the ratios of standard deviations are 34.2, 2.0, 1.3, 1.2, and 1.2. The reason for this can be seen by considering the case where we observe what appears to be a complete match at all n markers. In this case, there is some small chance that two (or more) mutations have occurred in one (or more) markers. However, if indeed a total of two mutations have occurred across both lineages, the probability that both occurred in the same marker is just 1/n (assuming the same mutation rate across markers). Hence, as the number of markers increases, the probability that a multiple mutation is masked decreases due to scoring changes over more loci.

Figure 4.

—The probability of a match in allelic state between two lineages with a MRCA t generations ago under the infinite alleles and stepwise models. Top, generations 0 to τ = 2μt = 1, which corresponds to 250 generations for μ = 1/500. Bottom, up through 20τ (5000 generations under this value of μ).

The final observation from Table 2 is that, unlike for the infinite alleles model, the choice of the hyperparameter λ for the prior can significantly affect the posterior distribution. This is true when the number of markers is very small and/or the fraction of mismatches is nontrivial. The most extreme difference between the two assumed mutational models is seen under a flat prior (λ = 0). As the value of λ increases (corresponding to a decrease in the assumed effective population size as λ = 1/Ne), the ratios of the means and standard deviations under the two models become increasingly similar. Almost all of this difference is due to significant decreases in the mean and variance under the distribution of t under the stepwise model as λ increases. This arises because the effect of increasing λ is to shorten the distributions of times to MRCA in the prior (decreasing Ne decreases the coalescent times), which in turn down-weights matches under the stepwise model from individuals with assumed very long times to the MRCA.

Our analysis under the SMM model considers markers only as showing a match or mismatch, ignoring any additional information on the differences between marker alleles when a mismatch has occurred. Over short time scales (on the order of 1/2μ < 1) we are likely not losing much information, as most markers will likely have at most one mutation and hence scoring a match vs. no match is sufficient. Over longer time scales, we are clearly losing information. In such cases, a logical extension of our model would be replacing the probability of a match with the probability that the two microsatellite alleles in the individuals being compared differ by r repeats. This is accomplished as follows. Consider the probability of an even number (2k) of differences between microsatellite array sizes. Again, a little thought shows that this can occur only with an even number of total mutations (2M). With a total of 2M mutations, the probability that the array sizes differ by 2k is the probability that the number of up (+) mutations is either M + k or M - k (by symmetry, these two probabilities are the same under the SMM). Thus, the probability of a difference (in absolute value) of Δ = 2k given 2M total mutations is Pr(Δ=2k2M)=2(12)2M(2MMk)forkM. (26) Since M follows a Poisson distribution with mean 2μt, the probability of a difference of 2k given the time t to the MRCA is Pr(Δ=2kt)=M=kPr(Δ=2k2M)Pr(2Mt)=M=k2(12)2M(2MMk)e2μt(2μt)2M(2M)!=2e2μtM=k(μt)2M(Mk)!(M+k)!=2e2μtI2k(2μt) (27a) where Is denotes the s-order modified type I Bessel function (Olver 1964).

Using the same logic, for a difference of 2k + 1 an odd number (2M + 1) of total mutations are required, and following the same steps leading to Equation 27a gives Pr(Δ=2k+1t)=2e2μtI2k+1(2μt). (27b) Hence, the probability that the array sizes for two alleles differ by j after τ = 2μt generations is q(j)(τ)=2exp(τ)Ij(τ)forj1. (28) Figure 5 plots the probability for 0, 1, 2, 3, and ≥4 differences in array size as a function of τ. F. Rousset (personal communication) kindly pointed out that Equation 28 can be found buried in Wehrhahn (1975), who obtained this result using the method of generating functions (also see Li 1976; Wilson and Balding 1998).

View this table:
TABLE 2

The increase in the mean and standard deviation (SD) for the time to the MRCA under the stepwise mutational model as compared to the infinite alleles model (Table 1)

The likelihood function follows from the multinomial distribution. If a total of n markers are scored, and ni denotes the number of markers differing in size by i (with the largest difference being k), then L(tn0,,nk)=n!n0!n1!nk!j=0k[q(j)(2μt)]nj. (29) Again using an exponential prior, the resulting posterior distribution is proportional to p(tn0,,nk)j=0k[q(j)(2μt)]njeλt=2nn0e(λ+2μn)tj=0k[Ij(2μt)]nj. (30) The full distribution is recovered by numerical integration to normalize the posterior, viz., p(tn0,,nk)=e(λ+2μn)tj=0k[Ij(2μt)]nj0e(λ+2μn)tj=0k[Ij(2μt)]njdt. (31)

As an example of applying Equation 31, consider haplotypes 1 and 3 from Thomas et al.’s (2000) study on the Lemba and the Cohen (Y chromosome) modal haplotype. Six microsatellite markers were scored and, of these, both alleles match at four markers, while one marker differs by one repeat and another by two repeats. In this case, Equation 31 becomes p(t4,1,1)e(λ+2μ6)t[I0(2μt)]4I1(2μt)I2(2μt). Table 3 compares the estimated parameters under this model with those estimated using the infinite alleles and SMM matching models. Figure 6 plots the resulting posterior distributions. We use μ = 0.245% (the average of the Kayseret al. 2000 and Heyeret al. 1997 estimates) and a prior of λ = 1/5000 (from Hammer’s 1995 estimate of Ne for the Y) for these results.

While Equation 31 provides the foundation for a full Bayesian analysis, we caution that its usefulness depends on accurately capturing the mutation model for the markers in question. While the stepwise mutation model seems a reasonable fit, the fine details are still unclear. For example, there are suggestions that mutation rate may increase with array size (Brinkmannet al. 1998; Fu and Chakraborty 1998) but also observations that suggest this is not the case (Valdeset al. 1993). There are also observations suggesting a bias toward increased array size (Kayseret al. 2000; Fu and Chakraborty 1998), and although most mutational steps change array size by one, mutations of two or more steps are seen (Brinkmannet al. 1998; Kayseret al. 2000). Finally, there may be multiple molecular processes operating at microsatellites, such as a majority of small changes against a background of rare major changes (Di Rienzoet al. 1994) or independent deletions (Walsh 1987). Until these details are sorted out, the risk run by using a model to correct for multiple mutations is that at least as much bias could be introduced by assuming an incorrect mutation model as is removed by accounting for multiple hits. One approach would be to use Fu and Chakraborty’s (1998) minimum chi-square approach for estimating the generalized stepwise mutation model and compare the minimal (best) fitting parameters with those for the symmetric single-step model that we have assumed.

DISCUSSION

Both the Y chromosome and mtDNA have been successfully used for assessing deep ancestry, while unlinked autosomal markers have proven much more valuable for determining very recent ancestry. Here we examine the effectiveness of using multilocus haplotypes from a region of nonrecombining DNA (such as the majority of Y chromosome or mtDNA) to estimate the time t to the MRCA of two individuals for that region. We argue that, to assess the relatedness of individuals on the basis of their haplotypes in a region of nonrecombining DNA, the time to the MRCA is the natural replacement for probability calculations based on the product rule used for unlinked markers.

Figure 5.

—Probabilities that two microsatellite alleles that have been separated for a total of τ = 2μt generations differ in array size by 0, 1, 2, 3, and >3 repeats (computed using Equation 28). The single-step symmetric stepwise mutational model is assumed.

We assume n prechosen markers are examined and are (initially) coded as either matching (agreeing in allelic state) or not matching. Using a Bayesian approach, the resulting posterior distribution for t is a function of n, the number of matches k, the per-marker mutation rate μ, and the hyperparameter λ = 1/Ne (the reciprocal of the effective population size) of the assumed prior distribution of t (the assumed distribution for the time to the MRCA for two random individuals in the absence of any marker information). We examined two rather different mutation models—infinite alleles (each mutation is unique, with a match implying no mutation at that marker since the MRCA) and the SMM (which allows for matches created by several parallel mutations).

View this table:
TABLE 3

Estimated time to MRCA between haplotypes 1 and 3 of Thomas et al. (2000)

Figure 6.

—Posterior distributions for t, the estimated time to MRCA, between Y chromosome haplotypes 1 and 3 of Thomas et al. (2000). IAM, infinite alleles model; SMM0, stepwise mutational model only scoring matches vs. no match; SMME, stepwise mutation model scoring number of differences between array sizes. See the Table 3 legend for further details.

Our results show that it is possible to use Y or mtDNA marker information to provide reasonable estimates for t when individuals share a MRCA of intermediate age (tens to hundreds of generations when μ = 10-3), provided a sufficient number of markers are scored (Table 1, Figures 1, 2, 3). Estimates using only 5 markers have distributions that are highly skewed for large t values, especially when the possibility of back mutations regenerating a match is taken into account (i.e., the SMM model). As the number of markers increases, the width of the credible intervals around an estimate of t decreases. While 10 markers give a reasonable interval, 20 markers seems a more workable tradeoff between cost and precision. Our results also suggest that the forensic use of either the Y or mtDNA is rather limited. They can be used for exclusion, but make only weak probability statements about a sample and a suspect when there is a complete match. Using Equation 14c, a complete match at 10 out of 10 markers between a sample and a suspect implies only that the individual generating the sample and the suspect have a 90% chance of sharing a MRCA no more than 58 generations ago (assuming a typical microsatellite mutation rate of μ = 1/500). With a complete match, the number of markers that need to be scored to have a 90% probability that the sample and suspect have a MRCA no more than 1 generation ago is ∼580, an order of magnitude more than the number of currently known Y-linked markers (M. Hammer, personal communication). A 50% probability that the MRCA does not exceed 1 generation requires roughly 340 microsatellite markers.

We obtained the posterior distributions for t given the marker data by using a Bayesian analysis, which requires a prior distribution for t. From standard population-genetics theory, t follows a geometric distribution with success parameter 1/Ne (as the Y and mtDNA behave as haploids). Hence, the functional form of the prior is well motivated, while its exact shape is determined by the hyperparameter λ = 1/Ne used for any particular prior. For the infinite alleles model, the actual value of λ had essentially no effect unless we used a very small value for Ne (<200) and/or there were a very significant number of mismatches (k/n ≪ 1). Thus, we used a flat prior (λ = 0, corresponding to an infinite effective population size) for the general results tabulated, although the equations given cover arbitrary values of λ ≥ 0. Conversely, under the stepwise model, the value of λ often had a significant effect on the posterior, especially when the number of markers n is small and the number of matches is modest or poor (k/n ≪ 1). In such cases, the use of a flat prior gave the largest difference in the posteriors for the two mutational models. As the value of λ is increased (corresponding to decreasing Ne), the posteriors under the two different models become increasingly similar (Table 2). This occurs because, as we decrease Ne, we make the initial assumption that individuals with long times to the MRCA become increasingly unlikely. It is these individuals that still have a modest probability of showing a match under the stepwise model, greatly inflating the estimated times to the MRCA relative to the infinite alleles estimate. In cases where there was a recent population expansion (or contraction) or a selective sweep, the distribution of times to MRCA may deviate from a geometric distribution. However, even in such cases, we expect there to be little dependence on the prior except in cases where changes in λ under a geometric prior have a significant effect on the posterior.

One potential issue of concern is whether our results are somehow biased by scoring only markers known to be polymorphic in the human population as a whole (but not necessarily in the particular pair of individuals being contrasted). When the goal is to estimate the coalescent time for an entire population, using markers known (in advance) to be polymorphic in the population of interest creates an ascertainment bias that needs to be corrected (e.g., Nielsen 2000). In our analysis, μ is the mutation rate for microsatellites conditional on their being polymorphic. However, since the estimates of microsatellite mutation rates used are also ascertained by scoring microsatellites known to be polymorphic, we have corrected for this effect. When considering random microsatellites, the mutation rate μ in our analysis is replaced by cμ, where c > 1 is an ascertainment correction that can be specified only by knowing how the polymorphic markers were ascertained.

While we have implicitly framed much of our discussion in terms of microsatellites [simple tandem repeats (STRs)], SNP data can be included by using the infinite alleles model and the appropriate mutation rates. Equation 18a allows the method to handle mixed (STRs and SNPs) marker data by using the appropriate expression for qk(t), the probability of a match for marker k at time t. For SNPs, the infinite alleles model is used, qk(t) = exp(-2μkt), while microsatellites use Equation 25, qk(t) = exp(-2μkt)I0(2μkt), which corrects for multiple hits under the stepwise mutation model (I0 denoting the zero-order modified type I Bessel function; Olver 1964). In either case, μk is the mutation rate for marker locus k. More generally, if microsatellite comparisons are coded by differences in size (as opposed to match/no match), Equation 28 gives the probability that two individuals differ by j steps at the kth microsatellite as qk(j)(τ)=2exp(2μkt)Ij(2μkt) , where Ij is the jth-order modified type I Bessel function.

Our approach is easily modified to estimate the time between an individual and a particular (known or inferred) ancestral haplotype. When comparing an individual’s haplotype against a fixed standard, we are following only one branch from the MRCA, so that q(t) = (1 - μ)t ∼ exp(-μt), as opposed to q(t) ∼ exp(-2μt) when looking at mutations over both branches. Hence, we simply replace the mutation rate μ by μ/2, and all of our previous results apply.

Estimation of the time to the MRCA for a sample of individuals (as opposed to our simpler setting of just two individuals) has been examined by Fu (1996) and Tavaré et al. (1997), under the assumption of an infinite sites model (Watterson 1975). These analyses assume a Poisson likelihood for the number of segregating sites, while we assumed a binomial likelihood for number of segregating sites under the assumption that the n sites to be scored in the two individuals were fixed in advance. Given that the rough figure is one common polymorphism every 10 kb for the human Y (M. Hammer, personal communication), focusing on specific sites known to be polymorphic in the population as a whole (as opposed to sequencing large regions) is not an unreasonable approach. When n is large and μ small, the two different likelihoods for estimating t should give very similar results.

As we tried to stress in several places, the major caveat to this (or any other) approach for estimating the time t to MRCA is our uncertainty about both the mutational process and rates. The Bayesian framework allows us to incorporate these uncertainties; for example, if p(μ) is some assumed prior for the mutation rates, then the marginal posterior (after integrating out μ) can be used to estimate t, p(tλ,marker information)L(tmarker information)p(λ)p(μ)dμ. However, practical application requires a reasonable prior for μ. An even more serious problem is the exact form the stepwise mutational model used for microsatellite loci. Using an inappropriate model can potentially introduce more bias than it corrects.

APPENDIX

Suppose a total of S mutations have occurred over the two lineages, with n mutations in lineage 1 and S - n in lineage 2, where n is a random variable. Let X1 and X2 denote the changes in array size from the common ancestor. What is the distribution for d = X1 - X2 (the difference in array size between the two lineages) conditioned on the total number of mutations S in both lineages? Jay Taylor (Department of Ecology and Evolutionary Biology, University of Arizona) suggested the following approach, which is considerably more elegant than a more brute force method I initially used. Define the random variable Zi as the change (±1) in array size generated by the ith mutation. Under the symmetric single-step model, Pr(Zi = +1) = Pr(Zi = -1) = ½. Further, X1=i=1nZiandX2=i=1SnZn+i. Noting that, in distribution, Zi = -Zi, it immediately follows that, in distribution, X1X2=i=1nZii=1SnZn+i=i=1nZi+i=1SnZn+i=i=1SZi. Hence the probability that the difference in array size is d given a total of S mutations over both lineages is simply the probability that the random walk given by the symmetric single-step model starting from state zero is in state d after S steps.

Using Taylor’s result, the probability that two arrays are the same size given that a total of 2M mutations have occurred between them equals the probability of M up moves and M down moves, or Pr(match2Mmutations)=(2M)!(M!)2122M.

Acknowledgments

Thanks go to Mike Lynch, Mike Hammer, Monty Slatkin, Francois Rousset, and Yun-Xin Fu for useful comments and advice and to Bennet Greenspan and Max Rothschild for dragging me into this problem in the first place. Special thanks go to Jay Taylor for very useful discussions on the probability of a match in two independent Markov chains. Curses go to Danny Gianola for planting the seed of Bayesian statistics and then adding plenty of fertilizer and to Bruce Southey, Sandra Rodriguez-Zas, and Dan Sorensen for useful tutoring. Two anonymous reviewers provided very useful comments and criticisms.

Footnotes

• Communicating editor: Y.-X. Fu