SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 313 Weeks Ago, 6 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 17 Dec 2017 My Price 10.00

Markov chain to create a statistical model of a piece

using python 2.7 solve the problem. comments and directions are included.

  •  
     
     
     
     
     
     
     
    Project 5 (Markov Model)
    Clarifications and Hints
    1 / 11
    Prologue
    Project goal: use a Markov chain to create a statistical model of a piece of English text
    and use the model to generate stylized pseudo-random text and decode noisy messages
    The zip file (
    http://www.swamiiyer.net/cs110/markov_model.zip
    ) for the project contains
    •
    project specification (
    markov_model.pdf
    )
    •
    starter files
    •
    markov_model.py
    •
    text_generator.py
    •
    fix_corrupted.py
    •
    test script (
    run_tests.py
    )
    •
    test data (
    data/
    )
    •
    report template (
    report.txt
    )
    This checklist will help only if you have read the writeup for the project and have
    a good understanding of the problems involved. So, please read the project
    writeup
    m
    before you continue with this checklist.
    2 / 11
     
    Prologue
    Understanding how dictionaries work is crucial for this project, so make sure you
    understand the following example which illustrates how you create a dictionary of
    dictionaries and how you manipulate them
    >>> M = {} # create an empty dictionary M
    >>> M.setdefault(’ba ’, {}) # add key/value pair ’ba ’/{} to M
    {} # since ’ba ’ didn ’t exist in M,
    # {} (the value just added) is returned
    >>> M # check M
    {’ba ’: {}}
    >>> M[’ba ’]. setdefault(’n’, 0) # add key/value pair ’n’/0 to the
    # dictionary M[’ba ’]
    0 # since ’n’ didn ’t exist in M[’ba ’],
    # 0 (the value just added) is returned
    >>> M # check M
    {’ba ’: {’n’: 0}}
    >>> M[’ba ’][’n’] += 1 # increment the value corresponding to the
    # key ’n’ in the dictionary M[’ba ’] by 1
    >>> M # check M
    {’ba ’: {’n’: 1}}
    >>> M[’ba ’]. setdefault(’n’, 42) # add key/value pair ’n’/42 to the
    # dictionary M[’ba ’]
    1 # since ’n’ exists in M[’ba ’],
    # setdefault () simply returns (without
    # changing) the corresponding value , 1
    >>> M # check M
    {’ba ’: {’n’: 1}}
    >>> M.setdefault(’an ’, {}) # add key/value pair ’an ’/{} to M
    {}
    >>> M # check M
    {’ba ’: {’n’: 1}, ’an ’: {}}
    3 / 11
     

Attachments:

Answers

(5)
Status NEW Posted 17 Dec 2017 12:12 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)