How to make combinations with these numbers

Solved
gosbyshow27 Posted messages 9 Status Member -  
gosbyshow27 Posted messages 9 Status Member -
Good evening,

I would like to present my problem; I would like to know how many combinations I would need to create combinations of 2 to 5 digits using these numbers 18-1-8-8-20-2-20-2-21-2-1 by adding the numbers together?

Example: 18+1=19

18+1+8=27
18+1+8+20=47
etc....

Thank you for your help.

Configuration: Windows / Chrome 84.0.4147.125

6 answers

  1. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 831
     
    Hello,

    This question doesn't really pertain to office automation... nor really to howcamarche.net.
    But still, you can use a code like this one: https://codes-sources.commentcamarche.net/source/100161-php-liste-des-combinaisons-possibles-somme

    --
    Best regards,
    Jordane
    1
    1. gosbyshow27 Posted messages 9 Status Member
       
      Good evening, how do you use this source code that you provide?
      0
    2. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 831 > gosbyshow27 Posted messages 9 Status Member
       
      You need software to emulate a web server, such as Laragon. https://laragon.org/download/index.html
      Then you place the source code in a file that you name combi.php (for example)
      You fill in the desired numbers in the variable $arr (each number is separated by a comma)
       $arr = array(18,1,8,8,20,2,20,2,21,2,1); 

      Then you open your web browser and enter the URL: http://localhost/combi.php
      0
    3. gosbyshow27 Posted messages 9 Status Member > jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention  
       
      ok thank you very much
      0
    4. gosbyshow27 Posted messages 9 Status Member > jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention  
       
      The software is giving me a 404 not found error. I saved the source code in a text file that I named combi.php.
      0
    5. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 831 > gosbyshow27 Posted messages 9 Status Member
       
      It must be placed in the www folder of the software.
      0
  2. ccm81 Posted messages 11033 Status Member 2 434
     
    Hello

    You have 11 numbers

    nb digits nb combinations
    2 55
    3 165
    4 330
    5 462

    total 1012


    https://mon-partage.fr/f/fi4ExjsK/

    Best regards
    0
    1. gosbyshow27 Posted messages 9 Status Member
       
      Thank you very much, how did you find that?
      0
    2. gosbyshow27 Posted messages 9 Status Member
       
      So here is the solution for the lottery and the EuroMillions, which totals 1012 X 5 as there are single-digit numbers.

      So the calculation that others are giving is wrong for the EuroMillions and the lottery.
      0
  3. ccm81 Posted messages 11033 Status Member 2 434
     
    The COMBIN(n;p) function
    gives the number of combinations of p distinct elements chosen from n elements
    See the formulas in column D

    Note: Here you have the same number multiple times so 20+8+20 will be a possible combination

    Best regards
    0
  4. Pierr10 Posted messages 13831 Registration date   Status Moderator Last intervention   5 840
     
    Hello

    Just a little clarification for the curious or for those who have forgotten their high school lessons:
    The number of combinations of p elements from a set of n elements is calculated by:
    n!/((n-p)!p!)
    For example, for 3 elements taken from 11:
    11!/8!/3! =11*10*9/2*3 =990/6= 165

    --
    What is well understood is clearly stated,
    And the words to express it come easily.
    (Boileau)
    0
  5. gosbyshow27 Posted messages 9 Status Member
     
    To play all 11 numbers by calculating, you need €1121 to play at EuroMillions to get the 5 numbers without counting the stars.

    My method gives me the 5 EuroMillions numbers with an 85% success rate using 11 numbers.

    For the lottery, it's an 80% success rate with 11 numbers for the 5 numbers without the star.
    0
    1. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 831
       
      I don't know what you're smoking... but it must be good....

      Just a reminder

      To play LOTO®, all you need to do is pick 6 numbers: 5 numbers from a grid of 49 numbers and 1 lucky number from a grid of 10 numbers. You win the jackpot if you have 5 winning numbers and the complementary number. The price of a grid is €2.20

      The number of possible combinations (without the lucky number) is therefore
      49 ! / ( (49 – 5) ! x 5 ! ) which equals: 1,906,884

      So with the lucky number (one chance in 10), that gives: 19,068,840 possible combinations...
      at €2.20 ... you're far from your €3,987...


      After all.. if you think you've found a miracle solution.. remember to send us a check for helping you out :-)
      0
  6. gosbyshow27 Posted messages 9 Status Member
     
    No need to smoke but my theory is good.

    You can indicate the right program Jordane45 takes the numbers I gave you and puts them in your Laragon software, you'll see that the software indicates 2045 combinations, especially look at the draw from August 18, 2020, and you'll see that the 5 numbers are in the combination after the numbers change with each draw.
    In fact, the software indicates 2045 combinations but actually there are fewer than that for the reason that the same combinations come out several times in a row.
    0