Question: Programming Probability Collector [ 2 6 pts ] : You must make sure your C + + program compiles with g + + and runs

Programming Probability Collector [26pts]:
You must make sure your C++ program compiles with g++ and runs on empress.csusm.edu or 0pts.
Your language alphabet is A, B, C. You want to be able to later compute P(any word).
A program already went through the training corpus to collect trigram probabilities for:
P(A | nothing before)
P(A | only A before)
P(A | only B before)
P(A | only C before)
P(A | AA)
P(A | AB)
P(A | AC)
P(A | BA)
...
P(B | nothing before)
P(B | only A before)
,,,,
P(C | nothing before)
P(C | only A before)
...
Q1) How many probabilities did it have to collect? Why? [3]39
After answering this question, write a C++ program to read a file containing these probabilities and store them in some data structure. You have to prepare your own input file with made-up numbers. Name it nlpProb.txt (My sample-input has the alphabet of a and b only).
Make sure it displays the content of the data structure in an easy to read format. [10]
Q2) How do you compute P(abca)? Give the equation. [3] p(a)* p(b|a)* p(c|ab)
After answering this question, extend your program so that it will allow the user to enter any word made up of A, B, and/or C and it will compute and output its probability.
Make sure it displays all the Ps that were used to compute the answer as I did. [10]
(see my demonstration program that uses the alphabet of a and b only)
Test your program on abbcabaac and cab(you should test more but these are required to be submitted) Must be submitted or you will not get any credit for the program!!
You must submit the outputs even if the programs do not work.
In that case, provide the bug report here: **

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!