Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homework1 #5

Open
amra12 opened this issue Oct 16, 2017 · 1 comment
Open

Homework1 #5

amra12 opened this issue Oct 16, 2017 · 1 comment
Labels

Comments

@amra12
Copy link

amra12 commented Oct 16, 2017

Hi Professor,

For the excersise 3.2 , for the example which is abcabcda after I found the probabilities and put them in dictionary  dic_prob= {bcd : 0.5 , bca:0.5}  ,
the text can be for example bcdad  right?

And last thing when I use loop to add either 'a'with probability 0.5 or 'c' with probability 0.5 , how can I attach this adding character based on the probability , I mean is there something out of the box , or should I invent a new algorithm my self?

@juditacs
Copy link
Collaborator

There is really nothing more to invent, you basically described the solution. Strings can be concatenated using the + operator. You don't need any black-box algorithms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants