Sie sind auf Seite 1von 8

Tarefas OK.

A068996 Decimal expansion of 1 - 1/e.


Comentar A068996
A068985 Decimal expansion of 1/e.
COMMENT From the "derangements" problem: this is the probability that if a larg
e number of people are
given their hats at random, nobody gets their own hat.
Also, this is lim_{n->inf}P(n), where P(n) is the probability that a random root
ed forest on [n] be a tree.
See image from Wikipedia, <a href="http://commons.wikimedia.org/wiki/File:Seq1.p
ng">Graph of probabilities</a>.
Also, this is lim_{n->inf}P(n), where P(n) is the probability that a random root
ed forest on [n] is not connected.
See image from Wikipedia, <a href="http://commons.wikimedia.org/wiki/File:Seq1.p
ng">Graph of probabilities</a>.

1-1/e is the limit to which (1 - !n/n!) {= 1 - A000166(n)/A000142(n) = A


002467(n)/A000142(n)} converges as n tends to infinity. - Lekraj Beedassy (blekr
aj(AT)yahoo.com), Apr 14 2005
-----------------------------------------------------------------------------
Harmonic Numbers
n=1;
H=1/n
a = factorial(n)*H
n++;
H+=1/n
n=1;
H=1/n = 1
a = factorial(n)*H = 1
n++; H+=1/n = 3/2
a = 3
n++; H+=1/n = 11/6
a = 11
n++; H+=1/n = 25/12
a = 50
n++; H+=1/n = 137/60
a = 274
Possiveis sequencias de a e H.
Caso a
1,3,11,50,274,
a(n)=number of cycles in all permutations of [n]. Ja tem
harmonic number = A001008/A002805.
Ja existe numeradores e denominadores de H.
Cabe comentarios?
Nao tem ref a Knuth.
-------------------------------

----------------------------------------------------------------------
http://en.wikipedia.org/wiki/Floor_and_ceiling_functions#Rounding
The ordinary rounding of the positive number x to the nearest integer can be
expressed as floor(x+0.5)
!n = floor(n!/e + 0.5)
Exercise 19 of 1.3.3 Knuth V. 1.
The number !n of derangements on n objects is floor(n!/e + 0.5), so the
probability that a permutation is a derangement is floor(n!/e + 0.5)/n!.
'sequence A000166
1/e ~ 0.3678... is the limit of the probability that a randomly selected permuta
tion
is a derangement. The probability approaches this limit quite quickly.
Ou seja ambas as probabilidades tendem para 1/e.
(probabilidade de derangement e de random forest be a tree.) ver book.pdf pag 6
32.
Calculei a(i) tal que f(a(i)) - 1/e < 10^(-i), e f(a(i)+1) - 1/e >= 10^(-i).
A
funcao f eh a probabilidade de floresta conexa. Ou
a(i) is the least n such that f(n) - 1/e < 10^(-i-1). Acho que calculei isso, ma
s vou
conferir. Least n.
Com g a probabilidade de derangement, posso calcular
A(i) is the least n such that g(n) - 1/e < 10^(-i).
--------------------------1/e

______|__________|______________n

Para cada n da sequencia a posso ver a diferenca g(n) - 1/e essa diferenca e
h
muito menor. Assim eh very large n.
Os valores de n em A(i) mostram justamente que a convergencia para 1/e eh muito
mais
rapida. Por exemplo para n = 18 a diferenca eh menor que 10^(-2), se em A isso
ocorrer para n = 5, ta mostrando claramente que converge mais rapido.
Claro que posso fazer um desenho do grafico de g e f, MATLAB faz isso, por exemp
lo.
A sequencia floor(n!/e + 0.5) existe?
A000166 sim.
a(0) = 1, a(n) = [ n!/e + 1/2 ] for n > 0.
-------------
floor(x!/exp(1) + 1/2)/x!
http://commons.wikimedia.org/wiki/File:Seq1.png
------------------------------------------------------
Calculo de floor(n!/exp(1) + 1/2)/n!
Acho que vou usar PARI. n! e facil, inclusive quando o valor de n mudar, um for
resolve, exp(1) eh uma constante e vc tem.
E so mudar o valor da expressao. Quanto ao floor? Como pegar a parte inteira
do big n!/exp(1) + 1/2
com cout fica facil, copia e cola. Trabalhoso.
132.67
para calcular o expoente vai dividindo por 10 ate que o numero fique menor que
1, 132.67/10 = 13.267 -> 1.3267 -> 0.13267
1 2 3
Sabendo o expoente, ou a posicao do ponto, se tiver acesso aos digitos monta o
numero, 1*10^2 + 3*10^1 + 2
Como pegar o digito? Sei que sao 3 digitos. Divide por 10^2,
Acho que vou usar PARI. A funcao oscila em torno de 1/e.

