[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4980: session_start(): Write of lock failed
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4980: session_start(): Unable to clear session lock record
Exo 1.11 G TH Ian Stewart [5 réponses] : ✯✎ Supérieur - 186579 - Forum de Mathématiques: Maths-Forum

Exo 1.11 G TH Ian Stewart

Réponses à toutes vos questions après le Bac (Fac, Prépa, etc.)
Avatar de l’utilisateur
ortollj
Membre Rationnel
Messages: 554
Enregistré le: 13 Mai 2009, 08:28

Exo 1.11 G TH Ian Stewart

par ortollj » 06 Aoû 2017, 19:43

Bonjour
je ne suis pas d'accord avec la fonction donnée dans l'exercice 1.11 (Chapitre 1 de Galois Theory, Ian Stewart)
ennoncé:
Let P(n) be the number of way to arrange n zeros and ones in a row,
given that ones occur in group of three or more.
Show that P(n)=2*P(n-1) - P(n-2) + P(n-4)

il me restait seulement cet exercice du chapitre 1 , que je n'avais pas su resoudre auparavant.

Pour moi cette formule est fausse, mais peut etre ais-je mal compris la question ?

moi je trouve la formule suivante, qui elle est generale quelque soit p>=2 (petit p =nombre de 1 consecutifs)

si n<=2*p alors P(n)=2^(n-p)*(1 + (n-p)/2) (on ne peut trouver 2 sequences de >= p bits dupliquées dans un meme mot tant que n<=2*p)
si n> 2*p alors P(n)=2*P(n-1,p) - P(n-p-1,p) + 2^(n-p-1).

je joints un lien sur un fichier GoogleDoc qui tente d'expliquer mon raisonnement pour les deux formules.
ais je le droit de l'appeler preuve ? (pour moi cela en est une), mais elle n'utilise pas l'algebre mais un
"raisonnement d'analyse Graphique " sur la structure des mots binaires.
ou dois je appeler la formule simple conjecture ? j'ai tenter de montrer mon raisonnement pour
quelque cas S(n,p) je prefere l'appeler S(n,p) plutôt que P(n,p).
je me demande si l'utilisation des formule de combinatoires ne permettrait pas une preuve plus elegante. :oops:
Preuve Graphique




ci dessous le code Python que j'ai utilisé pour verifier. Je l'utilise dans la VM sageMath.
j'ai trouvé cette fonction, en raisonnant sur la structure du fichier créé par la fonction Python:
writeBinPowFile(p,fname), elle se trouve dans le code joint ci dessous.


code :
Code: Tout sélectionner
import numpy
from matplotlib import pyplot

def bitLen(n):
    length = 0
    while (n):
        n >>= 1
        length += 1
    return(length)




def CountContiguousPacquet(n):
# this function return a list of length P_n if P_n packets
# and the value in the list is the length of differents packets
#example:CountContiguousPacquet(int('110000110011101',2))
#return [1, 3, 2, 2]
    count=0
    pA=[ ]
    for i in range(0, bitLen(n)+1):
        if n & 1 :
            count+=1
        else:
            if count > 0 :
                pA.append(count)
                count=0
        n >>= 1
    return(pA)

def ContiguousPacquetSup(pA,p):
# this function count the number of packet >=p
# in the list pA
# example pA=[1, 3, 2, 2]
    count=0
    #print "pA:",pA
    for element in pA:
        if element >= p :
            #print element
            count+=1
    return(count)


def writeBinPowFile(p,fname):
# fill up a text file with binary string 0 to 2^p - 1
    NbMax=2^p
    with open(fname+"2p"+ str(p)+".txt", "w") as text_file:
        for nb in range(0, NbMax, 1):
            text_file.write(format(nb, 'b').zfill(p)+'\n') # base 2
            #print format(nb, 'b').zfill(10)
    return ("Done")
#writeBinPowFile(8,"toto")

#forget()
#print "count:",CountContiguousPacquet(int('110000110011101',2))
#r=ContiguousPacquetSup(CountContiguousPacquet(int('110000110011101',2)),4)
#print "count:",CountContiguousPacquet(int('110000110011101',2))
#r=ContiguousPacquetSup(CountContiguousPacquet(int('110000110011101',2)),4)
count=0
# this list count all sequence >= p of contiguous bits (could have x sequence >=p  in the same word) 
tabCount=[]
# this list count all word of length n with  at least a sequence >= p of contiguous bits present in it 
tabCountAtLeast=[]


def EffectiveCountSupP():
# this function effectively count the possibles sequences >=p in a word of length n
# it is not a calculation, simply countage

    for N in [2^N for N in range(p, Nmax, 1)]:
        print N
        count=0
        countAtLeast=0
        n=bitLen(N)-1
        for j in range(0,N):
            count =count + ContiguousPacquetSup(CountContiguousPacquet(j),p) # count all packet > p in the word n
            if ContiguousPacquetSup(CountContiguousPacquet(j),p) > 0 :
                countAtLeast+=1 # at least one packet > p in the word n
        #print "countAtLeast:", countAtLeast
        #print "count:",count," p:",p ," n:",n ," pn2n:",CalcContiguousPacquetSupDup(n,p) ," j:",j," bin j:",bin(j)," proba:",count/2^(n-1)
        tabCount.append(count)
        tabCountAtLeast.append(countAtLeast)
    return (tabCount,tabCountAtLeast)

Nmax=17
p=3
print "p:",p," Count all sequences >= p in all the  words of length n: ",p," to ",Nmax-1
tabCount,tabCountAtLeast= EffectiveCountSupP()

print ('effective count all seq >=p, count duplicates in a same word)')
show(tabCount)

print ('effective count, no duplicates')
show(tabCountAtLeast)





#  Recursive fonction
def S(n,p):
    if n<=2*p:
# first formula below count all sequences of contiguous >=p bits 
# if x sequences of contiguous >=p bits in a same word of length n -> increment counter =+x
# it is used when n>= 2*p because it is not possible of finding duplicates when
# number of possible p contiguous 1 in a word of length n
# 2^(n-p) + (sum {0 to (n-p-1)(included)} of 2^(n-p-1))  =2^(n-p)*(1 + (n-p)/2)=n*2^(n-p-1) + 2^(n-p) - p*2^(n-p-1)
        return 2^(n-p)*(1 + (n-p)/2)
    else:
# second formula below does not count duplicates in the same word  in all the possible words of n length
# if x sequences of contiguous >=p bits in a word of length n -> increment du counter =+1
        return 2*S(n-1,p) - S(n-p-1,p) + 2^(n-p-1)
     
       
sTab=[]
sTabD=[] #derivative Tab
sTabQ=[] #consecutive quotient Tab
sTabP=[] #Probabilities
for n in range (p,Nmax):
    sTab.append(S(n,p))
for i in range (0,len(sTab)-1):   
    sTabD.append(sTab[i+1]-sTab[i])
    sTabQ.append(sTab[i+1]/sTab[i])
for i in range (0,len(sTab)): 
    sTabP.append( sTab[i]/(2^(p+i)) )

print(' JPO Calculation ')
show(sTab)
print(' Derivative ')
show(sTabD)
print(' Quotient ')
show(sTabQ)
print(' Probabilities ')
show(sTabP)



# Ian Stewart Formula
def IanS(n,p):
    if n<=2*p:
# first formula below count all sequences of contiguous >=p bits 
# if x sequences of contiguous >=p bits in a same word of length n -> increment counter =+x
# it is used when n <= 2*p because it is not possible of finding duplicates when  n <= 2*p
# number of possible p contiguous 1 in a word of length n
# 2^(n-p) + (sum {0 to (n-p-1)} of 2^(n-p-1))  =2^(n-p)*(1 + (n-p)/2)
        return 2^(n-p)*(1 + (n-p)/2)
    else:
# Ian Stewart formula below 
        return 2*IanS(n-1,p) - IanS(n-2,p) + IanS(n-4,p)
sIanTab=[]

for n in range (p,Nmax):
   sIanTab.append(IanS(n,p))

print(' Ian Stewart Calculation')
show(sIanTab)

# show Probabilities S(n,p)/(2^(n))
x = numpy.arange(len(sTabP))
x+=p # start at n=p
yQ = list(map(float, sTabP)) # convert array stabP rational values in float

fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.set_ylim(0,max(yQ))
pyplot.plot(x,yQ)

for i,j in zip(x,yQ):
    ax.annotate(str(j),xy=(i,j))
pyplot.ylabel('Probabilities')
pyplot.xlabel('n (word length)')
pyplot.title('S(n,p)/(2^(n)) Versus n') # subplot 211 title
pyplot.show()

# show quotient S(n,p)/S(n-1,p)
x = numpy.arange(len(sTabQ))
x+=p # start at n=p
#yD = sTabD
yQ = sTabQ

fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.set_ylim(1,max(yQ))
#pyplot.plot(x,yD)
pyplot.plot(x,yQ)
#for i,j in zip(x,yD):
#    ax.annotate(str(j),xy=(i,j))
for i,j in zip(x,yQ):
    ax.annotate(str(j),xy=(i,j))
pyplot.ylabel('S(n,p)/S(n-1,p)')
pyplot.xlabel('n (word length)')
pyplot.title('S(n,p)/S(n-1,p) Versus n') # subplot 211 title
pyplot.show()
si j'avais su j'aurais pas venu.



pascal16
Membre Légendaire
Messages: 6663
Enregistré le: 01 Mar 2017, 12:58
Localisation: Angoulème : Ville de la BD et du FFA. gare TGV

Re: Exo 1.11 G TH Ian Stewart

par pascal16 » 06 Aoû 2017, 20:01

c'est une chaine de n chiffres qui sont des 0 ou des 1, on demande que les 1 soient au minimum par 3 à la suite.

p(1)=p(2)=1
p(3)=2 : 000 et 111
p(4)=4 : 1110, 1111, 0111, 0000
p(5)=7 : 11100, 11110, 11111, 01110, 01111, 00111, 00000
p(6)=11
on a bien p(5)=2*p(4)-p(3)+p(1)
et ça marche aussi pour p(6)
Modifié en dernier par pascal16 le 06 Aoû 2017, 20:17, modifié 1 fois.

Avatar de l’utilisateur
ortollj
Membre Rationnel
Messages: 554
Enregistré le: 13 Mai 2009, 08:28

Re: Exo 1.11 G TH Ian Stewart

par ortollj » 06 Aoû 2017, 20:16

Bonjour
pascal16 a écrit:c'est une chaine de n chiffres qui sont des 0 ou des 1, ou une chaine de longueur 2n constituée de n 0 et n 1 ?
au passage, on demande que les 1 soient au minimum par 3 à la suite.


comme je ne suis pas sur d'avoir compris l'ennoncé.
voila ci dessous un lien sur l'ennoncé:
http://math.illinoisstate.edu/schebol/teaching/407-14-files/Stewart-galois_theory.pdf

voir a la fin du chapitre 1 , Exo 1.11
si j'avais su j'aurais pas venu.

pascal16
Membre Légendaire
Messages: 6663
Enregistré le: 01 Mar 2017, 12:58
Localisation: Angoulème : Ville de la BD et du FFA. gare TGV

Re: Exo 1.11 G TH Ian Stewart

par pascal16 » 06 Aoû 2017, 20:32

P(n)=2*P(n-1) - P(n-2) + P(n-4)

pour constituer une chaine de longueur n
je part d'une chaine de longueur n-1, et je rajoute un 0 à gauche ou un 0 à droite : 2*P(n-1) sol
-> j'ai toutes les chaines commençant ou finissant par 0, mais j'ai compté 2 fois certaine chaines comme 0000
vérifier si c'est le "-P(n-2)"
-> il me manque celle commençant et finissant par 111, pas facile

Avatar de l’utilisateur
ortollj
Membre Rationnel
Messages: 554
Enregistré le: 13 Mai 2009, 08:28

Re: Exo 1.11 G TH Ian Stewart

par ortollj » 06 Aoû 2017, 20:33

pascal16 a écrit:c'est une chaine de n chiffres qui sont des 0 ou des 1, on demande que les 1 soient au minimum par 3 à la suite.

p(1)=p(2)=1
p(3)=2 : 000 et 111
p(4)=4 : 1110, 1111, 0111, 0000
p(5)=7 : 11100, 11110, 11111, 01110, 01111, 00111, 00000
p(6)=11
on a bien p(5)=2*p(4)-p(3)+p(1)
et ça marche aussi pour p(6)


Oops je m'apercois en fait que je n'avais pas compris l'ennoncé !! :rouge:
j'avais compris dans un mot de longueur n combien y a t'il de possibilités d'avoir au moins une sequence >= a p bits

[Edited] le 13/08/2017
le precedent code a été modifié , cette fois avec la bonne fonction Recursive pour cette fois respecter le bonne énoncé de l'exercice de Ian Stewart ! :oops:

code a mettre dans 1ere cellule notebook SageMath on peut aller jusqu'à n=20 (3 minutes)
Code: Tout sélectionner
import numpy
from matplotlib import pyplot

def bitLen(n):
    length = 0
    while (n):
        n >>= 1
        length += 1
    return(length)




def CountContiguousPacquet(n):
# this function return a list of length P_n if P_n packets
# and the value in the list is the length of differents packets
#example:CountContiguousPacquet(int('110000110011101',2))
#return [1, 3, 2, 2]
    count=0
    pA=[ ]
    for i in range(0, bitLen(n)+1):
        if n & 1 :
            count+=1
        else:
            if count > 0 :
                pA.append(count)
                count=0
        n >>= 1
    return(pA)

def ContiguousPacquetSup(pA,p):
# this function count the number of packet >=p
# in the list pA
# example pA=[1, 3, 2, 2]
    count=0
    #print "pA:",pA
    for element in pA:
        if element >= p :
            #print element
            count+=1
    return(count)

def ContiguousPacquetSupPIanS(pA,p):
# Hyphothesis 2 count the words with all sequences of contiguous >=p bits or all zeros
# this function verify if ones packets all >= p
# in the list pA
# example pA=[1, 3, 2, 2]
   
    #print "pA:",pA
    noOnesSeqInfP=true
    if not pA :
        #print("List is empty")
        return(noOnesSeqInfP)
    else :
        for element in pA:
            if element < p :
                noOnesSeqInfP=false
                #print element
       
           
    return(noOnesSeqInfP)


def writeBinPowFile(p,fname):
# fill up a text file with binary string 0 to 2^p - 1
    NbMax=2^p
    with open(fname+"2p"+ str(p)+".txt", "w") as text_file:
        for nb in range(0, NbMax, 1):
            text_file.write(format(nb, 'b').zfill(p)+'\n') # base 2
            #print format(nb, 'b').zfill(10)
    return ("Done")
#writeBinPowFile(8,"toto")

#forget()
#print "count:",CountContiguousPacquet(int('110000110011101',2))
#r=ContiguousPacquetSup(CountContiguousPacquet(int('110000110011101',2)),4)
#print "count:",CountContiguousPacquet(int('110000110011101',2))
#r=ContiguousPacquetSup(CountContiguousPacquet(int('110000110011101',2)),4)
count=0
# this list count all sequence >= p of contiguous bits (could have x sequence >=p  in the same word) 
tabCount=[]
# this list count all word of length n with  at least a sequence >= p of contiguous bits present in it 
tabCountAtLeast=[]

Nmax=12
p=3
def EffectiveCountSupP(Nmax,p):
# this function effectively count the possibles sequences >=p in a word of length n
# it is not a calculation, simply countage
    tabCount=[]
    tabCountAtLeast=[]
    for N in [2^N for N in range(p, Nmax, 1)]:
        print N
        count=0
        countAtLeast=0
        #n=bitLen(N)-1
        for j in range(0,N):
            count =count + ContiguousPacquetSup(CountContiguousPacquet(j),p) # count all packet > p in the word n
            if ContiguousPacquetSup(CountContiguousPacquet(j),p) > 0 :
                countAtLeast+=1 # at least one packet > p in the word n
        #print "countAtLeast:", countAtLeast
        #print "count:",count," p:",p ," n:",n ," pn2n:",CalcContiguousPacquetSupDup(n,p) ," j:",j," bin j:",bin(j)," proba:",count/2^(n-1)
        tabCount.append(count)
        tabCountAtLeast.append(countAtLeast)
    return (tabCount,tabCountAtLeast)

#print "p:",p," Count all sequences >= p in all the  words of length n "
tabCount,tabCountAtLeast= EffectiveCountSupP(Nmax,p)
print ('effective count the words with at least one sequences of ones  with length >= p')
show(tabCountAtLeast)
tabCountIanS=[]

def EffectiveCountSupPIanS(Nmax,p):
# this function effectively count the possibles sequences >=p in a word of length n
# it is not a calculation, simply countage
    tabCountIanSf=[]
    for i in  range(p, Nmax, 1):       
        countIanS=0
        nt=2^i
        #print 'i:',i,' nt:',nt,' Nmax:',Nmax
        with open('Nmax '+ str(Nmax) +' p '+ str(p)  +" 2p"+ str(i)+ 'o'+".txt", "w") as text_file:
            for j in range(0,nt):
                if ContiguousPacquetSupPIanS(CountContiguousPacquet(j),p)  :
                    countIanS+=1 # all ones packets > p in the word n or all zeros
                    text_file.write(format(j, 'o').zfill(5) + '\n') # base 16
                    #print "countAtIanS:", countAtIanS
        tabCountIanSf.append(countIanS)
    return (tabCountIanSf)
#print ('effective count Ian Stewart , all ones packets > p in the word n or all zeros')
#tabCountIanS= EffectiveCountSupPIanS(Nmax,p)
#show(tabCountIanS)
print ('effective count H2 , all ones packets > p in the word n or all zeros')
tabCountIanS= EffectiveCountSupPIanS(Nmax,p)
show(tabCountIanS)

#  Recursive way
def S(n,p):
    if n<=2*p:
# first formula below count all sequences of contiguous >=p bits 
# if x sequences of contiguous >=p bits in a same word of length n -> increment counter =+x
# it is used when n>= 2*p because it is not possible of finding duplicates when
# number of possible p contiguous 1 in a word of length n
# 2^(n-p) + (sum {0 to (n-p-1)(included)} of 2^(n-p-1))  =2^(n-p)*(1 + (n-p)/2)=n*2^(n-p-1) + 2^(n-p) - p*2^(n-p-1)
        return 2^(n-p)*(1 + (n-p)/2)
    else:
# second formula below does not count duplicates in the same word  in all the possible words of n length
# if x sequences of contiguous >=p bits in a word of length n -> increment du counter =+1
        return 2*S(n-1,p) - S(n-p-1,p) + 2^(n-p-1)



# Ian Stewart Formula, ok for p=x
def IanS(n,p):
    if n<=2*p:
# first formula below count the words with all sequences of contiguous >=p bits
# also count if all zero no duplicates possible
# count all sequences in word n when ones sequences >=p or  all zero
# example :
#0000  n=4 p=3 2+1+1 =(n-p+1)/2 *(n-p+2) +1 =4
#1110
#0111
#1111   
        return (n-p+1)/2 *(n-p+2) +1
    else:
# Ian Stewart formula below 
        return 2*IanS(n-1,p) - IanS(n-2,p) + IanS(n-p-1,p)

sIanTab=[]
for n in range (p,Nmax):
   sIanTab.append(IanS(n,p))
print(' Ian Stewart Calculation, all ones packets > p in the word n or all zeros')
show(sIanTab)

def GraphIt(tabToGraph,titleG,p,Nmax):

    x = numpy.arange(len(tabToGraph))
    x+=p # start at n=p

    y = tabToGraph #
    #y0 = list(map(float, sIanTabP)) # convert array sIanTabP rational values in float

    fig = pyplot.figure()
    ax = fig.add_subplot(111)
    ax.set_ylim(0,max(y))
    pyplot.plot(x,y)
    for i,j in zip(x,y):
        ax.annotate(str(j),xy=(i,j))

    pyplot.ylabel('List Values')
    pyplot.xlabel('p='+ str(p)+ ' with Nmax=' + str(Nmax-1))
    pyplot.title(titleG) # subplot 211 title
    IanS(n,p)
    pyplot.show()
   

######################## Results JPO

sTab=[]
for n in range (p,Nmax):
   sTab.append(S(n,p))
print(' JPO Calculation, at least ones packets > p in the word n ')
show(sIanTab)

sTabD=[] #derivative Tab
sTabQ=[] #consecutive quotient Tab
sTabP=[] #Probabilities



for i in range (0,len(sTab)-1):   
    sTabD.append(sTab[i+1]-sTab[i])
    sTabQ.append(sTab[i+1]/sTab[i])
for i in range (0,len(sTab)-1): 
    sTabP.append( sTab[i]/(2^(p+i)) )



tabToGraph0=sTabQ
titleG=' S(n,p)/S(n-1,p) Versus n '
#titleGP=' S(n,p)/2^(n) Versus n '
#titleGD=' S(n,p)-S(n-1,p) Versus n'

#GraphIt(tabToGraph0,titleG,p,Nmax)



########################### Results IanS


sIanTab=[]
for n in range (p,Nmax):
   sIanTab.append(IanS(n,p))
print(' Ian Stewart Calculation, all ones packets > p in the word n or all zeros')
show(sIanTab)



sIanTabD=[] #derivative Tab
sIanTabQ=[] #consecutive quotient Tab
sIanTabP=[] #Probabilities

for i in range (0,len(sIanTab)-1):   
    sIanTabD.append(sIanTab[i+1]-sIanTab[i])
    sIanTabQ.append(sIanTab[i+1]/sIanTab[i])
for i in range (0,len(sIanTab)-1): 
    sIanTabP.append( sIanTab[i]/(2^(p+i)) )


tabToGraph1=sIanTabQ
titleG=' IanS(n,p)/IanS(n-1,p) Versus n '
#titleGP=' IanS(n,p)/2^(n) Versus n '
#titleGD=' IanS(n,p)-IanS(n-1,p) Versus n'

GraphIt(tabToGraph1,titleG,p,Nmax)




list(map(float, tabToGraph0))
#list(map(float, tabToGraph1))


code ci dessous a mettre dans la deuxieme cellule notebook SageMath on peut aller jusqu'à n=30
(voir plus)

Code: Tout sélectionner
Nmax=30
p=2


######################## Results JPO

sTab=[]
for n in range (p,Nmax):
   sTab.append(S(n,p))
#print(' JPO Calculation, at least ones packets > p in the word n ')
#show(sTab)

sTabD=[] #derivative Tab
sTabQ=[] #consecutive quotient Tab
sTabP=[] #Probabilities



for i in range (0,len(sTab)-1):   
    sTabD.append(sTab[i+1]-sTab[i])
    sTabQ.append(sTab[i+1]/sTab[i])
for i in range (0,len(sTab)-1): 
    sTabP.append( sTab[i]/(2^(p+i)) )



tabToGraph0=sTabQ
titleG=' S(n,p)/S(n-1,p) Versus n '
#titleGP=' S(n,p)/2^(n) Versus n '
#titleGD=' S(n,p)-S(n-1,p) Versus n'

#GraphIt(tabToGraph0,titleG,p,Nmax)



########################### Results IanS


sIanTab=[]
for n in range (p,Nmax):
   sIanTab.append(IanS(n,p))
print(' Ian Stewart Calculation, all ones packets > p in the word n or all zeros')
show(sIanTab)



sIanTabD=[] #derivative Tab
sIanTabQ=[] #consecutive quotient Tab
sIanTabP=[] #Probabilities

for i in range (0,len(sIanTab)-1):   
    sIanTabD.append(sIanTab[i+1]-sIanTab[i])
    sIanTabQ.append(sIanTab[i+1]/sIanTab[i])
for i in range (0,len(sIanTab)-1): 
    sIanTabP.append( sIanTab[i]/(2^(p+i)) )


tabToGraph1=sIanTabQ
titleG=' IanS(n,p)/IanS(n-1,p) Versus n '
#titleGP=' IanS(n,p)/2^(n) Versus n '
#titleGD=' IanS(n,p)-IanS(n-1,p) Versus n'

GraphIt(tabToGraph1,titleG,p,Nmax)




#list(map(float, tabToGraph1)) # show all Quotient elements
show(list(map(float, tabToGraph1))[-1]) # show last Quotient element






ps: j'ai pourtant ecrit \phi_1 en minuscule mais cela apparaît en majuscule ?

Code: Tout sélectionner
x = polygen(QQ)
P1=x^2 -x -1  # p=3  ,  phi_1
P2 = x^3 -2*x^2 + x -1 # p=2 ,   phi_2
show(P1.roots(CC))
show(P2.roots(CC))
Modifié en dernier par ortollj le 13 Aoû 2017, 12:41, modifié 3 fois.
si j'avais su j'aurais pas venu.

pascal16
Membre Légendaire
Messages: 6663
Enregistré le: 01 Mar 2017, 12:58
Localisation: Angoulème : Ville de la BD et du FFA. gare TGV

Re: Exo 1.11 G TH Ian Stewart

par pascal16 » 06 Aoû 2017, 20:48

c'est une autre façon de le voir.
soient des mots de n lettres parmi le dictionnaire {0;1}, on cherche le nombre de mots constitués soit d'aucun 1, soit d'au moins une séquence de 1 de longueur 3 ou supérieur.

donc rajoute 1 (chaine 0000) à ton résultat et ça doit marcher.

 

Retourner vers ✯✎ Supérieur

Qui est en ligne

Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 158 invités

Tu pars déja ?



Fais toi aider gratuitement sur Maths-forum !

Créé un compte en 1 minute et pose ta question dans le forum ;-)
Inscription gratuite

Identification

Pas encore inscrit ?

Ou identifiez-vous :

Inscription gratuite
[phpBB Debug] PHP Warning: in file Unknown on line 0: Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (172.16.100.103:11211)