Ask your own question, for FREE!
Mathematics 15 Online
OpenStudy (alyssa_xo):

Find \(\overrightarrow L_1,\overrightarrow L_2,\) the normalized frequency vectors for some frequency distributions...

OpenStudy (alyssa_xo):

the frequency distribution came out to [46, 12, 16, 24, 65, 18, 10, 20, 28, 1, 2, 22, 14, 37, 39, 11, 0, 29, 45, 46, 15, 6, 4, 1, 9, 0] how would I normalize this?

OpenStudy (alyssa_xo):

for reference, this is the frequency of each individual letter in a paragraph of english I have another thing of polish (which has 32 letters)

OpenStudy (kainui):

Well normalize really just means set it equal to one. Since these are all representing probabilities, when you add them all up you should get 100% yeah? So in order to do that you just have to add them all up to get their total and then divide every number in it by the total. That'll normalize it I believe.

OpenStudy (alyssa_xo):

oh, okay. I figured there was something involving squaring the sum of the squares or something. Didn't really look into it too much

OpenStudy (alyssa_xo):

I have another question about the dot product

OpenStudy (alyssa_xo):

for reference, this is about comparing paragraphs of text to test the probability they're in the same language if \(\overrightarrow L_1*\overrightarrow T\) (where T is a normalized frequency of some text we're testing) if it were closer to 0 would that mean they're likely the same language?

OpenStudy (alyssa_xo):

frequency vector*

OpenStudy (alyssa_xo):

because the question says that l1*T=0.25 and L2*T=0.83 I figure if cos(0) is 1, if the angle is really small they should be 1

OpenStudy (alyssa_xo):

I think I just contradicted myself

OpenStudy (kainui):

Yeah you totally did. Wanna think about it a little or should I give you my answer?

OpenStudy (alyssa_xo):

I'm sticking with the 2nd thing, if the dot product is closer to 1, they probably have the same frequency of letters.

OpenStudy (kainui):

Well if you're given this \(\overrightarrow L_1 \cdot\overrightarrow T = 0\) That means they're orthogonal right? Just dot i hat and j hat together to check yourself (before reckt). That's pretty much it I think.

OpenStudy (alyssa_xo):

orthogonal is perpendicular, right? anyhow, what we're given is \(L_1=0.25, L_2=0.83\). I don't have the actual T to test

OpenStudy (alyssa_xo):

oh wait, if they're orthogonal, that means they're different, right?

OpenStudy (kainui):

Yeah orthogonal, perpendicular, and normal all mean they're 90 degrees away from something basically the exact same thing.

OpenStudy (alyssa_xo):

because if they were more similar the angle between them would be closer to 0

OpenStudy (alyssa_xo):

rofl, I'm sorry. I should have taken linear algebra instead of just jumping into this class (cryptography)

OpenStudy (kainui):

Yeah, basically, I wouldn't worry about it too much mostly it's all jargon complicating how to move around number boxes honestly.

OpenStudy (kainui):

Kind of cool though, crypotgraphy sounds fun, get to find the angle between english and polish sounds super weird lol

OpenStudy (alyssa_xo):

Thanks a bunch, I fanned+medalled you, please do the same for me. oh no those are 2 problems

OpenStudy (alyssa_xo):