g = floor(factorial(n)/exp(1) + 1/2)/factorial(n)

n=1; 1 2 34 5 6 7 89 0 1 2 34 5 67 8 90
1/exp(1) = 0.3 6 78 7 9 4 41 1 7 1 44 2 32 1 5955237701614608674458111
g = floor(factorial(n)/exp(1) + 1/2)/factorial(n)
g = 0
n+=1 = 2 g = 0.5
n+=1; => 3 *** g = 0.33
n+=1; => 4 g = 0.37
n+=1;=> 5 g = 0.366 ***
n+=1; => 6 g = 0.368
n+=1;=> 7, 7 *** g = 0.36785
n+=1; 8 g = 0.36788
n+=1; 9, g = 0.3678791
n+=1 = 10 g = 0.36787946
n+=1 = 11 g = 0.36787943
n+=1 = 12 g = 0.3678794413
n+=1 = 13 g = 0.36787944116...
n+=1 = 14 g = 0.367879441172
n+=1 = 15 g = 0.3678794411713
n+=1 = 16 g = 0.367879441171444
n+=1 = 17 g = 0.3678794411714421
n = 18 => 0.36787944117144232 942
19 => 0.36787944117144232 120321240179
%84 = 20 => 0.36787944117144232 16142441641283153
n+=1 = 21 g = 0.36787944117144232 1594
21 => 0.36787944117144232 1594671223064
--------------------------------------------------
A sequencia eh
3, 5, 7, 7, 9, 9, 10, 12, 12, 13, 14, 15, 16, 16, 17, 18, 18, 19, 21, 21
Conferencia com precisao maior. OK
Conferencia dos titulos
Least n such that (n/(n+1))^(n-1) - 1/e < 10^(-i), i = 1,2,3....
Least n such that |floor(n!/e + 1/2)/n! - 1/e| < 10^(-i), i = 1,2,3....
Para i = 1, a(i)=3, floor(n!/e + 1/2)/n! - 1/e =
0.3... - 0.3... = 0.0... < 10^(-1)
No caso geral, como i digitos coincidem, a diferenca fica no i+1 digito e o maxi
mo de
0.d ... dD ... D - 0.d ... dD' ... D' ocorre quando os Ds sao 9 e os D' sao nulo
s,
assim o resultado da diferenca e no maximo 0.0 ... 09 ... 9 < 10^(-i)
9*10(-i-1)+... +
--------------------------------------------------------------------------------
-
LINKS
http://commons.wikimedia.org/wiki/File:Seq1.png
http://algo.inria.fr/flajolet/Publications/books.html
http://en.wikipedia.org/wiki/Derangement#Counting_derangements
http://en.wikipedia.org/wiki/E_(mathematical_constant)
http://www.ttmath.org/ttmath
Flajolet and Sedgewick, <a href="http://algo.inria.fr/flajolet/Publications/book
s.html">Analytic Combinatorics</a>
Wikipedia, <a href="http://commons.wikimedia.org/wiki/File:Seq1.png">Graph of pr
obabilities</a>
Wikipedia, <a href="http://en.wikipedia.org/wiki/Derangement#Counting_derangemen
ts">Derangements</a>
Wikipedia, <a href="http://en.wikipedia.org/wiki/E_(mathematical_constant)">The
number e</a>
ttmath, <a href="http://www.ttmath.org/ttmath">C++ multiprecision math software<
/a>
------------------------------------
SEQUENCIAS
Cf:A000169, A000272, A068985, A000166, A181590
A181589
Least value of n such that P(n) - 1/e < 10^(-i), i=1,2,3... . P(n) = (n/(n+1))^(
n-1) the
probability of a random forest on n be a tree.
Exemplo
a(1) = 6, a(2) = 56, so for n in the interval 6...55 if we use 1/e as the probab
ility P,
we make an error less than 10^(-1). In general if n is in the interval
a(i), ... , a(i+1)-1, this error is less than 10(-i).
6, 56, 553, 5519, 55183, 551820, 5518192, 55181917, 551819162, 5518191618,
55181916176, 551819161758, 5518191617572, 55181916175717, 551819161757164,
5518191617571636, 55181916175716349, 551819161757163483, 5518191617571634825,
55181916175716348240
COMENTARIO
The probability P(n) = A000169(n)/A000272(n+1). It is known that lim_{n->inf}p(n
) = 1/e.
(See Flajolet and Sedgewick link, pp 632, where we can find a function of the nu
mber
of components k).
Both P(n) and the probability that a permutation on n objects be a derangement t
end to
1/e when n rises to infinity. So the events random forest be a tree, and random
permutation be a derangement become equiprobable as n tends to infinity. The pro
bability
P(n) approaches 1/e quite slowly as this sequence shows. See image clicking the
first link.

