I am making plan for my personal project.I have deadline for top level task(Project Planning- 31 days). I have rough idea of how I can divide these 31 days among sub-tasks. For example, Problem definition may take around 5 days, but those 5 days can be distributed over a certain period (21 days in this case). How can make my plan in this format using microsoft project ?
Although it has been pointed out that this type of planning will not be effective, there is a way to distribute work based on percentage of time in Project.
Click on the task and then click on the Details view on the ribbon (Task -> Properties -> Details).
In the detail view, change your task type to "Fixed Duration".
Then add your resource and modify the "Work" hours to align with the number of hours you expect the work to take.
I'll go back to the comment on your original post though. In this scenario, you are making Project communicate an outcome that you have already predetermined, which is very risky as nobody can predict the future. The proper way to approach your project is the estimate the amount of time it takes to complete the tasks you have identified and then sequence them accordingly, which will determine your end date. Follow up on the progression of your tasks weekly to ensure that there is no slippage that will affect your deadline.