``` public static void main(String[] args) { // TODO Auto-generated method stub char polishLower[] = {'a', 'ą', 'b', 'c', 'ć', 'd', 'e', 'ę', 'f', 'g', 'h', 'I', 'j', 'k', 'l', 'ł', 'm', 'n', 'ń', 'o', 'ó', 'p', 'r', 's', 'ś', 't', 'u', 'w', 'y', 'z', 'ź', 'ż'}; int polishFreq[] = new int[polishLower.length]; char englishLower[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; int englishFreq[] = new int[englishLower.length]; //System.out.println(Arrays.toString(polishLower)); String polishParagraph = "Prawdopodobnie organizmy eukariotyczne wywodzą się z prokariotycznych archeonów[4] (a w każdym razie są z nimi spokrewnione bliżej niż z bakteriami[5]), jednak ich wczesne dzieje ewolucyjne są słabo znane. Uznaje się za możliwe, że po prokariotycznych jeszcze przodkach wczesne jądrowce odziedziczyły zdolność do ruchu ameboidalnego i owletocytozy, lecz znacznie ją udoskonaliły. Głównym jednak \"wynalazkiem\" była reorganizacja materiału genetycznego. Komórka eukariotyczna zawiera wielokrotnie więcej materiału genetycznego niż prokariotyczna, dzięki czemu jest w stanie produkować więcej typów białek i ma potencjalnie nieograniczone możliwości regulacji. Materiał genetyczny występuje tu w postaci wielu skupionych w jądrze chromosomów. Są to liniowe fragmenty DNA związanego z licznymi białkami, które chronią go, powielają i precyzyjnie sterują ekspresją. Komórki eukariotyczne posiadają wiele organelli – zarówno analogiczne do występujących u prokariotów np. rybosomy czy chromosomy (odpowiadające bakteryjnemu genoforowi), jak i takie, których u żadnych prokariotów nie ma. Do tych drugich należy retikulum endoplazmatyczne wraz z błoną jądrową oraz mitochondria i plastydy (np. chloroplasty). Przynajmniej te dwa ostatnie pochodzą ze stosunkowo późnej w skali ewolucyjnej endosymbiozy komórek wczesnych jądrowych z bakteriami i sinicami. Wreszcie ponad miliard lat temu komórki eukariotyczne wykształciły możliwość rozmnażania drogą płciową, co jeszcze bardziej zwiększyło ich możliwości ewolucyjne[6]."; String englishParagraph = "Precise numbers are difficult to determine, but as of 2010, there are thought to be 300–315 thousand species of plants, of which the great majority, some 260–290 thousand, are seed plants (see the table below).[1] Green plants provide most of the world's molecular oxygen[2] and are the basis of most of the earth's ecologies, especially on land. Plants that produce grains, fruits and vegetables form mankind's basic foodstuffs, and have been domesticated for millennia. Plants are used as ornaments and, until recently and in great variety, they have served as the source of most medicines and drugs. The scientific study of plants is known as botany, a branch of biology."; polishParagraph = polishParagraph.toLowerCase(); englishParagraph = englishParagraph.toLowerCase(); for (int i = 0; i < englishParagraph.length(); i++){ char c = englishParagraph.charAt(i); for(int j=0;j<englishLower.length;j++) { if(c==englishLower[j]) ++englishFreq[j]; } } /*for(int i=0;i<englishLower.length;i++) { System.out.println(englishLower[i] + ": " + englishFreq[i]); }*/ System.out.println(Arrays.toString(englishFreq)); } ```

OpenStudy (kainui):

I can't sry I'm cis white male donkeykong kin

OpenStudy (alyssa_xo):

LOL

OpenStudy (kainui):

Oh awesome you're using Java, like the only programming language I know lol

OpenStudy (alyssa_xo):

the sheet is lined out: 1) find random english text, construct frequency diagram 2) find random Polish, Lavian, Hungarian, finnish, turkish, or vietnamese text and do the same 3) find the normals, make the conclusion, and then select another 2 conclusions to make sure t he dot product test correctly identifies the language

OpenStudy (alyssa_xo):

pretty simple, b ut it's the first homework

OpenStudy (kainui):

I'm kind of surprised your class isn't using MATLAB since it's more geared towards this I would think.

OpenStudy (alyssa_xo):

it's listed in both the CS/Math departments Meaning some kids in the class are math majors that might not know Java.

OpenStudy (alyssa_xo):

we weren't limited to java, I've just come around to it recently. it's nice and robust :3

OpenStudy (kainui):

Cool, yeah I just started learning it about a year ago cause my brother was using it and he could help me get started in creating android apps. I gotta say I really like Java now that I understand how to use interfaces to design my programs correctly lol.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!