--------------------------------------------------------------------------------
----------
A181590
Least value of n such that |P(n) - 1/e| < 10^(-i), i=1,2,3... . P(n)=floor(n!/e
+ 1/2)/n!
the probability of a random permutation on n be a derangement.
3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21, 21
Cf: A068985, A000166, A181589
Exemplo
a(2) = 4, a(3) = 6, so for n in the interval 4...5, if we use 1/e as the probabi
lity P,
we make an error less than 10^(-1). In general if n is in the interval
a(i), ... , a(i+k)-1, k the least positive integer such that a(i+k) > a(i), this
error is
less than 10(-i-k+1). For example, a(11) = a(12) = 14, k = 2, and if n is in the
interval
14...14, if we use 1/e as the probability P, we make an error less than 10^(-12)
.
COMENTARIO
Both P(n) and the probability that a rooted forest on [n] be a tree tend to 1/e
when n
rises to infinity. So the events random forest be a tree, and random permutation
be a
derangement become equiprobable as n tends to infinity. The probability P(n) app
roaches
1/e quite quickly as this sequence shows. See image clicking the first link.
------------------
Search: 6, 56, 553, 5519, 55183, 551820, 5518192, 55181917, 551819162
I am sorry, but the terms do not match anything in the table.
Search: 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21
, 21
I am sorry, but the terms do not match anything in the table.

Conferencia com PARI


n=1
Pn = floor(factorial(n)/exp(1) + 1/2)/factorial(n);
dif = Pn - 1/exp(1)
n+=1
--------------
n=1 dif = Pn - 1/exp(1) = -0.3...
2 dif = 0.13...
3 dif = |-0.03...| < 0.1, e > 0.01 1
4 dif = 0.007... < 0.01, e > 0.001 2
5 dif = -0.0012...> 0.001
6 dif = 0.0001...< 0.001, e > 0.0001 3
7 dif = -0.00002...< 0.0001, e > 0.00001 4
8 dif = 0.000002...< 0.00001, e > 0.000001 5
9 dif = -0.0000002...< 0.000001, e > 0.0000001 6
10 dif = 0.00000002...< 0.0000001, e > 0.00000001 7
11 dif = -0.000000001...< 0.00000001, e > 0.000000001 8
12 dif = 1.498... E-10 < 10^(-9) > 10^(-10) 9
13 dif = -1.0751160904363078998 E-11 < 10^(-10) > 10^(-11) 10
14 dif = 7.195846933666457114 E-13 < 10^(-11), < 10^(-12) > 10^(-13) (11,
12)
15 dif = -4.513167981533593541 E-14 < 10^(-13), > 10^(-14) (13)
16 dif = 2.6630935085379171220 E-15 < 10^(-14), > 10^(-15) (14)
17 dif = -1.4836374580760584272 E-16 < 10^(-15), > 10^(-16) (15)
18 dif = 7.828323878258998439 E-18 < 10^(-16), < 10^(-17) > 10^(-18) (16, 1
7)
19 dif = -3.923113683648025814 E-19 < 10^(-18), > 10^(-19) (18)
20 dif = 1.872039397 E-20 < 10^(-19), > 10^(-20) (19)
21 dif = -8.5253... E-22 < 10^(-20), < 10^(-21) > 10^(-22) (20, 21)
3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21, 21
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
--------------------------------------------------
(20:55) gp > \p 50
realprecision = 57 significant digits (50 digits displayed)
<al(n)/exp(1) + 1/2)/factorial(n);
(20:56) gp > dif = Pn - 1/exp(1));
%62 = 1.87203939668544522102423494156677258370 E-20
(20:56) gp >

