« first day (713 days earlier)      last day (2206 days later) » 
02:00 - 12:0012:00 - 13:00

02:04
02:38
@Pranav I guess because there is no torque at the point of contact so angular momentum is conserved. Since Moment of inertia decreases so onegs increases
Which further implies linear velocity increases
@Don'tbeax-tripledot can you post the solution in your free time pls
 
2 hours later…
05:05
@JohnRennie good morning
@Zerix morning :-)
@JohnRennie are you free for giving hint
Yes, I'm around for several hours now
Okay
@JohnRennie A small ball of mass $m$ lies on the superior pole of a frictionless semi-sphere of mass $M$ which lies on a horizontal frictionless surface. The ball is smoothly released from its unstable equilibrium position and starts moving on the surface of the semi-sphere (with no initial velocity). Find the angle $\theta$ for which the ball detaches from the semi-sphere. Solve the problem in the particular case $m=M$.
How to proceed... COM frame?
That doesn't sound like a JEE problem ...
05:09
It's not. But still this could be solved by jee techniques?
Do we need to make diffrential equation here
I would work in the COM frame and use conservation of energy.
The momenta of the ball and hemisphere have to be equal and opposite and their total KE must add up to $mgh$, where $h$ is the vertical distance the ball has fallen.
@JohnRennie okay
Assume the ball stay in contact, so you know the direction of motion of the ball because it's the tangent to the hemisphere.
Yes
Then you can calculate the normal force, and the point at which it falls below zero.
05:16
@JohnRennie N=mv^2/r+ mgcos(thetha)
I feel this is incorrect
Wait at the point of leaving contact
mgcos(thetha) = mv^2/r
Is this what you were talking about?
The falling sphere doesn't trace out an arc of a circle because the hemisphere is accelerating in the opposite direction, so the acceleration won't simply be v^2/r. I'd have to sit down and start working in the problem to figure out what the normal force is.
@JohnRennie better to leave then
Does anyone answer given there matches the step to follow
05:31
@JohnRennie are you free now?
@Zerix that's a stationary hemisphere i.e. the particle is sliding on a fixed surface. Your problem is harder because the hemisphere is allowed to slide as well.
@Nobodyrecognizeable hi, yes, I'm around for a while.
@JohnRennie as the hemisphere is a frictionless surface so it doesn't pose any problem. Do it the normal way.
@JohnRennie anyway wanted to show you some programmes of c.
OK ...
@JohnRennie you know what the programme wants to do. I just want to confirm if it gives the output or not.
It asks the user for a number, call this n, then it reads n-1 more numbers from the user. That's probably a bug - I'd guess it's supposed to read n more numbers.
Then it prints out the numbers the user entered, but for some reason it keeps printing the first number.
05:38
@JohnRennie it wants you to put a number then print the first and last integer of the number.
The number should be entered via enters.
You means that was the problem set? If so that code doesn't work.
@JohnRennie should the return 0 be the problem?
"return 0" ?
@JohnRennie yep that's the question.
@JohnRennie you are doing it in c right?
The first task is to prompt the user for a number. The line scanf("%d", &n) does this. It accepts a number entered by the user and stores it in the variable n. So far so good.
Now you have to print the first and last digit of the number. I can think of two ways to do this. On way would be to take the modulus 10 of the number i.e. n % 10. This will give you the last digit. OK so far?
05:45
@JohnRennie sorry one phone call came . As far i know n%10 means the leftout after dividing n by 10.
Correct, and that is going to be the last digit of the number. For example if the number is 1234 then the remainder after dividing by 10 is 4 i.e. the last digit.
@JohnRennie ok . Thats brilliant. But what to do with the first number.
Keep dividing the number by 10 until it is less than 10. Something like:
while (n > 9)
  n = n/10;
