## 11201 - The problem of the crazy linguist

Moderator: Board moderators

hamedv
Learning poster
Posts: 98
Joined: Mon May 07, 2007 8:30 am
i'm using :

Code: Select all

``````FreePascal IDE for Win32 for i386
Target CPU: i386
Version 1.0.4 2005/05/08
(Compiler Version 2.0.0)
``````
but i got CE

Code: Select all

``GOT AC``

smilitude
Experienced poster
Posts: 137
Joined: Fri Jul 01, 2005 12:21 am
Mushfiqur Rahman wrote: u will get wrong answer because u misunderstood the problem.

In this problem u have to calculate the SBC of all the words which start with the same latter as given word( with the same length ) then find the average and have to determine the given words SBC is "below" or "above or below" than the average.
why is the output for "bubu" is "below" ?
i think "bubu" is a valid word, and there is no other length 4 word, that starts with b; so it should be "above or equal" ??

am i missing any point here ?
fahim
#include <smile.h>

TimeString
New poster
Posts: 26
Joined: Mon Nov 13, 2006 3:53 am
smilitude wrote:why is the output for "bubu" is "below" ?
First thing we should consider is how many vaild words are there?
The problem says the first letter is the same as the given word, second and fourth letter have 5 choices separatedly, and the third letter has 21 choices. So total possible words is 5x21x5=525, and the average of the possiblity of one word is 1.0 / 525 = 0.00190...

And accroding the table, we can find the possibility of the word "bubu" is (because first letter won't change):
( 0.0393/sumP{aei...} ) x ( 0.0142/sumP{bcd...} ) x ( 0.0393/sumP{aei...} ) = 0.0000219...
That's why the answer in this case is below.

smilitude
Experienced poster
Posts: 137
Joined: Fri Jul 01, 2005 12:21 am
thanks!
i thought "how many valid words are there in the input"

edit : but you are telling me about probability, but they have a formula and a definition for SBC and thats different
fahim
#include <smile.h>

Scarecrow
Learning poster
Posts: 69
Joined: Wed Oct 19, 2011 9:06 pm

### Re: 11201 - The Problem of the Crazy Linguist

someone can help me please? getting WA

Code: Select all

``````AC
``````
Last edited by Scarecrow on Wed Feb 06, 2013 10:55 pm, edited 1 time in total.
Do or do not. There is no try.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 11201 - The Problem of the Crazy Linguist

It is usually better to avoid floating point when possible.
Check input and AC output for thousands of problems on uDebug!

Scarecrow
Learning poster
Posts: 69
Joined: Wed Oct 19, 2011 9:06 pm

### Re: 11201 - The Problem of the Crazy Linguist

Thanks! Got AC!
Do or do not. There is no try.