Skip to main content

Posts

(3) Understanding List Comprehension in Python

Recent posts

(2) What is mean, median and mode? Real time example to understand the concept

Mean, median and mode are measures to find the center value. Following are Number of kilometers for 1 week of my walking(Rounded to nearest integer). Day 1: 11 Day 2:0 Day 3:5 Day 4:5 Day 5:7 Day 6:8 Day 7:6 Mean: Sum = 42 Number of values(n) = 7 Mean = sum/n = (42/7) = 6 Median: Sorted values: [0,5,5,6,7,8,11] Median is at the position:(7+1)/2 = 4 4th value in the sorted values.(middle value) Median = 6 Mode: Mode = 5 (Most frequent number) What is the median if n is even? If n is even then median is the mean of values at the position(n/2 and (n/2) +1) Day 8:5 Then sorted values: [0,5,5,5,6,7,8,11] n/2 = 8/2 = 4 (n/2)+1 = 5 Then median is mean of 5 and 6 Median = 11/2 = 5.5

(1) Whats the difference between Permutations and combination?

Consider the following scenario - We go to Nanbu 🏠 and Nabu decides to play a game - The participants are Raags, Saro and Koch - Nanbu asking us to stand us in Permutations and Combination orders... (permutations and combination order of 2's) ->   i.e., different ways the 2 people out of 3 can be permutated and combinated ) Permutations: Total Entries:             Raags,Koch,Saro Total Permutations of 2: (Standing position) {Raags,Koch} {Raags,Saro}  {Koch,Saro} {Koch,Raags}  {Saro,Koch}  {Saro,Raags}   Total Combinations of 2: {Raags,Koch}  {Raags,Saro}  {Koch,Saro} Basic Overview: Order matters the most in Permutations Order does not matter in combination