Arnab Chakraborty has Published 4293 Articles

Program to find probability that any proper divisor of n would be an even perfect square number in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:50:08

125 Views

Suppose we have a number n, we have to find out the probability that any proper divisor of n would be an even perfect square.So, if the input is like n = 36, then the output will be 1/8 because there are eight proper divisors of 36, these are {1, ... Read More

Program to find value of find(x, y) is even or odd in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:43:58

265 Views

Suppose we have an array nums. We also have another pair (x, y), we need to find whether the value find(x, y) is Odd or Even. The find() is as followsfind(x, y) = 1 if x > yfind(x, y) = nums[x]^find(x+1, y) otherwiseSo, if the input is like nums = ... Read More

Program find number of subsets of colorful vertices that meets given conditions in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:41:12

143 Views

Suppose we have an array colors, representing colors for one regular n-gon. Here each vertex of this n-gon was randomly colored with one of n different colors present in the given array. We have to find the number of special subsets of polygon vertices, such that these subsets meet these ... Read More

Program to find number of expected moves required to win Lotus and Caterpillar game in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:36:43

169 Views

Suppose we have a grid with n rows and m columns. Amal and Bimal are playing a game on that grid. The game rule is like below −Amal places white lotus tile somewhere at the top row and Bimal places a caterpillar tile somewhere on the bottom row. Amal starts ... Read More

Program to find expected growth of virus after time t in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:30:32

202 Views

Suppose there is a dangerous virus and that grows rapidly. The probability of number of virus cells growing by a factor x is 0.5 and also the probability of number of virus cells growing by a factor y is 0.5. Now if there was a single cell of virus at ... Read More

Program to find number of solutions for given equations with four parameters in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:27:41

244 Views

Suppose we have four numbers a, b, c and d and We have to find number of pairs (x, y) can be found such that that follows the equation: x^2 + y^2 = (x*a) + (y*b) where x in range [1, c] and y in range [1, d]So, if the ... Read More

Program to find last digit of the given sequence for given n in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:24:02

214 Views

Suppose we have a value n. We have to find the last digit of sequence S. The equation of S is given below −$$\sum_{i=0\: 2^{^{i}}\leqslant n}^{\alpha } \sum_{j=0}^{n} 2^{2^{^{i}+2j}}$$So, if the input is like n = 2, then the output will be 6 because: here only i = 0 and ... Read More

Program to find position of first event number of line l of a triangle of numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:21:22

174 Views

Suppose we are generating a number triangle like below      1     1 1 1   1 2 3 2 1 1 3 6 7 6 3 1where in each row the elements are generated by adding three numbers on top of it. Now if we have a ... Read More

Program to find sum of the 2 power sum of all subarray sums of a given array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:05:24

296 Views

Suppose we have a list A. We have taken all non-empty sublists of A as we know a list l with n elements has (2n - 1) non-empty sublist. Now for each sublist, he calculates sublist_sum (the sum of elements and denotes them by S1, S2, S3, ... , S(2N-1)). ... Read More

Program to check we can reach at position n by jumping or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:02:25

170 Views

Suppose there is a number line from 1 to n. At first we are at position 0, jump one step to go 1, then jump two place to reach at position 3, then jump three position to reach at 6 and so on. We have to check whether maintaining this, ... Read More

Advertisements