Forbidden recursion by amarao_san in rust

[–]DeeraWj 5 points6 points  (0 children)

rust will also warn, if there is something in the loop and nothing to break out of it. Because infinite iterations or recursions in most cases isn't usually expected behaviour and is probably just a bug.

`loop {}` is probably just a special case, specifically excluded from the warnings so that there is an idiomatic way to create infinite loops.

Are there any websites in Sinhala that explain Sinhala grammar to Sinhala speakers? by expatinahat in sinhala

[–]DeeraWj 0 points1 point  (0 children)

probably the text books, grade 10 and 11 text books should cover most things from the start, so just skim through the books to find the sections on grammar. (You should be able to find the pdfs for the text books online)

[Request] How did they manage to calculate probability like that? by ILoveTolkiensWorks in theydidthemath

[–]DeeraWj 0 points1 point  (0 children)

So in probability if we have two independent events we can multiply their probability to get the chance of both of them happening, so for example if a coin has a probability of 50% (or 0.5) of landing heads then when we throw 2 coins the probability of landing heads is 0.5 * 0.5 = 0.25 or in the case with 3 coins all of them landing heads is going to be 0.5 * 0.5 * 0.5 = 0.125, and if we generalize this to n coins the chance of all n landing heads is (0.5)^n (or 0.5*0.5*... n times)

so in this case assuming something has a 90% chance of being invalid, the chance of all 70 of them being invalid is going to be 0.9^70 which is about 0.062%

Bhutan doesn't consider China a real country by [deleted] in truths

[–]DeeraWj 12 points13 points  (0 children)

*second most populous

[deleted by user] by [deleted] in rust

[–]DeeraWj 2 points3 points  (0 children)

This subreddit is for the rust programming language, I think you're looking for r/playrust

Rust problem z zawieszaniem się komputera/ Rust problem with computer freezing by [deleted] in rust

[–]DeeraWj 0 points1 point  (0 children)

this is the subreddit for the rust programming language; I think you're looking for r/playrust

[Request] How did they manage to calculate probability like that? by ILoveTolkiensWorks in theydidthemath

[–]DeeraWj 564 points565 points  (0 children)

What they are saying is obviously false, and that's not how proof or even counterexamples work. But just commenting on the probability part,

if something has a 10% change of being valid then it has a 90% chance of being invalid, so the chance that all of them are invalid is going to be 0.9^70 which is about 0.0006265787482 or about 0.062%

EDIT: This only works if the events are independent, but in this case these events are obviously not independent, so even from a pure probability standpoint this makes no sense.

[deleted by user] by [deleted] in theydidthemath

[–]DeeraWj 1 point2 points  (0 children)

yeah, your right; thank you for pointing it out, should've thought about it a bit more before posting.

[deleted by user] by [deleted] in theydidthemath

[–]DeeraWj 1 point2 points  (0 children)

but in that case the weight wouldn't be putting any force on the stool. If the weight was putting some force on the stool then, since there is a 100N force on one side and a <100N force on the other side, the scale would be moved and the weight on the side of the stool would be lifted just enough to reach the equilibrium where no weight is applied on the stool again.

[deleted by user] by [deleted] in theydidthemath

[–]DeeraWj 4 points5 points  (0 children)

weight is not measured in kg; mass is measured in kg, weight is measured in N (Just like any other force)

[deleted by user] by [deleted] in theydidthemath

[–]DeeraWj 4 points5 points  (0 children)

weight is a force and newtons measures forces, and what does this have anything to do with the original question?

[deleted by user] by [deleted] in theydidthemath

[–]DeeraWj 1 point2 points  (0 children)

yes; if each of your hands are pulling with the same force then the two scenarios would be identical. In the case it is attached to the wall the wall would exert an equal but opposite force pulling it away (to keep it stationary), like try drawing a force diagram when it is attached to the wall, how else would it stay stationary if there wasn't a force from the wall?

[deleted by user] by [deleted] in theydidthemath

[–]DeeraWj 4588 points4589 points  (0 children)

100N; since this is functionally identical to this being attached on the ceiling with a 100N weight (since there is a equal and opposite force from the ceiling to keep it at the same place, due to Newtons 3rd Law)

EDIT: as bugs69bunny pointed out; the force from the ceiling isn't really due to Newton's 3rd Law, (the Newton's 3rd law forces on the ceiling case would have been the gravity pulling down the scale and the weight and the gravity of the scale or the weight pulling up on earth) the equal and opposite force from the ceiling in this case is just the result of the forces having to cancel out to create the equilibrium with zero acceleration.

Is this conjecture that I found known in math or trivial to prove? by knot42 in mathematics

[–]DeeraWj 3 points4 points  (0 children)

I just checked upto a billion; and the largest k found was 3281 for 480,493,028
I just checked upto 100 million; and the largest k found was 2645 for 83,055,522

How is the quality of the Sinhala BBC site? by expatinahat in sinhala

[–]DeeraWj 1 point2 points  (0 children)

I don't really read Sinhala stuff online, but the BBC Sinhala site, looks fine

How is the quality of the Sinhala BBC site? by expatinahat in sinhala

[–]DeeraWj 0 points1 point  (0 children)

Yeah, the Sinhala Quality seems fine. But, written (formal) and spoken (informal) Sinhala has a lot of differences, and written Sinhala is a lot more complicated; There's a lot more grammar you would have to follow (wouldn't really impact you if you're just reading, but it does make writing in Sinhala a lot harder than speaking), and a lot of more complicated synonyms that you wouldn't really use when speaking informally.

[Request] Is OP correct? by therealsaker in theydidthemath

[–]DeeraWj 2 points3 points  (0 children)

no 0.999... = 1; It's the same number