sorel Posted April 11, 2017 Share Posted April 11, 2017 olá preciso de laguem no excel 2010 ou superior é assim 1º nas 5 colunas= vamos demominar = A, B C D E nao pode repetir as letras exemplo se na 1ª coluna escolho C NAS OUTRAS NAO PODE TER C, preciso do fechamento total 100% 5x5x5x5x5 depois nas linhas igual o cruzamento ser adas ausente nas restantes 13,14,15 claro teremos filtro para diminuir as duas partes antes de cruzar diz se entendeu? 1 Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 1497 este deu uma linha e uam coluna cheia( rarissimo mas no 1496 deu nos 80% já serve a 01 b 22 c08 d 14 e 05( colunas) apostar até dar o padrao mas isto de dar uma coluna ou linha cheia é 20% eu fico com 80% do tempo Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 sim, é tipo o plano carteziano na matriz 5x5 da lotofacil pode ser as 5 fixas cheias ou as 5 ausente tanto nas colunas com nas linhas precisamos de estatisticas das repetiçoes e ausencias e atrasos ( lotofacil é curta nao demora a mais atrasadas de sair) Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 lembrese quem fizer 5x5x5x5x5 = nao pode repetir a letras e fazendo assim vai repetir Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 C Function RandLatin(Optional bVolatile As Boolean = False) As Long() ' shg 2013 ' UDF only ' Requires aiRandLong() ' Returns a random Latin square of size nCol with symbols 1 to nCol ' (by shuffling the symbols, then the rows, then the columns) ' to the calling range ' e.g., in A1:E5, {=RandLatin()} ' All such squares generated in this fashion are members (I think) ' of the same isotopy class, so it doesn't generate all possibilities. Dim aiInp() As Long Dim aiOut() As Long Dim aiRnd() As Long Dim nCol As Long Dim i As Long Dim j As Long If bVolatile Then Application.Volatile With Application.Caller nCol = IIf(.Rows.Count > .Columns.Count, .Rows.Count, .Columns.Count) End With ReDim aiInp(1 To nCol, 1 To nCol) ReDim aiOut(1 To nCol, 1 To nCol) Randomize ' shuffle the symbols aiRnd = aiRandLong(1, nCol) For i = 1 To nCol For j = 1 To nCol aiInp(i, j) = aiRnd(((i + j - 2) Mod nCol) + 1) Next j Next i ' shuffle the rows aiRnd = aiRandLong(1, nCol) For i = 1 To nCol For j = 1 To nCol aiOut(i, j) = aiInp(aiRnd(i), j) Next j Next i aiInp = aiOut ' shuffle the columns aiRnd = aiRandLong(1, nCol) For i = 1 To nCol For j = 1 To nCol aiOut(j, i) = aiInp(j, aiRnd(i)) Next j Next i RandLatin = aiOut End Function Public Function aiRandLong(iMin As Long, _ iMax As Long, _ Optional ByVal nCol As Long = -1, _ Optional bVolatile As Boolean = False) As Long() ' shg 2008 ' UDF or VBA ' Fisher-Yates shuffle ' Returns a 1-based array of nCol unique Longs between iMin and iMax inclusive Dim aiSrc() As Long ' array of numbers iMin to iMax Dim iSrc As Long ' index to aiSrc Dim iTop As Long ' decreasing upper bound for next selection Dim aiOut() As Long ' output array Dim iOut As Long ' index to aiOut If bVolatile Then Application.Volatile True If nCol < 0 Then nCol = iMax - iMin + 1 If iMin > iMax Or nCol > (iMax - iMin + 1) Or nCol < 1 Then Exit Function ReDim aiSrc(iMin To iMax) ReDim aiOut(1 To nCol) ' init iSrc For iSrc = iMin To iMax aiSrc(iSrc) = iSrc Next iSrc iTop = iMax For iOut = 1 To nCol ' Pick a number in aiSrc between 1 and iTop, copy to output, ' replace with the number at iTop, decrement iTop iSrc = Int((iTop - iMin + 1) * Rnd) + iMin aiOut(iOut) = aiSrc(iSrc) aiSrc(iSrc) = aiSrc(iTop) iTop = iTop - 1 Next iOut aiRandLong = aiOut End Function Quote Link to comment Share on other sites More sharing options...
cerealkiller Posted April 11, 2017 Share Posted April 11, 2017 Acompanhando o tópico. Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 A B C D E F 1 3 5 4 2 1 A1:E5: {=RandLatin()} 2 2 1 3 5 4 3 1 3 5 4 2 4 4 2 1 3 5 5 5 4 2 1 3 6 7 8 B A D C E A8:E12: {=CHAR(RandLatin() + 64)} 9 C D E A B 10 E C A B D 11 D B C E A 12 A E B D C Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 ceral=objetivo é ver as cinco fixas e tambem as 5 ausentes nas colunas e linhas sem repetir letras ou posiçoes dentro da matriz 5x5( cartao da caixa) quando der uma linha ou coluna com 5 ai nao pega mas pode dar 14, o probema precisa estatisticas deste plano carteziano Quote Link to comment Share on other sites More sharing options...
sorel Posted April 11, 2017 Author Share Posted April 11, 2017 http://www.mediafire.com/file/2rafn2xza77ragf/PASTA_SEM_REPETIR_AS_POSIÇOES_LINHAS_E_COLUNAS.xlsx Quote Link to comment Share on other sites More sharing options...
sorel Posted April 12, 2017 Author Share Posted April 12, 2017 Generate it as 25x25 and use any 5x5 portion (partial results shown): A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 07 10 24 05 13 12 18 01 20 21 04 22 19 15 03 14 02 06 08 17 11 09 25 23 16 A1:Y25: {=RandLatin()} 2 25 23 22 12 05 01 02 08 18 24 19 16 07 20 04 21 10 17 15 09 03 13 06 14 11 3 16 08 02 25 07 06 12 17 05 18 24 10 22 13 21 20 01 03 09 04 14 19 11 15 23 4 03 20 23 17 06 09 08 13 01 10 16 14 11 12 22 02 15 19 05 07 24 25 04 18 21 5 17 21 11 08 01 15 23 20 10 16 25 03 06 02 07 22 14 13 18 05 19 12 09 24 04 6 15 19 17 14 23 21 03 24 11 06 01 09 08 16 12 25 04 18 22 02 05 10 20 07 13 7 09 24 03 15 08 20 14 18 23 11 06 04 17 10 25 16 21 05 02 12 07 01 13 22 19 8 01 03 25 10 02 23 16 14 22 07 05 06 12 24 13 19 11 15 21 20 09 18 08 04 17 9 19 02 21 13 09 05 20 12 15 14 03 24 04 08 11 23 18 25 01 06 16 17 07 10 22 10 04 18 14 09 17 13 15 05 08 23 11 21 03 01 16 10 20 07 12 25 22 06 19 02 24 11 11 15 10 06 25 17 01 09 12 02 22 23 16 05 24 18 08 04 13 19 21 07 03 20 14 12 22 01 18 07 19 25 05 06 13 20 21 02 24 09 14 15 12 11 17 03 23 04 16 08 10 13 06 14 16 01 12 08 10 15 02 22 07 11 25 18 19 24 23 09 20 13 04 05 17 21 03 Quote Link to comment Share on other sites More sharing options...
nenao Posted April 12, 2017 Share Posted April 12, 2017 acompanhando o tópico.......sem entender nada Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.