Conferencia (Nesse caso, como a funcao P(n) sempre aumenta quando n diminue, ass
im
que para um dado valor de n a diferenca ficar >= 10^-i, nao adianta continuar a
diminuir n.)
6, 56,
Da muito trabalho conferir, pois os valores diminuem muito, vou alterar o
programa para a nova condicao. 1/e sera uma constante com 37 digitos. 10^-i sai
com "BIG" Pot10 = 1 no comeco, e Pot10 /= 10; quando i mudar.
----------------------------------------------------------
Constante k = 1/e
A B k
--- = --- = ---
C D 1
A*D = B*C (1)
B = k*D
A = k*C
Substituindo em (1)
k*C * D = k*D * C (2) Isso e uma identidade.
Substituindo C = n! , B = n^(n-1), D = (n+1)^(n-1) em (1)
A * (n+1)^(n-1) = n! * n^(n-1)
A = (n-1)! * n^n / (n+1)^(n-1)
A = floor(n!/e + 0.5)
Isso nao leva a nada. A coisa e valida para n -> inf.
------------------------------
Termos de A181589
6 3*2
56 7*8
553 7*79
5519 primo
55183 139*397
551820 muitos fatores 2,3,5,17,541
5518192
55181917
551819162
5518191618
55181916176
551819161758
5518191617572
55181916175717
551819161757164
5518191617571636
55181916175716349
55181916175716348 3
55181916175716348 25
55181916175716348 240
Porque
Tem primos ai? Fatores? Nada.

----------------------------------------------------------

COMENTARIOS
is floor(n!/e + 1/2)/n!.
So the events random forest be a tree, and random permutation be a derangement b
ecome
equiprobable as n tends to infinity. See the first link. The terms of this seque
nce show
how quickly the probability q(n) approaches 1/e. From A**** we see that p(n) con
verges
much more slowly.

The probability that a random forest of size n be connected is p(n) = A000169(n)


/A000272(n+1) = (n/(n+1))^(n-1). It is known that lim_{n->inf}p(n) = 1/e. (See
Flajolet and Sedgewick link, pp 632, where we can find a function of the number
of components k.)
The probability that a permutation on n objects be a derangement is floor(n!/e +
1/2)/n!.
So the events random forest be a tree, and random permutation be a derangement b
ecome
equiprobable as n tends to infinity. See the first link. The terms of this seque
nce show
how quickly the probability q(n) approaches 1/e. From A**** we see that p(n) con
verges
much more slowly.

----------------------------------------
Nao vou fazer comentario na sequencia do homem, apenas dizer also the probabilit
y of...
Tem tambem o comentario na sequencia 1 - 1/e. Forest disconnected at permutation
with
at least a fixed point.

-----------------------------------------------
Restos
The probability that a random forest of size n be connected is p(n) = A000169(n)
/A000272(n+1) = n^(n-1)/(n+1)^(n-1) = (n/(n+1))^(n-1). It is known that
lim_{n->inf} p(n) = 1/e. (See Flajolet and Sedgewick link, pp 632, where we can
find a function of the number of components k.)
The number !n of derangements on n objects is floor(n!/e + 0.5), so the
probability q(n) that a permutation is a derangement is floor(n!/e + 0.5)/n!.
Because lim_{n->inf} q(n) is also equal to 1/e, for n sufficiently large random
forests and random permutations have the same probability of be connected, and b
e
a derangement respectively.
------------------------------------------
Cf:
derangement 'sequence A000166
A068985 Decimal expansion of 1/e.
A*****
Here are the 2 A-numbers you requested:
A181589
A181590
---------
A068996 Decimal expansion of 1 - 1/e.

Das könnte Ihnen auch gefallen