TCS
Company
HR Interview
Interview
Remainder when 97! is divided by 101????
Read Solution (Total 16)
-
- 97!/101
1*2*3*4....*97/101
rem(1/101)+rem(2/101)+rem(3/101)....+rem(97/101)
rem((1+2+3+.....+97)/101)
rem(4753/101)
=6(ans) - 11 years agoHelpfull: Yes(27) No(35)
- according to wilsons theorem...(n-1)!=-1(mod n)
here n is 101
so 100!=-1(mod 101)
100*99*98*97!=-1(mod 101)
97!={-1*(100*99*98)}(mod 101)
97!={-1*-1*-2*-3} (mod 101)
97!=6 (mod 101)
so answer is 6
- 11 years agoHelpfull: Yes(11) No(0)
- 17....using wilson's theorem
- 11 years agoHelpfull: Yes(6) No(2)
- Wilson's Theorem is about primes, namely, for integer n>1,
(n-1)! = -1 mod n iff n is prime.
Since 101 is prime, we can use it, along with the fact that
100*99*98*97! = 100!
Then taking mod 101 and using Wilson's Theorem,
100*99*98*97! = -1 mod 101
(-1)(-2)(-3)97! = -1 mod 101
so that, multiplying both sides by -1,
6*97! = 1 mod 101
Now, we'd like to find the inverse mod 101 of 6. To do this, use the fact that
6*17 = 102 = 1 mod 101, to multiply both sides by 17, yielding
17*6*97! = 97!mod 101 = 17 mod 101
So it's 17. - 11 years agoHelpfull: Yes(4) No(0)
- Wilsom theorem states:
(n-1)!=-1 mod n if n is prime
Since, 101 is luckily prime
100!=-1 mod 101
now, 100*99*98*97!=-1 mod 101
inverse of 100=100 or (-1), of 99=50, of 98 is 67
so 97!=-1*100*50*67 mod 101
or 97!=-1*-1*50*67 mod 101
=3350 mod 101
=17 (ans) - 11 years agoHelpfull: Yes(3) No(1)
- 97!/101=
97*96*............1/101
(97/101)+(96/101).......1/101
(1+2+3+4..........96+97)/101
(((1+97)/2)*97)/101=6 - 10 years agoHelpfull: Yes(2) No(0)
- Since 101 is prime, any number in range 1 to 100 is invertible
Use Extended Euclidean algorithm given here http://en.wikipedia.org/wiki/Modular_multiplicative_inverse
A tabular method can be taken from any book on modular arithmetic. - 11 years agoHelpfull: Yes(1) No(0)
- how inverse of 99 and 98 are 50 and 67 respectivly? pls explain
- 11 years agoHelpfull: Yes(1) No(0)
- As already said, it is calculated using Extended Eucledian theorem.
It means 99*50 mod 101=1 98*67 mod 101=1 - 11 years agoHelpfull: Yes(1) No(0)
- @D G please explain ur answer
- 11 years agoHelpfull: Yes(0) No(0)
- @ D G. wats wilson theorem?
- 11 years agoHelpfull: Yes(0) No(0)
- @ D G. wats wilson theorem?
- 11 years agoHelpfull: Yes(0) No(0)
- pranshu plzzzz tel me that step .... 97! vala jo first step hai,,why did u take 97!,,??????????
- 11 years agoHelpfull: Yes(0) No(0)
- @MD...bcoz in dis prblm v hv to calculate 97%101
- 11 years agoHelpfull: Yes(0) No(0)
- @prateek..please explain the concept of taking inverse which u hv taken..
- 11 years agoHelpfull: Yes(0) No(1)
- remainder 97 and quotient is 0..
- 10 years agoHelpfull: Yes(0) No(0)
TCS Other Question