Take the example of 1234 again. Dividing by 10 gives 123, then 12, then 1 and now we stop because 1 < 10. What we have left is the first digit i.e. "1".
@JohnRennie wouldn't it give 1.234?
Integer division always returns an integer, so the fraction part is dropped.
2
e.g. with integer division 3/2 = 1 because integers have to be whole numbers so the .5 is dropped.
05:53
I see . So it would need three variables ie int i,j,k. Ok i am trying to type it in mobile c. If i run into problems I'll be back again. Bye for now.
You don't need to include math.h and conio.h. Just include stdio.h.
@Zerix For the semi-sphere problem? Sure, will do.
@JohnRennie shouldn't this do the job?
while (0<j<10) isn't valid C.
@JohnRennie ah ok.
06:06
#include <stdio.h>

int main(int argc, char* argv[])
{
  int input_number, first_digit, last_digit;

  printf("Enter a number: ");
  scanf("%d", &input_number);

  last_digit = abs(input_number) % 10;

  first_digit = abs(input_number);
  while (first_digit > 9)
    first_digit /= 10;

  printf("First_digit = %d, last digit = %d\n", first_digit, last_digit);

  return 0;
}
That's what I did ...
@JohnRennie hell that even runs in bad compiler like mobile c. Do you find any inaccuracies in my version of the code?
The line n%10==i doesn't do what you want. == is the equality test not the assignment operator. That line compares n%10 to i and returns true if they are equal or false if they are different.
@JohnRennie what if i did n%10=i?
@Nobodyrecognizeable = sets the left side equal to the right side. So that line is trying to set n%10 equal to i.
You want i = n % 10
@JohnRennie but there's still problem with the first integer.
It shows up to be 0. Upon typing 678.
06:16
@JohnRennie do you know file handling in java?
@Abcd I've never done it, but Java is similar enough to C++ that I expect I could help ...
@Nobodyrecognizeable you need to first set j equal to n, then start dividing j by 10. At the moment you aren't setting j to anything, so it is defaulting to zero.
Also you need to loop while j>9, not while j<10.
@JohnRennie in while loop how to set j=n?
j = n;
while (j > 9)
  j = j/10;
@JohnRennie Ok I will ask later today or later sometime coz I dont understand abstract concept like streams.
@JohnRennie Which variables should be included in a variable description table?
@Zerix First, let $\vec{v_r}$ – the velocity of the ball relative to the sphere, $\vec{v}$ – the absolute velocity of the ball, $\vec{u}$ – the velocity of the semi-sphere. Detachment condition:$$N=0\implies v_r=\sqrt{gR\cos\theta}$$Break the velocities into components:$$v^2=v_x^2+v_y^2=v_{ry}^2+(u-v_{rx})^2\tag{(1)}$$Momentum conservation on Ox gives: $$Mu=mv_x,\:\:\:M=m\implies u=v_x=v_{rx}-u\implies 2u=v_{rx}$$
Going back into $(1)$:$$v^2=gR\cos\theta\sin^2\theta+\dfrac{gR\cos^3\theta}{4}=$$$$=gR\dfrac{4\c‌​os\theta-3\cos^3\theta}{4}$$Conservation of energy:$$mgR(1-\cos\theta)=\dfrac{1}{2}m\left(\dfrac{v_{rx}}{2}\right)^2+\dfrac{‌​1}{2}mv^2$$ Skipping algebra, this gives: $$\cos^3\theta-6\cos\theta+4=0\implies \boxed{\theta=42.94^\circ}$$
06:24
@JohnRennie so you have to declare before starting the loop are there no options of setting it in the loop as in for loop?The program worked out well. L
@Nobodyrecognizeable a while loop just loops while some condition is true. Its job is not to initialise variables.
What's wrong with chatJax :c
@Don'tbeax-tripledot it's working here ...
@Don'tbeax-tripledot you dont need \ to write cos.
06:27
@Nobodyrecognizeable Compare: $\cos\theta$ with $cos\theta$
@JohnRennie That $\color{red}{\c}os$ is weird
Uh, anything wrong with =gR\dfrac{4\c‌​os\theta-3\cos^3\theta}{4}? :)
@Don'tbeax-tripledot looks identical to me.
@Don'tbeax-tripledot \c isn't valid MathJax
@Zerix Also, here is a diagram
I don't think you can do \cos with just the first letter in red.
06:30
@JohnRennie Variable description table means a table with name of Variables, Purpose, and its data type columns. But given the endless number of variables in programs its hard to decide which ones to include.
$\mathrm{\color{red}{c}os}$
@JohnRennie Well I've intentionally written \color{red}{\c}os in that message
Because that's how it shows up for me :C though I could have written \c os instead
@Abcd normal practise is to use variable names that are meaningful so you can tell at a glance what the variable is. For example look at the code I posted above:
25 mins ago, by John Rennie
#include <stdio.h>

