Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Even distribution of percentages of a list to use each uniquely

  • 08-01-2014 02:16PM
    #1
    Registered Users, Registered Users 2 Posts: 5,753 ✭✭✭


    Issue im having to get coverage to do unique actions to sublists of a list

    We use an offset so that the start point is unique in each sublist. Example data as follows.

    Doing action A to 30% of nodes with offset 0
    Doing action B to 30% of nodes with offset 1
    Doing action C to 30% of nodes with offset 2
    Doing action D D to 10% of nodes with offset 3

    We have a list of 135 nodes.

    ...1% of this list is 1.35 nodes
    ...30% of this list is 40.5 nodes (we round up to 41)
    ...10% of this list is 13.5 nodes (we round up to 14)

    The gap between nodes is calculated as 100 / percentage so..

    30% means a gap of 3 between each node in list
    10% means a gap of 14 between each node in list

    action A gives the node list as
    node1, node4, node7 etc
    action B gives the node list as
    node2, node5, node8 etc
    action C gives the node list as
    node3, node6, node9 etc
    action D gives the node list as
    node4, node18, node32 etc

    We would then be using the same nodes in more than 1 action.

    Maybe theres a better way to do this... ?


Advertisement