Enable contrast version

# Tutor profile: Shashi Ranjan P.

Inactive
Shashi Ranjan P.
Computer Science Engineering Student at IIT Kharagpur, Tutoring experience of 3 years
Tutor Satisfaction Guarantee

## Questions

### Subject:Calculus

TutorMe
Question:

Q : Find the particular solution of y’’ + y = (x^2) + x + 3

Inactive
Shashi Ranjan P.

The given DE in operator form can be written as (D^2 + 1)y = (x^2) + x + 3: =) y = ((1/(D^2 + 1) )*(x^2 + x + 3)) 1 in ascending powers of f(D) =) y = ((1 + D^2)^-1)*(x^2 + x + 3): =) y = (1 -D^2 + D^4 ::::::)(x^2 + x + 3): =) y = (x^2 + x + 3) -(D^2(x^2 + x + 3)) + D^4(x^2 + x + 3) ::::::: =) y = x^2 + x + 3 2 + 0 ::::::: =)y = x^2 + x + 1; is the required particular solution of the given DE.

### Subject:C Programming

TutorMe
Question:

Consider two strings, then the might have some common sequence of characters among them. Like 'ababcdce' and 'bebedffe' have a common sequence of 'bbde' .The sequence in which these four characters appear in both the strings is same. So, this is the Longest common sub sequence (LCS ) of the two strings. Write a C code to do the same. Input : size of both strings and the two strings . Output : Length of LCS and the LCS string like 'bbde' in our sample case.

Inactive
Shashi Ranjan P.

#include<stdio.h> #include<malloc.h> #include<stdlib.h> #include<string.h> void lcs(int **a,int **b,char *x,char *y,int m,int n); void printlcs(int **b,int **a,char *x,int i,int j); int main() { int m,n,i,j; scanf("%d %d",&m,&n); int **a,**b; char *x,*y; x=(char *)malloc((m+1)*sizeof(char)); y=(char *)malloc((n+1)*sizeof(char)); scanf("%s",x); scanf("%s",y); a=(int **)malloc((m+1)*sizeof(int *)); for(i=0;i<=m;i++) { *(a+i)=(int *)malloc((n+1)*sizeof(int)); } b=(int **)malloc((m+1)*sizeof(int *)); for(i=0;i<=m;i++) { *(b+i)=(int *)malloc((n+1)*sizeof(int)); } for(i=0;i<=n;i++) { a[0][i]=0; } for(i=0;i<=m;i++) { a[i][0]=0; } lcs(a,b,x,y,m,n); printf(" \n %d\n",a[m][n]); printlcs(b,a,x,m,n); } void lcs(int **a,int **b,char *x,char *y,int m,int n) { int i,j; for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { if(x[i-1]==y[j-1]) { a[i][j]=a[i-1][j-1] +1; b[i][j]=2; } else { if(a[i-1][j]>a[i][j-1]) { a[i][j]=a[i-1][j]; b[i][j]=3; } else { a[i][j]=a[i][j-1]; b[i][j]=1; } } } } } void printlcs(int **b,int **a,char *x,int i,int j) { if((i==1||j==1)&&(a[i][j]==2)) { printf("%c",x[i-1]); return; } else { switch(b[i][j]) { case 1: printlcs(b,a,x,i,j-1); break; case 2 : printlcs(b,a,x,i-1,j-1); printf("%c",x[i-1]); break; case 3 : printlcs(b,a,x,i-1,j); break; } } }

### Subject:Physics

TutorMe
Question:

Q : Is friction really always necessary for pure rolling of any body ? (Rotational Dynamics)

Inactive
Shashi Ranjan P.

Ans : Strictly speaking No, friction is not always necessary for pure rolling . Suppose a rigid ball (ideal one) is given a rational speed (angular) of 'w' and its center is given a linear velocity 'v' such that ' v = w * r ' (r : radius of the ball) , then the point of contact of ball and ground (rough one) will not have a slipping tendency with respect to ground. So, no friction will act on the ball and the ball will continue it's pure rolling motion. And all this will be valid as long as there does not exists any rolling friction.

## Contact tutor

Send a message explaining your
needs and Shashi Ranjan will reply soon.
Contact Shashi Ranjan