Skip to main content

Cricbay DRR calculation technique made easy


Seaon is coming to an end and everyone is closely watching team DRR and here is an simple method of predicting match DRR.

10 is the magic number to get 0.50 DRR.


Bat first

win by 10 runs and your DRR will be 0.50.
likewise 20 runs diff will give 1.00 DRR etc


Bat second

You need the below formula to calcuate balls required to get 0.50 DRR.
(runs/runs+10) * 120)
i.e.
chasing 60 runs you will need ==> 60/70 * 120 ==> 103 balls to get 0.50 DRR
chasing 80 you will do ==> 80/90 * 120 ==> 108 balls to get 0.50 DRR

Note: if you are still wondering how to calculate loosing DRR just remember DRR lost by one team is gain by others i.e. just put a minus infront of winners DRR.
Note: All the calculations are rounded to nearest decimal.



--- Wondering how I got to the nos ---

Bat first

DRR formula ==> (Runs scored/Ball faced - Runs gave/Balls bolwed) * 6
If you bat first and win that way you and your oppoent will end up playing 120 balls either by playing all balls or loosing all wickets.
Let b == Balls faced == Balls bolwed == 120, r1 is runs scored and r2 is runs gave. Now apply the variables to the formula.
( r1/b - r2/b ) * 6
(r1 - r2) * 6 / 120
(r1 - r2) * 1/20
i.e If r1 - r2 equals 10 then DRR will be 10 * 1/20 ==> 0.50

Bat Second

Let x == Runs gave == Runs chased ==> this a variable
Let y is balls needed to chase x runs. Now apply these to formula
(x/y - x/120) * 6 ==> i.e. (x/y - x/120) should be equal to 0.166 so when multiply by 6 will get 1 DRR
x/y - x/120 = 0.166
(120x - xy) / 120y = 0.166
120x -xy = 0.166 * 120y
120x -xy = 19.92.y
120x = 19.92y + xy
120x = y (x + 19.92)
y = 120x / (x+20)
y = x/x+20 * 120
i.e. for DRR 0.50 you need to find balls by x/x+20 * 120

eg to get 0.50 DRR for below runs you need following balls.

chasing 50 runs balls = 50/60 * 120 ==> 100
chasing 60 runs balls = 60/70 * 120 ==> 103
chasing 70 runs balls = 70/80 * 120 ==> 105
chasing 80 runs balls = 80/90 * 120 ==> 108
chasing 90 runs balls = 90/100 * 120 ==> 109

Hope this helps every team member keep a tap on DRR.

Comments

Popular posts from this blog

JPA 2 new feature @ElementCollection explained

@ElementCollection is new annotation introduced in JPA 2.0, This will help us get rid of One-Many and Many-One shitty syntax.

Example 1: Stores list of Strings in an Entity

@Entity
public class Users implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
@ElementCollection
    private List<String> certifications = new ArrayList<String>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public List<String> getCertifications() {
        return certifications;
    }

    public void setCertifications(List<String> certifications) {
        this.certifications = certifications;
    }
..
}

        Users u = new Users();
        u.getCertifications().add("Sun Certified Java Programmer");
        em.persist(u);

Generated Tables

   Users
Column --> ID
    Row             1

Users_CERTIFICATIONS

Validating CSV Files

What is CsvValidator ?
  A Java framework which validates any CSV files something similar to XML validation using XSD.

Why should I use this ?
  You don't have to use this and in fact its easy to write something your own and also checkout its source code for reference.

Why did I write this ?
  Some of our projects integrate with third party application which exchanges information in CSV files so I thought of writing a generic validator which can be hooked in multiple projects or can be used by QA for integration testing.

What is the license clause ?
GNU GPL v2

Are there any JUnit test cases for me checkout ?
 Yes, source

How to integrate in my existing project ?

Just add the Jar which can be downloaded from here CsvValidator.jar and you are good.

Instantiate CsvValidator constructor which takes these 3 arguements

         // filename is the the file to be validated and here is a sample         // list - defines all the fields in the above csv file ( a field has index, type, isOptional, rege…

ArrayList vs LinkedList vs HashSet Performance Comparision

ConclusionsInserting & Reading sequentially from Collection prefer LinkedList/ArrayListInserting & Reading/Deleting by Search/equals from Collection prefer HashSetInserting, ArrayList & LinkedList performs best while HashSet takes double the timeReading, HashSet performs best while ArrayList & LinkedList are marginally lessDeleting, HashSet performs 10 times better than ArrayList & ArrayList performs 4 times better than LinkedList. LinkedList is slow because of sequencial search Bottom line : unless you are not going to iterate using for(Integer i : list ) then prefer HashSet
Inserting/Reading/Deleting integer's from zero till countJDK7Collectionactioncounttime msArrayListInsert1000/1LinkedListInsert1000/1HashSetInsert1000/1ArrayListInsert100005LinkedListInsert100004HashSetInsert100007ArrayListInsert10000011LinkedListInsert10000011HashSetInsert10000021ArrayListGet/Read1000LinkedListGet/Read1000HashSetGet/Read1000ArrayListGet/Read100004LinkedListGet/Read100003Has…