By comparing a sequence of numbers

Morning everyone,

I have a little challenge on board and would like some ideas on how to proceed with him.

As you are all aware of the Lotto game. You must choose 6 numbers out of 40. There are exactly 3 838 380 combinations that can be played.

These combinations can be generated and stored in a table.

Now say I have 1000 people playing and I would like to find a way to know how many combinations are repeating and which combinations were not played.

How can I do?

Kind regards
Kevin

I don't know exactly what your model looks like now.

I would do it like this:

create table played_systembet(
systembet_id integer not null,
systembet_type integer not null,
c1 integer not null,
c2 integer not null,
c3 integer not null,
c4 integer not null,
c5 integer not null,
c6 integer not null,
c7 integer not null,
c8 integer not null,
c9 integer not null,
c10 integer not null,
primary key(systembet_id))
;

alter table played_systembet
add constraint valid_systembet
check (
(systembet_type=5 and c1c5 and c5>c4 and c4>c3 and c3>c2 and c2>c1);
alter table played_combinations add constraint systembet_id_fk foreign key(systembet_id) references played_systembet(systembet_id);

In this way, it should be able to get all the statistics you want using previous queries.

Tags: Database

Similar Questions

  • How to compare consecutive groups of numbers in tables

    Hello

    I need from there to place a table 1 d of the solution.

    I need to compare two tables and record the same numbers that are in the two tables, but also save groups of numbers which can be in one of the two compared tables.

    In the example l could not put all consecutive numbers 8,9,10,11,12 groups in a 1 d array.

    Example l have to filter the zeros and the number four.

    The numbers in the two tables are always in descending order however may not be in the order of the array index number. It's 15 = 15 index number

    A series of consecutive numbers in this example is a group which increase by a value of 1. For example. 8,9,0,22,23,24 are two consecutive groups of numbers.

    Thank you


  • Numbered lists to spoil the sequence of numbered titles.

    I created documents with securities bunch (i.e. 1, 2, 2.1, 2.1.1, 2.1.2, 2.2; etc.). I created the section numbering by using the Numbering tab in the paragraph Designer. Whenever I try to insert a numbered list in the document, however, re-sequence after the list numbers, and they do so without noticeable logical order. Anyone else see this issue before?

    You use a series label to maintain the flow of separate numbering? p. ex. H:.< =0=""> for Heading1, H:. < =0=""> for Title2, H:.. for titre3, etc.

  • export the sequence with numbers of real images

    Hi all

    I made my activities all projects once in a complete png sequence!

    Now, I changed a small part and wanted to make this part in the folder with the sequence already made.

    PROBLEM is that it always starts with 'ZERO '. How can I say first to do it in real framenumbers?

    Or is there a nother workflow that is similar to this technique?

    Thanks to you all

    Michael

    Found a solution, because I don't know how to do this first:

    Rename the lot in the bridge.

    117 is a simple number that I selected for the first image.

  • Generation 7 random sequence of numbers

    Hello

    create sequences centers_seq
    begins with 1234567 increment of 1;

    This statement will create and start the sequence 1234567 and increments by 1 while I'm of course unique and trying to generate random 7 digit

    Thank you in anticipation

    Best regards

    Raakh wrote:
    I want to generate the login ID, but not in a sequence. IDS are 100 steps more so I need to auto generate unique random ID to 7 digits

    Well, you can take a random semi approach:

    SQL> create sequence s start with 100 maxvalue 999
      2  /
    
    Sequence created.
    
    SQL> select s.nextval * 10000 + trunc(dbms_random.value(1000,9999)) unique_semi_random_7_digit_num from dual
      2  /
    
    UNIQUE_SEMI_RANDOM_7_DIGIT_NUM
    ------------------------------
                           1007776
    
    SQL> /
    
    UNIQUE_SEMI_RANDOM_7_DIGIT_NUM
    ------------------------------
                           1017247
    
    SQL> /
    
    UNIQUE_SEMI_RANDOM_7_DIGIT_NUM
    ------------------------------
                           1025913
    
    SQL> /
    
    UNIQUE_SEMI_RANDOM_7_DIGIT_NUM
    ------------------------------
                           1033573
    
    SQL>  
    

    SY.

  • Automatic sequencing of numbers - say the inventory by 5

    Is it possible in InDesign CS3 from 5s?  or 10s?  Or something other than 1?

    I have a table of 10-15 line where I need every line to increase by a number that is not 1.  It is 5 or 10.  And I have 300 pages of these tables before manual is a painful prospect.

    I would be grateful for any ideas.

    Shari

    I don't think you can get Indesign to do this. You might be able to achieve some kind of workaround method as having four paragraphs 'ghosts' that have numbers, but are painted in color 'paper' so that they does not print, but I doubt that it is the best solution.

    One idea would be to create a series of numbers in a program that does this kind of math - tell Excel, for example - and import (or copy and paste) this strain in Indesign.

  • Compare the numbers of channels

    Hello

    can someone show me how to compare strings like this?

    If the STRING of TEXT/is

    TestSystem100000-001

    TestSystem100000-002

    TestSystem100000-003

    TestSystem200000-001

    TestSystem200000-002

    TestSystem200000-003

    If its then its OLD model TestSystem100000-001 1

    If its TestSystem100000-002 or 100000-003 or 004 100000 and 100000-005, etc. = 1 NEW model

    If its TestSystem200000-001 = 2 old model

    If its TestSystem200000-002 or 003 200000 or 200000-004 or 200000-005, etc. = model 2 NEW

    It is easy for me to compare two integers, or numbers,

    I have no idea on the comparison of strings that look like numbers.

    can someone please.

    Thank you in advance.

    Hey Krispiekream,

    Would this work?

  • When I subtract two numbers DBL and try to compare the result with another DBL, it fails

    I found a curious problem with subtraction and compare numbers DBL in LabVIEW (8.6). Here's how it works:

    1. subtract two numbers DBL such that the result is not incorporated. (Say, 3.2 - 3.1)

    2. compare the result with a constant/control that is on the result of the subtraction (in the example, 0.1)

    3 see the output of the comparison.

    If the result of the subtraction is an integer, the Boolean result is (as expected). If the result is not complete, the comparison fails.

    (Now, if I simply compare two floating point numbers, it works, so the issue is not with the node comparison itself, but with the data that is entered to the node). Can someone understand why this happens? It's unexpected, it's a pretty serious bug.

    It is provided with all programming languages. Numbers do not have an exact binary floating-point representation. This has been discussed endlessly. Never use the equal function with floats. You can use the function in the range and force.

  • modified automatically sequence

    I am facing the problem as a sequence, formerly without problem in this installation teststand-2013, it is automatically changed when loading. And I am not able to find any difference with the tool differ with the loading sequence, starting him differ and comparing the sequence loaded with his version of disk on:

    And I have disabled "magically" merge Types:

    Any ideas how to go further to see what is happening, when you load this sequence?

    Meanwhile, I found the reason: The Common type of results had a higher review. Without doubt, I loaded a sequence from a system of development nother using this higher review and did not notice that this update of the review of the common type of results on this system.  I managed by dint back the system to use the older revision. However, it would be nice, if the different tool would output a difference only in version control, too.

  • Numbers in the textfield using the Boolean and structure of the case?

    Hello!

    I am very new to these forums and LabVIEW in general. I am currently trying to implement a calculator-ish, but without the operations (+ - * /).

    I have 10 Boolean buttons named 0-9, and with them I want to basically write a sequence of numbers in a textfield. I managed to solve the problem using a structure of the event, but now I would get the same result using a case instead of this structure. The problem is that I can't identify which button was pressed, so I can't make the program go to the proper case (0 to 9). Is there a simple solution to what you guys could help me with? Perhaps a property node that is generic for each button? I do not know

    in any case, I enclose you a simplified version of what I am seeking to achieve, withouh code I do not know how to write of course.

    Thanks for your help in advance!

    / Sebastian

    Here's a way to do it: combine Boolean values in a table, which become an 8-bit number and which thread to a structure to deal with a Boolean radix

  • Insert the sequence inside the string number

    Hello

    What is the easiest way to insert sequences of numbers within the string, example

    Can I have numbers of from 1 to 25, but I can't for the 'gaps', when this happens I filled with X

    01020304050607080910 = > > > 01020304050607080910XXXXXXXXXXXXXXX
    01030405060708091112 is > 01X03040506070809X1112XXXXXXXXXXXXX

    How do I, I tried to use the TRANSLATE function, but no way






    WITH the DATA (str) AS (SELECT ' 010203070911131516' FROM dual UNION ALL

    SELECT "0205060809" FROM dual UNION ALL

    SELECT '03050608091012' FROM dual)

    , decompose AS (SELECT str, substr (str, (LEVEL - 1) * 2 + 1, 2) as ELEMENT, LENGTH (str) / 2 as items)

    , MIN (substr (str, (LEVEL - 1) * 2 + 1, 2)) OVER (PARTITION BY str) AS min_element

    , max (substr (str, (LEVEL - 1) * 2 + 1, 2)) OVER (PARTITION BY str) AS max_element

    FROM THE DATA

    CONNECT BY LEVEL<=>

    and prior str = str

    AND PRIOR sys_guid() IS NOT NULL)

    COMPLETE AS (SELECT str, level elem

    FROM (SELECT DISTINCT min_element, max_element, str

    TO decompose) x

    CONNECT BY LEVEL<= to_number(max_element)="" -="" least(to_number(min_element),1)="" +="">

    AND str = str PRIOR

    AND PRIOR sys_guid() IS NOT NULL)

    SELECT c.str, listagg (NVL (d.element, 'X')) within the Group (order by c.elem)

    C COMPLETE

    LEFT OUTER JOIN decompose d ON (c.str = d.str

    AND c.elem = to_number (d.ELEMENT))

    C.str group

    order of c.str;

    HTH

  • How to give no. Custom instead of sequence number

    I want to give no. Custom as 13/1 (number of yy/auto)... compare no sequences. ??? 4.2 the apex

    Hai your query is the problem? where the State of the question?

    as

    If: P17_NWM_DOC_ID is not null and: P17_NWM_DOC_REF_NO is null then

    http://Apex.Oracle.com/pls/OTN/f?p=19617:2:105760220563626:no:2:

    pls see my code very clear sound. at the point of P2_DOC_REF_NO.

  • Help with SELECT - select the range of numbers

    Hello
    I need assistance with the SELECT statement. I want to choose Dates today and ending 30 days back. If the result would be like:
    TRUNC(SYSDATE)
    TRUNC(SYSDATE) - 1
    TRUNC(SYSDATE) - 2
    TRUNC(SYSDATE) - 3
    .
    .
    .
    TRUNC(SYSDATE) - 30
    I was thinking about truncated SYSDATE simply select in the first column and second column number 0, 1, 2... 30 then I'd just do a difference first column - second. But how to choose such sequence of numbers? I don't want to choose every number (date) in the select distinct statement, then Union them.

    Does anyone have an idea?
    Thanks for the help, Dan
    SQL> select trunc(sysdate) - level + 1 as dt
      2  from dual
      3  connect by level <= 31
      4  ;
    
    DT
    -----------
    07/01/2013
    06/01/2013
    05/01/2013
    04/01/2013
    03/01/2013
    02/01/2013
    01/01/2013
    31/12/2012
    30/12/2012
    29/12/2012
    28/12/2012
    27/12/2012
    26/12/2012
    25/12/2012
    24/12/2012
    23/12/2012
    22/12/2012
    21/12/2012
    20/12/2012
    19/12/2012
    
    DT
    -----------
    18/12/2012
    17/12/2012
    16/12/2012
    15/12/2012
    14/12/2012
    13/12/2012
    12/12/2012
    11/12/2012
    10/12/2012
    09/12/2012
    08/12/2012
    
    31 rows selected
     
    
  • Sequences

    Is it possible to reset the sequence to its original value?


    Sanjay

    Hi, Sanjay

    user12957777 wrote:
    Actually I had imported a dump in a schema / user. But I want to reset to the original footage in this scheme, because there the last sequences cached the previous image or user.

    Sanjay

    You import the lines, or simply the table structures?
    If you imported the data, then porbably you want to keep the old values. If a sequence used to fill a column id, then you want the sequence to generate unused numbers. If the sequence of numbers 1, 2, 3,..., 25 in the old database and lines with ID 1, 2, 3,..., 25 exist in the imported table, you do not want to generate 1, 2, 3,... for new lines.

  • Force start frame number in image rendering sequence

    I have a comp to 900 frame made of a sequence of numbered images.
    After you apply a revision to 250-300, frames, I would like to make
    only, these frameworks, overwrite the originals.

    I tried:
    Under > render settings, 'Work area Only', with 'Skip existing files' off.
    This makes the correct images, designated by the workspace toolbar,
    but the field numbering starts at 1 instead of 250.

    Under > render settings, "Custom", with "Skip existing files" off.
    In the custom fields, I specify the 250-300 images.
    This makes the correct images, designated by the custom setting,
    but the frame numbering always starts at 1 instead of 250.

    Using the above settings, I also tried to "force" a boot image
    in the output Module by manually keying in "filename_ [00250]."
    The result is a sequence of 51 new images starting by "filename_ [00250] _00001".

    How can I get a partial rendering to crush the correctly
    original numbered in a sequence of images images?

    Try to put the files in a new folder. If it still doesn't work then just not use Automator rename them.

    I don't know why it does not work for you. Wish I could be more useful.

Maybe you are looking for