Algorithm to find possible percentage of combinations in tree

hello,
i have an algoritm that finds all possible combinations in a treestructure,
i give example
diesel- airco
- leather
- sunroof
all possible combinations are
diesel
diesel - airco
diesel - airco - leather
diesel - airco - sunroof
diesel - leather
diesel - leather - sunroof
diesel - sunroof
diesel - sunroof - leather - airco
now i want to calcultate possible procentages of appereance when know following percentages
diesel 100 % - airco - 80 %
- leather - 40 %
- sunroof - 20 %
this means of all diesels and diesel combinations 80 % have airco 40% have and 20% have a sunroof
is this a problem that can be solved?
with regards
sven

The information you have doesn't seem to be enough to make the prediction you want to make.
This table has those proportions, but no delays:
  Diesel     Airco   Leather  Sunroof        Cost
    Y          Y        Y        N            10
    Y          Y        Y        N            10
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          N        Y        Y            10
    Y          N        Y        Y            10This table has those proportions, but will have delays:
  Diesel     Airco   Leather  Sunroof        Cost
    Y          Y        Y        Y            11
    Y          Y        Y        Y            11
    Y          Y        Y        N            10
    Y          Y        Y        N            10
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          Y        N        N             9
    Y          N        N        N             9
    Y          N        N        N             9You should probably model a random process where the feed in of the orders into the production line has probability equal to those proportions.
Or, if you want to optimise the processing for a given sequence of variants, find the counts of the variants required rather than the proportions of the individual options.