int main(int argc, char* argv[])
{
  int input_number, first_digit, last_digit;

  printf("Enter a number: ");
  scanf("%d", &input_number);

  last_digit = abs(input_number) % 10;

  first_digit = abs(input_number);
  while (first_digit > 9)
    first_digit /= 10;

  printf("First_digit = %d, last digit = %d\n", first_digit, last_digit);

  return 0;
}
@JohnRennie yes even my variables are like that in my programs but my teacher is saying that you HAVE TO make it no matter what.
@Don'tbeax-tripledot ah, there's a bug in ChatJax. If the Latex gets split by a line break it won't render properly. Put spaces in your Latex to allow the line to split at spaces.
@Abcd that's a pain, but I guess you have to do it if you want the marks.
06:35
Ok then, thanks. I didn't want to add spaces because the messages were close to the threshold this time and I didn't want to split the proof into 3 messages, lol. Thanks for clearing that up
@Don'tbeax-tripledot thanks for the bookmark .lol.
@JohnRennie thanks for the help. Have a nice day professor, goodbye.
@JohnRennie Is there any way to make the picture look like its a part of the rest of the page??
In Word?
yes
You can move the picture around to line it up, or stretch or shrink it to change the text size. But that's all you can do.
06:43
@JohnRennie Is there any thing that can extract words from image as it is so that I can copy paste
@Abcd OCR apps can do that. Offhand I don't know of any, though I'd guess a quick Google will find you something. There is nothing buit into Word to do it.
For small picture it would be quicker to just retype the text yourself.
No there are 25 pics
OK, but even with an OCR app you need to run it 25 times, then correct the inevitable errors and formatting problems. It's probably still quicker to manually type it (boring though)
I'd probably just leave them as pictures!
07:30
@JohnRennie r u there
@Abcd hi
@JohnRennie What are stream classes??
In programming input and output are commonly implemented as streams.
OK?
There's no special significance to the choice of the word stream except I suppose that data flows through streams in the way water flows through a ream stream.
A stream is simply an object that you can read data from or write data to.
07:35
ok...
@JohnRennie dint get
Suppose you want to read data from a file. You create a stream and connect that stream to the file. Then you just call stream methods to get the data. You leave the stream object to deal with the details of what it actually means to process a file on a disk.
The advantage of working this way is that you can also connect streams to other objects e.g. web servers. All your program has to do is read data from the stream and the Java stream object does all the hard work.
@JohnRennie What does book mean by Byte Stream / Charac. stream?
Historically there has been two sorts of data that programs dealt with. Character data is normal text like I'm typing now. Binary data is everything else.
There isn't really a difference except that with character data some bytes have special meaning. For example in character data \n marks the end of a line of text.
@JohnRennie What does book mean by 'Standard output stream'
In your previous apps you've used calls like System.out.println to print output.
07:44
K?
What this function does is write the data to a special stream called the standard output stream. By default this stream corresponds to the console you're running the program in i.e. system.out.println just prints to screen.
So the stadnard output stream is like any output stream, but instead of sending the data to a file it sends it to your screen.
There is also a standard input stream that reads data from the user i.e. when you read from standard input you're reading what the user types on their keyboard.
@JohnRennie What is buffer?
All Java apps have these two standard streams so you can always read from and write to them without needing to anything special first.
BufferedInputStream, BufferedReader...etc
@Abcd Suppose you are reading data from a file, and you are reading it one character at time. It's very inefficient for the operating system to have to read the data from the disk one byte at a time. So what the operating system actually does is read a big chunk of data into temporary storage. Then when you read the next character the operating system can get it from the temporary storage.
This memory used as temporary storage is called the buffer.
07:52
@JohnRennie how is storage disk any different from buffer
The disk is a mechanical device. To read data from the disk you have to instruct the disk to move the head to where the data is physically stored on the disk. This takes a few milliseconds, so disk i/o is always relatively slow.
A buffer is effectively just a big array so reading from it is like reading any data from memory i.e. very fast.
@JohnRennie I have this short program I guess if you explain it line by line, it will make understanding of streams better:
@JohnRennie starting from InputStreamReader isr = ..... part
System.in is the standard input stream i.e. when you read from this stream you are reading what the user types on the keyboard.
You can read directly from System.in however for reasons I'm not sure about the code creates a new InputStreamReader object and passes System.in to the constructor. This create an InputStreamReader object that also reads what the user types at the keyboard.
@JohnRennie dint understand System.in properly
@JohnRennie hi. Please ping when free
08:05
@Abcd You've used System.out haven't you?
e.g. System.out.println prints a line to the standard output (i.e. the screen)
@JohnRennie I used it, and I used System.in also at many places but I never really understood what these things are
@Don'tbeax-tripledot thanks
Let me see if I can make sense xD
The thing about streams is you don't need to worry about exactly what they are or how they work. All you need to know is that you can read data from them.
In this case when you read data from System.in you are reading input from the user.
@Zerix will do, though it will be a while as I need to go back to work soon.
@JohnRennie what is $System$ exactly and what is $in$
@JohnRennie So I should memorize the codes related to File Handling??
System is an object that is defined by Java for any Java app. Your app can use the methods and fields in the System object.
08:11
@JohnRennie okay
One of the fields in the System object is the input stream in.
So System.in is an input stream.
08:27
@JohnRennie but you said streams are objects not fields, dint you??
Back in circa 30 minutes. Urgent work.
@Abcd OK
19 mins ago, by Abcd
@JohnRennie So I should memorize the codes related to File Handling??
@JohnRennie please reply to this also^ .
@Zerix hi, I'm free now.
08:56
@JohnRennie Back/.
@Abcd hi
Where do you want to pick up the previous discussion?
these 2 msgs:
30 mins ago, by Abcd
@JohnRennie but you said streams are objects not fields, dint you??
28 mins ago, by Abcd
19 mins ago, by Abcd
@JohnRennie So I should memorize the codes related to File Handling??
Re the latter: obviously some memorisation of the different types of streams and the methods they support is required, but it will be much easier to remember all those details if you have a grasp of what is going on with streams.
kay
Re the former: when you define a class in Java that class can have fields and methods.
Fields are class variables while methods are class functions.
Fields can have any type e.g. int, string, or another class like InputStream
The variable System is a class provided by Java for apps to use. It's definition will include:
class System
{
...
  static InputStream in;
...
So in is a field of type InputStream in the System class
09:05
oh
Likewise the System class has a field of type PrintStream called out, so System.out is a PrintStream object.
@JohnRennie What do the InputStream and OutputStream classes actually contain??
They contain loads of code to manage input and output that you don't need to worry about. The whole point of classes is that you only need to know what they do, not the fine details of how they do it.
so we were on:
InputStreamReader isr = new InputStreamReader(System.in);
@JohnRennie isr will read user input through its methods?
What you often find in Java is that you get simple classes, then more complicated classes that add extra methods to the simple class.
In this case the code reads a line entered by the user using stdin.readLine()
This is convenient because readLine always reads a complete line up to the end of line marker. So when you call it you get everything the user has typed up to when they pressed Enter.
You are guaranteed it won't ever return just part of a line.
OK so far?
09:19
@JohnRennie why not isr.readLine() instead of stdin.readLine()?
It doesn't have a readLine method.
@JohnRennie oh I see.
@JohnRennie What are we doing when we pass isr in stdin's constructor?
That's why the code uses a BufferedReader object, because BufferedReader does have a readLine method
@Abcd look in the BufferedReader description that I linked to see what the constructors do.
One of the things you can do is pass an InputStreamReader to the constructor to tell the BufferedReader to read its data from that input stream.
??
@Abcd can you be more precise about what is troubling you
09:24
@JohnRennie Reader in is written in its constructor but we are sending InputStreamReader in
Look at the InputStreamReader description. InputStreamReader is a subclass of the Reader class.
When a function accepts an object of class Reader that means it also accepts all classes that are subclasses of Reader. In this case that means we can pass an object of type InputStreamReader to it.
OK
what does this mean:
> Creates a buffering character-input stream that uses a default-sized input buffer
So the code creates a BufferedReader object stdin and passes the InputStreamReader isr to the constructor. That means when you read data from stdin the stdin object will read its data from the isr stream.
@Abcd we were talking about buffers earlier, and why they improve performance.
The InputStreamReader is not buffered, so it could be slower than a BufferedReader.
isr is not being intuitive to me i am afraid
The argument is that using a BufferedReader is good because it has a readLine() method that is convenient for us to use. OK so far?
09:34
@JohnRennie yes
Now, we need to tell the BufferedReader object where to get the data from. Yes?
yes
And the only way BufferedReader has of doing that is to pass an input stream to the constructor. So when we create the BufferedReader object we need to give it some form of input stream so it knows where to get the data.
@JohnRennie but isr is no where taking values and giving to stdin
@Abcd aha, yes it is!
09:38
@JohnRennie where
Because just like BufferedReader you need to tell an InputStreamReader where to get its data from.
When the code creates the InputStreamReader it passes System.in to the constructor. That is telling the InputStreamReader to read its data from System.in.
So when you call stdin.readLine() it calls the read method from the InputStreamReader, and that calls the read methd from System.in.
The user types stuff and System.in receives this data. Then System.in passes that data to isr, then isr passes the data to stdin, and finally the app gets the data using stdin.readLine().
@JohnRennie What do the lines inside try{} mean?
The first three lines are creating the output stream that the app is going to write to. The reason for taking three lines to do this is kind of similar to the way it took three lines to arrange the input.
The author of the code wants to use println to write the output because that's convenient. And println is a member function of the PrintWriter class. So you need to create an object of type PrintWriter.
@Zerix I finished the manga. None of the party members are named zerix
@JohnRennie please tell that. ("the reason")
09:52
As it happens the PrintWriter class has a constructor that takes a file name, so the code could have just used:
PrintWriter outFile = new PrintWriter(fileName);
As far as I can see this does the same as the three lines of code that the person writing this app used, so I can't explain why they chose to write the code using three lines.
@JohnRennie they have created buffer, you havent
@Abcd True. I suppose using a buffer could improve performance. I guess that's why they did it.
10:24
@JohnRennie Hi
@AvnishKabaj I was just joking xD. Did you really finish the manga
@Dante hi
I have only read till they go to the island. Currently keeping it on hiatus
Somewhere chapter 33-34 I guess
@JohnRennie hi. Are you free now
10:40
@Zerix hi, yes
@JohnRennie I need help with this one
I will ask after dante
@Dante You need to figure out if the disk slips or not, but given that the force being applied is much greater than $\mu mg$ I would start by assuming that it does slip.
Yeah, it does slip
Then friction will act
10:46
Torque due to the force and friction should add up right?
@Dante yes
Just assume the direction signs adjust themselves
But that's not the case :(
@AvnishKabaj Didn't get you.
@Dante @JohnRennie what about point of contact. It's the Point of pure rotation
@Zerix no it isn't because the disk is sliding
10:47
@Zerix There is slipping.
Wait no pure rolling
@Dante it's the same thing as
@Zerix correct
Assume a particle is acted upon a constant force in the positive x axis
You know that it's a constant force
Their solution
@AvnishKabaj Okay?
10:49
And you've been given that it starts from test and it's final velocity
Now obviously since the final velocity is positive
The force will act In the positive direction
Even if you assume that the force is acting in the negative direction and proceed to solve the question
@Dante in that case you have to work out both translation and rotation equations.
You'll get the correct direction.
Yeah. Signs adjust which is a real help
@AvnishKabaj How does that work in this problem?
@Dante I just assume the direction of friction in any direction
Saves time
10:54
How would you start working out on this problem?
One equations for Lom
Second from torque
Third from no slipping
Q22
What to do after finding the electric field wave
How to find frequency
@AvnishKabaj What's LOm?
@Zerix Hmm, that's a weird light wave ...
3
@Dante laws of motion
11:03
@Zerix I'd guess you need to use a trig identity to convert the $\sin A \sin B$ term to a sum of two cosines.
That's what I thought xD
@AvnishKabaj Ok '_'
@JohnRennie okay. I did that. What to do after splitting
There are two waves!
$$ \cos A - \cos B = -2 \sin((A+B)/2) \sin((A-B)/2) $$
Work out the higher frequency, then $hf$ gives you the energy of the photons corresponding to that higher frequency. Subtract off the work function to get the maximum photoelectron KE.
@JohnRennie got it
11:09
@AvnishKabaj Not sure what you mean, you have time to explain me or shall I ask professor?
Asking it because you must be preparing for JEE too.
@Dante I think you're over complicating this. Just calculate the total torque, then that torque is equal to $I\alpha$.
@JohnRennie Why would the friction act in forward direction?
@JohnRennie what dante is confused about is direction of friction. Friction should oppose motion but here it's acting at sane direction with F
@Dante it doesn't ...
Oh wait ...
@JohnRennie Look at the solution!
11:17
Even I am confused about this
I think the solution is wrong.
Lol. As expected
If the force acted below the axle then you'd subtract the two torques. For forces bove the axle you add them.
Ummm. That's a FIITJEE aits problem though...
@Abcd Encountered this in AITS?
The com moves forward. So friction has to act opposite it. Atleast that's how I see
11:20
@JohnRennie Maybe friction starts acting in same direction when Force is greater than $\mu mg$ ?
I just imagined it happening
Isn't the force already greater than friction?
Yeah,
So Com has to move forward and friction has to oppose it. That's how it works in translatory motion
@Zerix Right.... a of com will be much greater.....
@Dante it's better to confirm with abcd.
or avinish
11:27
Even avnish is FIITJEEian?
Um yeah. I think so
hm
@JohnRennie Any comments?
I still think it's an error
Okay
Q3
Can you help me with this
I know it's not helium
11:32
What is $Z$?
Compressibility factor
For helium, it's greater than 1
That leaves argon and pentane
Is this factual or there is logic
As a rule $Z$ decreases when attractive forces between molecules dominates, and it increases when the finite volume of the molecule dominates.
@JohnRennie Remove friction and check when is acceleration of point of contact :-)
So the mystery molecule has greater attraction between molecules than ammonia.
$\alpha$ will be much higher than acceleration than center of mass
So friction acts in forward direction.
11:37
It doesn't seem likely that noble gases have stronger attractive forces than ammonia, so my guess would be pentane.
Yes. You are right
@JohnRennie Q4
Last two option
Doing the xalculation gives me P=Zatm
Never mind me. Your logic above answers this
9 mins ago, by John Rennie
As a rule $Z$ decreases when attractive forces between molecules dominates, and it increases when the finite volume of the molecule dominates.
So b dominates Z increases hence pressure greater than 1 atm
a dominates Z decreases hence pressure less than 1 atm
@JohnRennie @Dante Gtg. see you guys later
Cya!
@Zerix bye
@JohnRennie are you there
@Abcd hi
11:52
@JohnRennie word formatting. How to fix ...forgot
The paragraph line spacing is too small.
what to do?
Let me open Word so I can give you exact instructions ...
Right click on the line and choose Paragraph
Change the line spacing to Multiple or At least
K done works now.
@JohnRennie this is silly. but could you suggest a picture to include on the cover page :P ?
i cant find any good pics on net
What is the document?
11:57
@JohnRennie it is the cover page of practical file consisiting of 30 programs.
I probably wouldn't use a picture. The person marking it probably won't care.
02:00 - 12:0012:00 - 13:00

« first day (713 days earlier)      last day (2206 days later) »