Similar Messages

  • Find and replace a combination of character formats

    Hello all,
    Is it possible to find and replace a combination of character formats.
    for example:
    Search for VA. The V in Arial and the A is Helvetica.
    Replace this in V Arial and A in Verdana.
    Regards.

    NutTriooo wrote:
    Hello all,
    Is it possible to find and replace a combination of character formats.
    for example:
    Search for VA. The V in Arial and the A is Helvetica.
    Replace this in V Arial and A in Verdana.
    Regards.
    If the letter pairs are always the same, change one manually, then copy to clipboard. Find whatever; in the change to pop-up menu under the "@" symbol, Other > Clipboard Contents Formatted.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices    

  • I have HDMI connection to the receiver and on to the TV - but no audio from my new Apple TV.  I have checked all connections and the video is xlnt.  Have also toggled thru every possible Dolby/Audio combination in settings.  Help!  Any suggestions?

    I have an HDMI connection to the receiver and on to the TV - but there is non audio from my Apple TV.  Not for movies, music, YouTube etc.   I have checked all of the connections and the video is xlnt.  Have also toggled thru all possible Dolby/Audio combinations in settings.  Help!  Any suggestions?

    Hello again Parker -
    The basic setup is Digital Cable Box, DVD Player, Denon Receiver/Amp and TV Monitor.  To that I added the Apple TV.  The Receiver only has two HDMI IN slots (one for cable and one for the DVD) and one out to the Monitor. 
    [I bought a switcher to toggle the DVD and the AppleTV back and forth but just disconnected the DVD to simplify when I ran in to trouble.]
    So now I have:
         HDMI from the Cable Box to the Receiver
         HDMI from the Apple TV to the Receiver (in the old DVD slot which always worked well)
         HDMI from the Receiver to the Monitor
         RCA's from the Receiver to the Subwoofer and the other speakers
    In addition I have some backup connections:
         S-Video, Optical Audio and L/R RCA's from the Cable Box to the Receiver
         S-Video from the Receiver to the Monitor
    Wait - JUST FOUND IT! 
    By going thru the excercise to track all of the connections per your suggestion, I found an anomaly when I switched Receiver sockets for the HDMI links.  The video moved but the audio didn't.  Turns out the monitor was using the optical audio feed from the receiver.  So I disconnected the optical audio and the monitor automatically switched to the HDMI audio feed!   Looked promising...
    So I first connected an optical audio feed from the ATV to the receiver - Audio!  Then I pulled it, but the audio didn't switch to the HDMI feed.  It stopped.  Would be OK if all I was going to use is the ATV, but I need the DVD player too and I can't use a switcher to toggle between them if I have to unplug the optical audio each time.
    This is becoming a career!  Any suggestions?
    Will

  • Need PlSQL code to find out the column/combination of columns from a given table which will be unique values

    Given a table with some columns and data associated with that. Need to find out a column or a combination of some columns, so that the values or combination of values will be unique in the table.
    The table and number of columns and the columns will be dynamic.
    Can you please help me with the solution?

    f8d0dcea-cdf0-4935-8734-632fe021456c wrote:
    No key is defined in the table.
    Suppose a table contains 20 columns then I need the unique combinations of all columns.
    Example: A table 'Employee' has 4 columns: Emp_No, Emp_Name,Passport_No,Emp_Designation. No key is defined for Employee table. Need to find out which column(single column and combination if columns) have unique values. Like, First check if Emp_No is unique then check Emp_No+Emp_Name is unique, then check if Emp_No+Emp_Name+Passport_No is unique, then check Emp_No+Emp_Name+Passport_No+Emp_Designation is unique.
    Then again try with the combination of Emp_No+Passport_No and so on. In this way I need to find out all the combinations having unique values.
    As Paul says, that will be a waste of time, as it will taken a lot of processing for all the possibilities, checking all the data each time to determine which combinations of columns provide uniqueness.  What happens if someone inserts or deletes some data whilst your doing it?
    You'd be quicker to manually look at the tables, and make an educated guess and then test for uniqueness with a quick query on that guess.

  • Find Distribution percentage from Sender Cost to Receiving Cost

    Hi All,
    How can I find the percentage of distribution from sender cost center to receiving cost center in SAP.
    Kindly suggest.

    Hi,
    Check your distribution cycle: KSV3
    Under Segment header screen:
    Receiver tracing factor.
    Receiver Rule: Variable Proportions/ Fixed Proportions...etc.
    Other wise:
    Perform the distribution cycle with test run, KSV5
    Double Click on senders/ Receivers...you will come to know the  base for distribution.
    Regards,
    Pavan Kumar Arvapally

  • Help needed to write algorithm to find Direction given lat/lon

    Hello, i need an algorithm to find out the direction being traveled given the starting and ending lat/lon decimal coordinates. Anybody have any clues how to do it? or where i can find one to just plug into my program? thanks for your help
    public String getDirection(double prevLat, double prevLon, double newLat, double newLon) {
        String direction;
        return direction;
    }

    Perhaps this helps:
    http://www.cssd.ab.ca/tech/social/latitude/index.html
    It will help you learn the meaning of lat/long-coords. I think you will end up with somthing like this:
    if ( prevLat < newLat) {
       //we are travelling north
    else {
       // we are travelling south
    if (prevLong < newLong) {
       //we are travelling east?
    else {
       //we are travelling west
    }This could be wrong, since there is a west-long and an east-long..
    Anyhow, hope this gets you on your way.
    ps: is this a class-assignment??

  • How to find material and vendor combination which has freight conditions?

    Hi Please help me, its very urgent.
    How to find material and vendor combination which has freight conditions?
    Waiting for your help.
    Regards,
    Marella.

    Hi marella,
    Try MEKA transaction.
    Gopi

  • Recursive algorithm to find maximum

    Hi there,
    I am looking for a recursive algorithm for finding the maximum and minimum values in a double array.
    I did find the code from this forum. It works upto the size of array=200 fine.. it however just waits and waits for larger size of the array.
    The code I am using is:
    public double maxRecursive(double [] array){
    if (array.length==1){
         return array[0];
    double [] next=new double[array.length-1];
    System.arraycopy(array,1,next,0,array.length-1);
    return Math.max(array[0],maxRecursive(next));
    Could anyone help me with a better algorithm? I feel the above code is a overhaul with arraycopy as well as the recursive calls.
    Thanks for all your help!
    JP

    try this exact code, and see the output (System.out.prints). That will explain you the logic.
    public double maxRecursive(double [] array, int pos) {
         if (array.length - 1==pos) {
              System.out.println("So, I read all the elements, Final Value is :"+array[pos]+"\n");
              return array[pos];
         double recMax = maxRecursive(array, pos+1);
         System.out.println("Now I am at "+pos+" Position !!!\n");
         System.out.println("Till now my maximum value is : "+recMax+"\n");
         if(array[pos] > recMax) {
              System.out.println("My previous element is "+array[pos]+" since it is greater than my max value, here onwards, this will be my max value\n");
              return array[pos];
         else {
              System.out.println("My Previous element is "+array[pos]+" since it is less than my max value, my max value will not change\n");
              return recMax;
    }Sudha

  • Hierholzers Algorithm to find the Euler tour

    Does anyone know how to use Hierholzers Algorithm to find a Euler tour of a graph with Java?
    Or anyone know of any sites that contain a program that already does this?
    Thanx

    Does anyone know how to use Hierholzers Algorithm to find a Euler tour of a graph with Java?The construction of an Euler tour is not that difficult. The core of the
    proof whether or not such a tour exists is the following lemma --
    An Euler tour exists if and only if every vertex has an even number of
    edges connected to it.
    Hierholzer came up with the following construction; for the sake of the
    example, we'll use this graph; A is the start/end vertex --     B-------D
       /|\     /|\
      / | \   / | \
    /  |  \ /  |  \
    A   |   /   |   F
    \  |  / \  |  /
      \ | /   \ | /
       \|/     \|/
        C-------E Note that all vertexes have an even degree, so an Euler tour can be
    constructed. Step /zero one in Hierholzer's construction is --
    0) let 'level' == 1; 'start' == A;
    1) Start at vertex 'start' and generate a random tour;
    This is easy, simply wander around over any unused edge until you reach
    vertex A again. Suppose we created the tour A -> B -> C -> A.
    2) label all the used edges using 'level' and remove all used edges;
    This leaves us with the following graph --     B-------D
         \     /|\
          \   / | \
           \ /  |  \
    A       /   |   F
           / \  |  /
          /   \ | /
         /     \|/
        C-------E Note that every vertex still has an even number of edges connected to it.
    3) For any vertex on the tour so far, find a vertex that still has unused
    edges. We randomly pick vertex B; if we can't find such vertex, goto step 5;
    4) level= level + 1; start= B; goto step 1;
    If we've reached this step for a second time we could have generated a tour
    B -> D -> E -> B. All the edges are removed, after labeling them with a
    level equal to 2. The resulting graph looks like this then --     B       D
    A       /       F
        C-------E It's not difficult to see that, after we get at step 4, we have to complete
    the last tour, say, D -> F -> E -> C -> D and we remove the corresponding
    edges after labeling them with a level equal to 3.
    Finally we arrive at this step --
    5) All edges are removed and we've collected three tours --
    level 1: A -> B -> C -> A
    level 2: B -> D -> E -> B
    level 3: D -> F -> E -> C -> D
    6) Walk the first level tour until you reach a vertex that connects to a higher
    level tour (at vertex B); leave the level 1 tour and follow the next level
    tour until a similar situation occurs. Apply this step continuously until
    you've reached your original starting vertex (A) again.
    You've found an Euler tour --
    This: A -> B -> C -> A expands to A -> B -> D -> E -> B -> C -> A.
    Which in turn expands to A -> B -> D -> F -> E -> C -> D -> E -> B -> C -> A.
    Et voila!
    kind regards,
    Jos

  • SAP Error code- How to find possible errors

    Hi,
    Please advise is there any way to identify the possible errors in data or in config using error codes displayed by the sap system. Any such procedure to trace the possible mistakes. please guide me.

    dear friend,
    one of the approaches as follows ( technical , not functional): on your error screen goto System-Status, double click on Program (screen)
    and in this ABAP editor you could try to find out the place with that particular error code/number.
    then to analyse the code (why this message is called).
    to use this method you need to be able understand abap.
    just in case, all messages exist in standard table T100, so you can search there by text error or message number.
    from functional point of view you could try to find out the place in config (spro) where you can customize that particular message , say , error, or warning, or just skip. But this doesn't work always! Some of system messages are not configurable.
    depends on module and etc..
    good luck!

  • Possibility of creating combination chart Barchart/Line graph within OBIEE

    Hi
    Is it possible to create a combination chart within OBIEE as can be done in Excel by changing the chart type on one of the individual series - ie graph multiple series of data as a combination of Barchart & Line series?
    Any info appreciated
    Thanks & Regards
    K

    The charting can be as dynamic as you like if you willing to pre-configure the required options.
    Simply create as many charts as you want from one request, and use a view selector to allow the user to switch between them.
    You can use level based measures and any else you want as seperate columns (all in same request) then chart them accordingly.
    Hope this helps

  • Algorithm to find non repeating number from the list

    Hi,
    Can anybody provide me the algorithm for the program:
    User has provided a list of 'n' numbers (0-9) with only a single number not repeating at all and rest may repeat odd or even number of times. Now, job is to find out the number which is occuring only single time without repetition....

    Hi
    If n is a smallish number, then something like
    int bins[10];
    memset bins to zero;
    for (int i = 0; i < n; ++i)
    ++bins[arrayDigits[i]];
    for (int i = 0; i < 10; ++i)
    if (bins[i] == 1)
    printf("digit is %d\n", i);
    /* break if certain that i is the only bin == 1 */
    break;
    (arrayDigits is an array of the 'n' digits).
    If n is large, then you'll probably want to break out of that first loop as soon as only one of the bins.
    unsigned flag;
    unsigned first = 0US;
    unsigned second = 0US;
    for (int i = 0; i < n; ++i)
    flag = 1U << arrayDigits;
    if (first & flag)
    if (!(second & flag))
    /* second occurence of digit */
    second |= flag;
    /* exit condition is that 'first' has all bottom 10 bit set and
    'second' has all but 1 of the bottom 10 bits set */
    if (first == 0x3ff)
    /* all 'first' bits set */
    switch (second)
    case ~(1U << 0): /* digit is 0 */
    case ~(1U << 1): /* digit is 1 */
    case ~(1U << 9): /* digit is 9 */
    printf("digit is %d\n", i);
    break;
    default:
    /* do nothing - more than one digit still not at 'first' */
    /* else already seen 2 or more of digit */
    else
    /* first occurence of digit */
    first |= flag;
    I haven't tested any of the code.
    Paul

  • Algorithm to find out checkdigits

    I'm working on a code that finds the checkdigit of an array of ISBN numbers, and returns a boolean value of true is the ISBN number is valid and false if the ISBN nemuber is invalid. I've figured out most of it but need help with figuring out the rest. The whole thing takes up about three pages, here are screenshots of it in order: http://img219.imageshack.us/img219/1024/compscilab74iyt5.jpg
    http://img233.imageshack.us/img233/4888/compscilab74iisj7.jpg
    http://img218.imageshack.us/img218/7261/compscilab74iiirs3.jpg
    If you don't want to go to the links, I'll try to explain it:
    International Standard Book Numbers
    The final character of a ten-digit International Standard Book Number (ISBN) is a check digit that is computed as follows:
    Working from right to left,
    multiply each digit (other than the as-yet-unknown check digit) by its position in the number (including the as-yet-unknown check digit);
    add the products together;
    subtract the total from the closest multiple of 11 greater than or equal to that total. The answer is the check digit (using the letter "X" if the answer happens to be 10).
    Consider, for example, the ISBN 0-201-53082-1.
    Calculating the digit-by-position products yields
    2 ? 2 = 4; 8 ? 3 = 24; 0 ? 4 = 0; 3 ? 5 = 15; 5 ? 6 = 30;
    1 ? 7 = 7; 0 ? 8 = 0; 2 ? 9 = 18; 0 ? 10 = 0.
    Adding the products together yields
    4 + 24 + 0 + 15 + 30 + 7 + 0 + 18 + 0 = 98.
    Subtracting 98 from 99 yields the check digit 1.
    Since our calculation yields the same result as the final digit of the given ISBN, we conclude that this ISBN is valid.
    While this may seem more complicated than UPC check digits, it can be validated very simply by adding together all the digit-by-position products (including the check digit, whose position is of course 1). If the result is a multiple of 11, then the ISBN is valid. (Recall that to check if an int n is a multiple of 11, determine whether or not n % 11 is 0.)
    The String Array c contains the "stringified" individual elements (including hypens) of a ten-digit ISBN. (In the above example, the contents of c would be "0", "-", "2", "0", "1", "-", "5", "3", "0", "8", "2", "-", "1", in that order.) Complete the following code to store in the boolean variable good the value true if and only if the ISBN is valid.
    // Enter values to test here
    String[] c = { "0", "-", "2", "0", "1", "-", "5", "3", "0", "8", "2", "-", "1" };
    boolean good;
    int sum = 0;
    int pos = 1;
    // Loop over array from end to start
    for ( int i = c.length - 1; i >= 0; i-- )
    // Ignore hyphens
    if ( !c.equals( "-" ) )
    // Deal with a possible "X" digit
    if ( sum > 0 )
    sum += Integer.parseInt(c[i]) * pos;
    else
    sum += Integer.parseInt(c[i]) * pos;
    pos++;
    int j = sum;
    while(j % 11 != 0)
    j++;
    System.out.println(sum);
    System.out.println(j);
    good = ((j - sum) == Integer.parseInt(c[12]));

    I'm working on a code that finds the checkdigit of an array of ISBN numbers, and returns a boolean value of true is the ISBN number is valid and false if the ISBN nemuber is invalid. I've figured out most of it but need help with figuring out the rest. The whole thing takes up about three pages, here are screenshots of it in order: http://img219.imageshack.us/img219/1024/compscilab74iyt5.jpg
    http://img233.imageshack.us/img233/4888/compscilab74iisj7.jpg
    http://img218.imageshack.us/img218/7261/compscilab74iiirs3.jpg
    If you don't want to go to the links, I'll try to explain it:
    International Standard Book Numbers
    The final character of a ten-digit International Standard Book Number (ISBN) is a check digit that is computed as follows:
    Working from right to left,
    multiply each digit (other than the as-yet-unknown check digit) by its position in the number (including the as-yet-unknown check digit);
    add the products together;
    subtract the total from the closest multiple of 11 greater than or equal to that total. The answer is the check digit (using the letter "X" if the answer happens to be 10).
    Consider, for example, the ISBN 0-201-53082-1.
    Calculating the digit-by-position products yields
    2 ? 2 = 4; 8 ? 3 = 24; 0 ? 4 = 0; 3 ? 5 = 15; 5 ? 6 = 30;
    1 ? 7 = 7; 0 ? 8 = 0; 2 ? 9 = 18; 0 ? 10 = 0.
    Adding the products together yields
    4 + 24 + 0 + 15 + 30 + 7 + 0 + 18 + 0 = 98.
    Subtracting 98 from 99 yields the check digit 1.
    Since our calculation yields the same result as the final digit of the given ISBN, we conclude that this ISBN is valid.
    While this may seem more complicated than UPC check digits, it can be validated very simply by adding together all the digit-by-position products (including the check digit, whose position is of course 1). If the result is a multiple of 11, then the ISBN is valid. (Recall that to check if an int n is a multiple of 11, determine whether or not n % 11 is 0.)
    The String Array c contains the "stringified" individual elements (including hypens) of a ten-digit ISBN. (In the above example, the contents of c would be "0", "-", "2", "0", "1", "-", "5", "3", "0", "8", "2", "-", "1", in that order.) Complete the following code to store in the boolean variable good the value true if and only if the ISBN is valid.
    // Enter values to test here
    String[] c = { "0", "-", "2", "0", "1", "-", "5", "3", "0", "8", "2", "-", "1" };
    boolean good;
    int sum = 0;
    int pos = 1;
    // Loop over array from end to start
    for ( int i = c.length - 1; i >= 0; i-- )
    // Ignore hyphens
    if ( !c.equals( "-" ) )
    // Deal with a possible "X" digit
    if ( sum > 0 )                                                      } This is the part
    sum += Integer.parseInt(c) * pos;                         } that I                
    else                                                                   } think i'm doing
    sum += Integer.parseInt(c) * pos;                         } wrong.
    pos++;
    int j = sum;
    while(j % 11 != 0)
    j++;
    System.out.println(sum);
    System.out.println(j);
    good = ((j - sum) == Integer.parseInt(c[12]);Edited by: stone_cutter on Nov 9, 2007 4:12 PM
    Edited by: stone_cutter on Nov 9, 2007 4:18 PM

  • Find condition record - key combination - FV11

    Hi,
    pls tell me, how to find the key combination has maintaintained for a particular condi type.. ie. for condi type JMOP in which combination (tax code or plan/mat./vendor or mat. grp/plant) the tax rate *has maintained??
    Edited by: Raju on Feb 25, 2009 7:40 AM

    Dear Raju
    Just Go to T Code Se11 or SE16
    Enter Table as A363 after entering table A363 in Condition type Enter JMOP and Execute
    You will find  for condi type JMOP  (tax code or plan/mat./vendor or mat. grp/plant)
    To find tax code just get the cond record no after executing A363 and in KONV you will find the tax code maintained for the combination
    regds
    shailesh

  • To find the percentage of transaction

    SQL> select * from txn;
    tid | item
    -----+------
    1 | A
    1 | B
    1 | D
    2 | A
    2 | C
    2 | C
    2 | B
    3 | A
    3 | C
    4 | A
    4 | B
    4 | C
    5 | A
    6 | A
    7 | A
    above is the table txn, how to find out the percentage of transactions that had items 'A' and 'C' (you can have multiple items per transaction id)

    If you are trying to get the percentage of simultaneous existence of A and B for same id, you can use like...
    sql>
    select *
    from test_tab
    order by 1,2;
    ID TXN 
    1  A 
    1  B 
    1  D 
    2  A 
    2  C 
    3  A 
    3  C 
    4  A 
    4  B 
    4  C 
    5  A 
    6  A 
    7  A 
    --So the percentage of A and C is 3/7
    sql>
    select (sum(decode(cnt,1,0,2))/2)/count(*) pct_of_a_and_c
    from(
        select id ,sum(decode(txn,'A',1,'C',1,0)) cnt
        from test_tab
        group by id
    PCT_OF_A_AND_C 
    .428571429
    jeneesh
    Message was edited by:
    Something wrong with the browser
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Nokia Messaging is not working correctly

    Only random email messages are arriving...

  • IPAD 2 / Iphone 4 - Mail only displays half the photos

    Hi, I have this problem on my Ipad 2 and with my Iphone 4. I sometimes get emails that contain more than 20 pictures. When I open those emails, about half of the pictures are displayed correctly. The remaining half are not displayed. Instead I get mu

  • Cannot re-install software after receiving Error 16

    I tried to re-install Adobe Elements 11 after receiving Error 16. It would not re-install. It sent me an e-mail asking me to verify my e-mail address, clicking on a link which I did. It took me to a screen asking me to subscribe to a Creative Cloud p

  • Scanner Input Validation

    Hi, I hope Im posting to the right place. I want to check to see if the user input is an integer and keep asking for one if the input is not an integer. Should be very simple but I cant do it because I just dont know how. Im not willing to use a "try

  • IPhone Email attachments

    Hopefully this will help others also. I contacted Apple iPhone tech support and was switched to the second level support (some very knowledegable people there). I was asking about the inability of the iPhones to send or receive attachments. Currently